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.2.tar.gz (23.1 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.2-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplecontext_bot-1.2.2.tar.gz
  • Upload date:
  • Size: 23.1 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.2.tar.gz
Algorithm Hash digest
SHA256 3f877f62c4d2b24084bcb74746fd4061de0bddaf0a7f5569142fda4fe72cb006
MD5 5636651cfdaa6345b0bd833018d54642
BLAKE2b-256 100b871e757450f0274886cc1ebfa3f59645170dbc0cbc6008de3f2869302582

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simplecontext_bot-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 687220ad6456f00499aba0397923efd865d3e06a6df54ed6531593a8ea489c14
MD5 b00ae4aeceddff38b723e81d32ade92f
BLAKE2b-256 6d75cf05af2beb395b31be115799ed1121061a78b12bd820b8b28485b646c909

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