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 ยท 15 agents ยท Dynamic plugins ยท Works with Gemini, OpenAI, Ollama

Python Telegram License SimpleContext Plugins PyPI


โœจ What is this?

SimpleContext-Bot is a ready-to-run Telegram bot powered by SimpleContext โ€” a structured AI brain with tiered memory, intent planning, and context scoring.

A built-in setup wizard automatically downloads the engine, 15 agents, and optional plugins โ€” then walks you through configuration step by step.


๐Ÿš€ Installation

Option A โ€” pip (recommended)

pip install simplecontext-bot
simplecontext-bot setup
simplecontext-bot start

Option B โ€” from source

git clone https://github.com/zacxyonly/SimpleContext-Bot.git
cd SimpleContext-Bot
pip install .
simplecontext-bot setup
simplecontext-bot start

๐Ÿง™ Setup Wizard

simplecontext-bot setup

The wizard handles everything in 6 steps:

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  ๐Ÿง  SimpleContext-Bot โ€” Setup Wizard
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Step 1/6  Download SimpleContext engine        โœ…
Step 2/6  Download 15 agent definitions        โœ…
Step 3/6  Plugin Ecosystem (Optional)
           Install Vector Search? [y/N]: y     โœ…
           Install Summarizer?    [y/N]: y     โœ…
Step 4/6  Telegram Bot Token                   โ†’ paste from @BotFather
Step 5/6  LLM Provider & API Key               โ†’ Gemini / OpenAI / Ollama
Step 6/6  Final configuration                  โœ… Done!

๐Ÿ”‘ Getting Your Tokens

Telegram Bot Token

  1. Open Telegram โ†’ search @BotFather
  2. Send /newbot โ†’ follow the steps โ†’ 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, free, no API key)

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

๐ŸŽฏ Auto-Routing

No need to manually switch agents. The bot detects the best agent 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
"bantu investasi saham"      โ†’  ๐Ÿ’ฐ  finance
"cek kontrak ini"            โ†’  โš–๏ธ  legal
"brainstorm ide startup"     โ†’  ๐ŸŽจ  creative
"tips produktivitas"         โ†’  โšก  productivity
"olahraga untuk pemula"      โ†’  ๐Ÿ’ช  health

๐Ÿค– Available Agents (15)

Core

Agent Description
๐Ÿง  general Default fallback โ€” smart routing to specialized agents
๐Ÿ–ฅ๏ธ coding Expert programmer โ€” debug, review, all languages
๐Ÿš€ devops Server, Docker, CI/CD, Linux infrastructure
โœ๏ธ writer Content, copywriting, email, social media

Knowledge & Research

Agent Description
๐Ÿ” researcher Fact-checking, research, source evaluation
๐Ÿ“š tutor Patient adaptive teacher for any subject
๐Ÿ“ summarizer Condense any content into clear summaries
๐ŸŒ translator Multi-language, idiom-aware translation

Business & Professional

Agent Description
๐Ÿ“Š analyst Data analysis, business insights, KPIs
๐ŸŽง customer_service Empathetic CS, complaint handling
๐Ÿ’ฐ finance Budgeting, investing, financial planning
โš–๏ธ legal Contracts, rights, Indonesian law reference

Lifestyle & Creativity

Agent Description
๐ŸŽจ creative Brainstorming, storytelling, naming, worldbuilding
โšก productivity Time management, habits, GTD, focus systems
๐Ÿ’ช health Fitness, nutrition, sleep, mental wellness

๐Ÿ’ฌ Bot Commands

Built-in Commands

Command Description
/start Welcome message, saves your name
/help Show all commands including plugin commands
/agents List all available agents
/agent <n> Switch to a specific agent
/agent auto Back to auto-routing
/clear Clear conversation history (keeps profile)
/status Show current agent, message count, active plugins
/memory Show your saved profile
/plugins List active plugins and their commands

Plugin Commands (auto-registered)

Plugin commands register automatically when a plugin is loaded:

Command Plugin Required Description
/semantic <query> vector-search Search memory by meaning
/summary summarizer Summarize conversation
/search <query> web-search Search the internet
/translate <lang> translate Set language or translate
/sentiment sentiment View sentiment analysis
/analytics analytics View usage statistics
/usage rate-limiter Check your usage quota

๐Ÿ”Œ Plugin Ecosystem

Extend the bot with plugins from SimpleContext-Plugin.

Available Official Plugins

Plugin Description
vector-search Semantic memory search โ€” find by meaning, not exact words
analytics Usage statistics per user and agent
summarizer Auto-compress conversation to episodic memory via LLM
web-search Real-time internet search (DuckDuckGo free, Bing, Google)
translate Multi-language โ€” auto-detect 20+ languages
sentiment Sentiment analysis โ€” adapts agent tone when user is frustrated
rate-limiter Limit requests per hour/day, token estimation

Install Plugins

simplecontext-bot plugins list                    # fetch list from GitHub registry
simplecontext-bot plugins install vector-search   # install a plugin
simplecontext-bot plugins install summarizer
simplecontext-bot plugins remove vector-search    # remove a plugin

Manual (community plugins):

cp my_plugin.py ~/.simplecontext-bot/plugins/
simplecontext-bot start   # auto-detected on startup

How Plugin Commands Work

Plugins declare their own Telegram commands via app_commands (SimpleContext v4.3 standard). The bot registers them automatically โ€” no code changes needed:

class MyPlugin(BasePlugin):
    app_commands = {
        "mycommand": {
            "description": "What this does",
            "usage":       "/mycommand <arg>",
            "handler":     "handle_mycommand",
        }
    }

    async def handle_mycommand(self, ctx: AppCommandContext) -> str:
        return f"Hello from {ctx.platform}! Query: {ctx.args_str}"

Drop the file โ†’ restart โ†’ /mycommand is live in Telegram.


โš™๏ธ CLI Commands

# Setup & Start
simplecontext-bot setup                   # First-time setup wizard
simplecontext-bot start                   # Start the bot
simplecontext-bot start --debug           # Start with verbose logging

# Status & Info
simplecontext-bot status                  # Show configuration summary
simplecontext-bot status --test           # Check + test LLM connection
simplecontext-bot dashboard               # Show usage stats and system info
simplecontext-bot agents                  # List installed agents

# Update
simplecontext-bot update                  # Update engine + agents + plugins
simplecontext-bot update --engine-only    # Update engine only
simplecontext-bot update --agents-only    # Update agents only
simplecontext-bot update --plugins-only   # Update installed plugins only

# Plugins
simplecontext-bot plugins list            # List plugins (fetches from GitHub)
simplecontext-bot plugins install <id>    # Install a plugin
simplecontext-bot plugins remove <id>     # Remove a plugin

# Config (change any value without re-running setup)
simplecontext-bot set llm.api_key <key>   # Update API key
simplecontext-bot set llm.model <model>   # Change LLM model
simplecontext-bot set llm.provider <p>    # Switch provider (gemini/openai/ollama)
simplecontext-bot set telegram.token <t>  # Update Telegram token
simplecontext-bot set bot.debug true      # Enable debug logging
simplecontext-bot set bot.memory_limit 30 # Increase memory limit

๐Ÿ“Š Dashboard

simplecontext-bot dashboard
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘         SimpleContext-Bot Dashboard              โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  ๐Ÿ”ง System
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Engine     : โœ… Installed
  DB size    : 2.4 MB
  Telegram   : โœ… Configured

  ๐Ÿค– Agents & Plugins
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Agents     : 15 installed
  Plugins    : 2 installed  (vector_search_plugin, summarizer_plugin)

  ๐Ÿง  LLM
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Provider   : gemini
  Model      : gemini/gemini-2.0-flash

  ๐Ÿ“Š Usage Stats
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Users      : 42
  Nodes      : 1,847

๐Ÿ“ Files After Setup

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

๐Ÿ”ง Troubleshooting

Diagnose issues:

simplecontext-bot status --test

Update everything:

simplecontext-bot update

Change a config value without re-running setup:

simplecontext-bot set llm.api_key <new-key>
simplecontext-bot set llm.model gemini/gemini-2.5-flash
simplecontext-bot set telegram.token <new-token>

Start fresh:

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

๐Ÿง  Powered By

Repo Role
SimpleContext AI brain โ€” tiered memory, context scoring, intent planning
SimpleContext-Agents 15 ready-to-use agent definitions
SimpleContext-Plugin Official plugin registry
LiteLLM Universal LLM connector

๐Ÿ”— Ecosystem

Repo Description
SimpleContext Core engine โ€” Universal AI Brain
SimpleContext-Agents Ready-to-use agent definitions
SimpleContext-Plugin Plugin registry
SimpleContext-Bot This repo
SimpleContext-Docs Full documentation

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.3.0.post1.tar.gz (30.5 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.3.0.post1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file simplecontext_bot-1.3.0.post1.tar.gz.

File metadata

  • Download URL: simplecontext_bot-1.3.0.post1.tar.gz
  • Upload date:
  • Size: 30.5 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.3.0.post1.tar.gz
Algorithm Hash digest
SHA256 8dd1d7506ecab4d42450a5af80dbefaad9888715bd4210872eae3884a21f531c
MD5 144c9cc573f28d9b4433534bec81b8d6
BLAKE2b-256 4f2be21744a06b4e3f03ab716f97084e055e822316e0a95f20737fc772d39c46

See more details on using hashes here.

File details

Details for the file simplecontext_bot-1.3.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for simplecontext_bot-1.3.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 802aa5e85a7967d67ad64ef9e733a9cf1e04dae234cf739d1d3136e50929eb1f
MD5 4aee6dcacf61168b52ba3696e95dba6a
BLAKE2b-256 5270a5335e0e53e3ffce5bd2b7e1b23a103cb2c7303b57e343b10e8e39ffbd4f

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