π 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 | 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',
model: 'gemma:2b'
},
llama: {
url: 'http://localhost:11434/api',
model: 'llama3.2:3b'
},
deepseek: {
url: process.env.DEEPSEEK_API_URL,
key: process.env.DEEPSEEK_API_KEY
}
};
}
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
`;
// 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
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