Skip to main content

AI Telegram Bot powered by SimpleContext โ€” one-command setup, auto-downloads engine and agents.

Project description

๐Ÿค– SimpleContext-Bot

AI Telegram Bot powered by SimpleContext
Setup wizard ยท Auto-routing agents ยท Works with Gemini, OpenAI, Ollama

Python Telegram License SimpleContext Plugins Dynamic Plugins


โœจ What is this?

SimpleContext-Bot is a ready-to-run Telegram bot that uses SimpleContext as its AI brain.

A built-in setup wizard automatically downloads the engine and agents, then walks you through configuration step by step.


๐Ÿš€ Installation

1. Clone & Install

git clone https://github.com/zacxyonly/SimpleContext-Bot.git
cd SimpleContext-Bot
pip install .

2. Run Setup Wizard

simplecontext-bot setup

The wizard will handle everything:

Step 1/6  Download SimpleContext engine from GitHub   โœ…
Step 2/6  Download 9 agent definitions                โœ…
Step 3/6  Plugin Ecosystem (Optional)                 โ†’ pilih plugin yang diinginkan
Step 4/6  Telegram Bot Token                          โ†’ paste from @BotFather
Step 5/6  LLM Provider & API Key                      โ†’ choose Gemini/OpenAI/Ollama
Step 6/6  Final configuration                         โœ… Done!

3. Start

simplecontext-bot start

๐Ÿ”‘ Getting Your Tokens

Telegram Bot Token

  1. Open Telegram โ†’ search @BotFather
  2. Send /newbot and follow the steps
  3. Copy the token

Gemini API Key (free, recommended)

  1. Go to aistudio.google.com/app/apikey
  2. Click Create API Key โ†’ copy

OpenAI API Key

  1. Go to platform.openai.com/api-keys
  2. Click Create new secret key โ†’ copy

Ollama (local, no API key needed)

  1. Install from ollama.ai
  2. Run ollama pull llama3
  3. Make sure Ollama is running before starting the bot

๐Ÿง  Powered By

Repo Role
SimpleContext โ†’ AI brain โ€” tiered memory, context scoring, intent planning
SimpleContext-Agents โ†’ 9 ready-to-use agent definitions
SimpleContext-Plugin โ†’ Official plugin registry โ€” extend bot capabilities
LiteLLM pip Universal LLM connector

๐ŸŽฏ Auto-Routing

No need to manually switch agents. The bot detects the best agent for every message automatically:

"ada bug di python saya"   โ†’  ๐Ÿ–ฅ๏ธ  coding
"deploy ke server nginx"   โ†’  ๐Ÿš€  devops
"tulis caption instagram"  โ†’  โœ๏ธ  writer
"terjemahkan ke english"   โ†’  ๐ŸŒ  translator
"jelaskan konsep ini"      โ†’  ๐Ÿ“š  tutor
"ringkas artikel ini"      โ†’  ๐Ÿ“  summarizer
"cek fakta berita ini"     โ†’  ๐Ÿ”  researcher
"komplain order saya"      โ†’  ๐ŸŽง  customer_service
"analisis data penjualan"  โ†’  ๐Ÿ“Š  analyst

๐Ÿค– Available Agents

Agent Description
๐Ÿ–ฅ๏ธ coding Expert programmer โ€” debug, review, all languages
๐Ÿš€ devops Server, Docker, CI/CD, Linux infrastructure
โœ๏ธ writer Content, copywriting, email, social media
๐Ÿ“Š analyst Data analysis, business insights, KPIs
๐ŸŽง customer_service Empathetic CS, complaint handling
๐ŸŒ translator Multi-language, idiom-aware translation
๐Ÿ“š tutor Patient adaptive teacher for any subject
๐Ÿ” researcher Fact-checking, research, source evaluation
๐Ÿ“ summarizer Condense any content into clear summaries

๐Ÿ’ฌ Bot Commands

Command Description
/start Welcome message, saves your name
/help Show all commands
/agents List available agents
/agent <name> Switch to a specific agent
/agent auto Back to auto-routing
/clear Clear conversation history
/status Show current agent and stats
/memory Show your saved profile
/plugins List installed plugins & available plugins
/semantic <query> Search memory by meaning (requires vector-search plugin)

๐Ÿ”Œ Plugin Ecosystem

SimpleContext-Bot dapat diperluas dengan plugin dari SimpleContext-Plugin.

Plugin yang tersedia

Plugin Deskripsi Tested โœ…
vector-search Semantic similarity search โ€” temukan memory berdasarkan makna, bukan kata persis โœ…

Cara install plugin

Saat setup wizard โ€” wizard menawarkan plugin di Step 3.

Setelah setup โ€” via CLI:

simplecontext-bot plugins install vector-search

Manual (plugin komunitas): Cukup drop file .py ke folder ~/.simplecontext-bot/plugins/ lalu restart bot. Bot akan auto-detect dan load semua plugin di folder tersebut โ€” termasuk plugin komunitas dari SimpleContext-Plugin atau plugin buatan sendiri.

# Contoh: install plugin komunitas secara manual
cp my_custom_plugin.py ~/.simplecontext-bot/plugins/
simplecontext-bot start   # plugin langsung aktif

Plugin commands โ€” auto-register ke Telegram

Plugin bisa mendeklarasikan command sendiri via BOT_COMMANDS. Bot otomatis mendaftarkannya ke Telegram โ€” tidak perlu ubah kode bot sama sekali.

# Di file plugin kamu:
class MyPlugin(BasePlugin):
    BOT_COMMANDS = {
        "mycommand": {
            "description": "Deskripsi command",
            "usage":       "/mycommand <arg>",
            "handler":     "bot_cmd_mycommand",   # nama method di class ini
        }
    }

    async def bot_cmd_mycommand(self, sc, update, ctx, args):
        return f"Kamu kirim: {' '.join(args)}"

Setelah bot restart, /mycommand langsung tersedia di Telegram โ€” muncul di menu command dan terdaftar di /help secara otomatis.

/plugins
โ†’ โœ… vector_search_plugin v1.0.0
โ†’    Semantic vector search berbasis embedding
โ†’    โ€ข /semantic โ€” Cari memory berdasarkan makna
โ†’       Usage: /semantic <query>

/semantic kenangan liburan
โ†’ 1. [Semantic | โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 84%] user suka pantai dan hiking ...
โ†’ 2. [Episodic | โ–ˆโ–ˆโ–ˆโ–‘โ–‘ 67%] sesi kemarin bahas rencana trip ...

โš™๏ธ CLI Commands

simplecontext-bot setup                # First-time setup wizard (includes plugin selection)
simplecontext-bot start                # Start the bot
simplecontext-bot start --debug        # Start with verbose logging
simplecontext-bot status               # Show configuration
simplecontext-bot status --test        # Check + test LLM connection
simplecontext-bot agents               # List installed agents
simplecontext-bot update               # Update engine + agents
simplecontext-bot update --engine-only # Update engine only
simplecontext-bot update --agents-only # Update agents only
simplecontext-bot plugins list         # List all plugins
simplecontext-bot plugins install <id> # Install a plugin
simplecontext-bot plugins remove <id>  # Remove a plugin

๐Ÿ“ Files After Setup

Everything is stored in ~/.simplecontext-bot/:

~/.simplecontext-bot/
โ”œโ”€โ”€ config.json        โ† your settings (tokens, LLM config)
โ”œโ”€โ”€ bot.db             โ† conversation memory (SQLite)
โ”œโ”€โ”€ simplecontext/     โ† SimpleContext engine (auto-downloaded)
โ”œโ”€โ”€ agents/            โ† agent YAML files (auto-downloaded)
โ”‚   โ”œโ”€โ”€ coding.yaml
โ”‚   โ”œโ”€โ”€ devops.yaml
โ”‚   โ””โ”€โ”€ ...
โ””โ”€โ”€ plugins/           โ† installed plugins (auto-downloaded via wizard)
    โ””โ”€โ”€ vector_search_plugin.py

๐Ÿ”ง Troubleshooting

Something not working?

simplecontext-bot status --test

Update engine and agents:

simplecontext-bot update

Start fresh:

rm -rf ~/.simplecontext-bot
simplecontext-bot setup

๐Ÿ”— Ecosystem

Repositori Deskripsi
SimpleContext Core engine โ€” Universal AI Brain
SimpleContext-Plugin Plugin registry โ€” extend with semantic search, summarizer, and more
SimpleContext-Bot This repo โ€” Telegram Bot
SimpleContext-Agents Ready-to-use agent definitions

Built with โค๏ธ on top of SimpleContext

โญ Star the engine repo if you find this useful!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplecontext_bot-1.2.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplecontext_bot-1.2.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file simplecontext_bot-1.2.1.tar.gz.

File metadata

  • Download URL: simplecontext_bot-1.2.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for simplecontext_bot-1.2.1.tar.gz
Algorithm Hash digest
SHA256 ad838e90bb1751380b7028fe2ebcd47359073879e128c16002ced7604291dce8
MD5 f473237ae2aea998be65f65c96018dcc
BLAKE2b-256 02693763720bd5f895020af3b2af2502f82a6ba8ace64f6aea14362360ae769d

See more details on using hashes here.

File details

Details for the file simplecontext_bot-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simplecontext_bot-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52cfad55c2447959c2025045d545cef07ae6a296f16937119aa63cdc61e3dfbc
MD5 2153e20347a27127ce8cfcd337e7ab83
BLAKE2b-256 7f12968a74841d966577333b2c4bb1677b49f6ccc9ab3cb83dceef6c3b57908a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page