# Building an AI Automation System for MyZubster

> Source: <https://dev.to/danielioni/building-an-ai-automation-system-for-myzubster-4k2>
> Published: 2026-07-31 08:01:30+00:00

🚀 Building an AI Automation System for MyZubster

Introduction

MyZubster is an open-source ecosystem for plant mapping, privacy-first payments with Monero, and human-centered AI. In this post, I'll share how I built an AI automation system that automatically handles GitHub issues, bounties, and Telegram notifications.

📋 The Problem

Managing an open-source project like MyZubster is complex:

```
Too many issues requiring manual triage

Bounties need to be created and managed manually

Slow communication with contributors

Manual monitoring of GitHub activity
```

🎯 The Solution

I built a modular system that:

```
Monitors GitHub - Automatically detects new issues and PRs

Analyzes with AI - Uses local models (Gemma, Llama, DeepSeek)

Creates bounties - Automatically for labeled issues

Sends notifications - Real-time alerts on Telegram

Orchestrates everything - With automatic fallback between AI models
```

🏗️ Architecture

text

┌─────────────────────────────────────────────────────────────┐

│ MyZubster AI Automation │

├─────────────────────────────────────────────────────────────┤

│ │

│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │

│ │ Telegram │ │ GitHub │ │ AI Models │ │

│ │ Bot Handler │ │ Monitor │ │ │ │

│ └──────────────┘ └──────────────┘ └──────────────┘ │

│ │ │ │ │

│ └─────────────────┼──────────────────┘ │

│ │ │

│ ┌────────▼────────┐ │

│ │ Automation │ │

│ │ Orchestrator │ │

│ └─────────────────┘ │

│ │ │

│ ┌─────────────────┼──────────────────┐ │

│ │ │ │ │

│ ┌──────▼──────┐ ┌───────▼───────┐ ┌──────▼──────┐ │

│ │ Database │ │ Backend │ │ Frontend │ │

│ │ (MongoDB) │ │ (Node.js) │ │ (React) │ │

│ └─────────────┘ └───────────────┘ └─────────────┘ │

│ │

└─────────────────────────────────────────────────────────────┘

🛠️ Technology Stack

Core Technologies

```
Node.js - Runtime environment

Express - API server

MongoDB - Database with Mongoose ODM

React - Frontend with Leaflet maps
```

AI Stack

```
Ollama - Local AI model runner

Gemma 2B - Google's lightweight AI model (default)

Llama 3.2 - Meta's powerful model (fallback)

DeepSeek R1 - Reasoning model (fallback)
```

Automation Stack

```
node-telegram-bot-api - Telegram integration

Octokit - GitHub API client

node-cron - Scheduled tasks

systemd - Service management

Winston - Logging
```

🧠 AI Models Setup

The AI models run locally using Ollama. Here's how I set them up:

Installing Ollama

bash

curl -fsSL [https://ollama.com/install.sh](https://ollama.com/install.sh) | sh

Pulling the Models

bash

ollama pull gemma:2b

ollama pull llama3.2:3b

ollama pull deepseek-r1:1.5b

Testing the Models

bash

ollama run gemma:2b "What is MyZubster?"

🤖 The Telegram Bot

The bot provides interactive commands for the community:

Available Commands

Command Description

/start Welcome message and guide

/status System and services status

/github Recent GitHub activity

/bounties List of active bounties

/analyze AI analysis of an issue

/help Show all available commands

Bot Configuration

javascript

class TelegramBotHandler {

async start() {

this.bot = new TelegramBot(this.token, { polling: true });

```
    // Register command handlers
    this.bot.onText(/^\/start/, this.handleStart.bind(this));
    this.bot.onText(/^\/status/, this.handleStatus.bind(this));
    this.bot.onText(/^\/bounties/, this.handleBounties.bind(this));
    this.bot.onText(/^\/github/, this.handleGitHub.bind(this));
    this.bot.onText(/^\/analyze/, this.handleAnalyze.bind(this));

    this.running = true;
    this.logger.info('Telegram bot is ready');
}
```

}

🐙 GitHub Monitor

The GitHub Monitor watches repositories and emits events:

javascript

const { Octokit } = require('@octokit/rest');

const EventEmitter = require('events');

class GitHubMonitor extends EventEmitter {

constructor(token, logger) {

super();

this.token = token;

this.logger = logger;

this.issues = {};

this.repo = process.env.GITHUB_REPO;

}

```
async start() {
    this.octokit = new Octokit({
        auth: this.token,
        userAgent: 'MyZubster-AI-Automation'
    });

    this.running = true;
    await this.checkNewIssues();
    this.startPeriodicCheck();
}

startPeriodicCheck() {
    setInterval(() => {
        this.checkNewIssues().catch(error => {
            this.logger.error('Periodic check failed:', error);
        });
    }, 300000); // 5 minutes
}
```

}

🧠 AI Orchestrator

The AI Orchestrator is the brain of the system. It uses multiple models with fallback strategies:

javascript

class AIOrchestrator {

constructor(logger) {

this.logger = logger;

this.models = {

gemma: {

url: '[http://localhost:11434/api](http://localhost:11434/api)',

model: 'gemma:2b'

},

llama: {

url: '[http://localhost:11434/api](http://localhost:11434/api)',

model: 'llama3.2:3b'

},

deepseek: {

url: process.env.DEEPSEEK_API_URL,

key: process.env.DEEPSEEK_API_KEY

}

};

}

``` js
async analyzeIssue(issue) {
    const prompt = `
```

Analyze this GitHub issue:

Title: ${issue.title}

Description: ${issue.body}

Labels: ${issue.labels.map(l => l.name).join(', ')}

Provide:

Suggested Bounty Amount

`;

``` js
// Try models in order with fallback
const models = [
    { name: 'gemma', config: this.models.gemma, method: 'ollama' },
    { name: 'llama', config: this.models.llama, method: 'ollama' },
    { name: 'deepseek', config: this.models.deepseek, method: 'api' }
];

for (const model of models) {
    try {
        return await this.analyzeWithModel(model, prompt);
    } catch (error) {
        this.logger.warn(`${model.name} failed, trying next...`);
    }
}

return this.getDefaultAnalysis(issue);
```

}

}

🔧 Systemd Service Management

For production deployment, I created a systemd service:

ini

[Unit]

Description=MyZubster AI Automation Service

After=network.target mongod.service

[Service]

Type=simple

User=root

WorkingDirectory=/root/myzubster/myzubster-merged/services/ai-automation

ExecStart=/usr/bin/node /root/myzubster/myzubster-merged/services/ai-automation/index.js

Restart=always

RestartSec=10

Environment=NODE_ENV=production

Environment=PORT=5678

[Install]

WantedBy=multi-user.target

📊 Real Example Analysis

Here's a real analysis from the system on a Monero payment issue:

text

📊 AI Analysis Results:

**1. Summary:**

The issue proposes adding Monero (XMR) payment support for bounties.

**2. Complexity:**

High. The integration of a new cryptocurrency like XMR involves technical

complexities related to API integration, smart contract development, and

potential compatibility issues with existing systems.

**3. Priority:**

High. Integrating XMR payments would attract crypto-focused users.

**4. Technical Approach:**

• Develop an API integration with the Monero blockchain

• Create smart contracts for managing bounties

• Integrate with the bounty platform

• Implement user interfaces

**5. Estimated Effort:**

3-4 weeks (120-160 hours)

**6. Suggested Bounty:**

0.01 XMR per bounty (~$2-5 USD)

🚀 Results

After deploying the system, I saw immediate benefits:

Metric Before After

Issue response time 24-48 hours < 5 minutes

Bounty creation Manual (2-3 days) Automatic (5 minutes)

Contributor notifications Manual emails Automatic Telegram

Time spent on triage 5+ hours/week 0 hours (automated)

📁 Project Structure

text

services/ai-automation/

├── src/

│ ├── telegram/

│ │ └── bot.js # Telegram bot handler

│ ├── github/

│ │ └── monitor.js # GitHub monitor

│ ├── ai/

│ │ └── orchestrator.js # AI orchestrator

│ └── orchestrator/

│ └── index.js # Main orchestrator

├── logs/

├── scripts/

├── .env.example

├── index.js

├── package.json

└── README.md

💡 Key Lessons Learned

```
Local AI is Powerful - Running models locally saves API costs and keeps data private

Fallback Strategies Matter - Multiple models ensure reliability

Event-Driven Architecture - Makes the system extensible and maintainable

Mock Mode - Enables testing without external dependencies

Systemd - Essential for production deployment
```

🔗 Links

```
Repository: https://github.com/MyZubster-Ecosystem/myzubster

Telegram Bot: @myzubster_bot

Telegram Channel: @myzubster

AI Service: services/ai-automation
```

📝 Try It Yourself

bash

git clone [https://github.com/MyZubster-Ecosystem/myzubster.git](https://github.com/MyZubster-Ecosystem/myzubster.git)

cd myzubster/services/ai-automation

npm install

cp .env.example .env

npm start

🎯 What's Next?

I'm planning to add:

```
Web Dashboard - Visual monitoring of all services

Slack Integration - Alternative notification channel

Auto-Reply - AI-powered responses to common issues

Sentiment Analysis - Understanding contributor sentiment

Multi-Repo Support - Monitor multiple repositories
```

🙏 Conclusion

Building this AI-powered automation system has transformed how I manage MyZubster. What started as a simple idea grew into a complete ecosystem that handles complex tasks automatically.

The best part? It's all open source and you can use it for your own projects too!

Built with ❤️ by the MyZubster Team
