Skip to main content

MiniBot — Self-hosted, auditable, extensible

PyPI version

Your personal AI assistant for Telegram - self-hosted, auditable, extensible, and intentionally opinionated.

📖 Full documentation

Top features

  • 🤖 Personal assistant, not SaaS: your chats, memory, and scheduled prompts stay in your instance.
  • 🎯 Opinionated by design: Telegram-centric flow, small tool surface, and explicit config over hidden magic.
  • 🏠 Self-hostable: Dockerfile + docker-compose provided for easy local deployment.
  • 🧩 Python extensions: add your own tools, event subscribers, and background services from any importable module — plus channels.
  • 💻 Local console channel for development/testing without Telegram.
  • 💬 Telegram channel with chat/user allowlists, long-polling or webhook modes, and multimodal inputs.
  • 🧠 Provider support via llm-async: openai, openai_responses, openrouter, and more.
  • 🧰 Configurable tools: chat memory, KV notes, HTTP fetch, calculator, datetime, Python execution, Bash, patch-based editing (apply_patch), file storage, grep, speech-to-text, and MCP server bridges.
  • 🔎 RAG (optional): index local documents into SQLite (or Qdrant) and retrieve semantically relevant chunks.
  • 🕸️ Relation graph (optional): store and traverse typed relationships between entities.
  • ⏳ Async task workers: offload long-running jobs to a background queue (SQLite by default, optional RabbitMQ).
  • ⏰ Scheduled prompts (one-shot, fixed-interval, and cron recurrence) persisted in SQLite.
  • 🤝 Multi-agent orchestration with specialist agent definitions and skill packs.
  • ⚙️ minibot configure: interactive terminal wizard to create or update config.toml.
  • 📊 Structured logfmt logs and a focused async test suite.

Make it yours

MiniBot is built to be extended, and most changes need no Python:

Level What you get Where
Config toggle tools, providers, models, limits config.toml
No code rewrite the system prompt, add skills and prompt packs, add specialist agents prompts/, skills/, agents/*.md
External tools connect any MCP server [[tools.mcp.servers]]
Python your own tools, event subscribers, services, channels a module + [extensions].modules

Start at the least powerful layer that does the job. The most common asks — a new capability — usually stop at an MCP server or a ~10-line extension:

Security and trust model

MiniBot can execute powerful tools such as shell commands and Python code. It is not intended to be a security boundary by itself. For untrusted workloads, or deployments with sensitive host data, run MiniBot inside an appropriately isolated environment.

Its job is safe defaults, explicit escape hatches and a documented trust model — not a guarantee the software cannot make:

  • MiniBot's own responsibility is safe-by-default config (bash.pass_parent_env = false, the dangerous tools off), keeping secrets out of the LLM's reach ([vault]), and gating consequential actions ([tools.approval]). These matter regardless of deployment, because the remote provider sees whatever reaches a tool call, however isolated the host is.
  • The deployment's responsibility is OS, filesystem and process isolation for bash and python_exec. An owner who already isolates the host can reasonably accept the ambient risk.

Filesystem- and shell-level controls inside MiniBot are advisory. A bash tool without a jail, or file_storage with allow_outside_root = true, can read and write anything the daemon's OS user can, including files this documentation says a feature keeps out of reach. Enable those tools only where the blast radius is acceptable. See Security & Sandboxing.

Every capability is a config switch you own. Multi-agent orchestration, runtime agent reload and model-authored agents are all opt-in or trivially off; when you turn one on, what it may do is your decision and your responsibility.

# my_tool.py — add "my_tool" to [extensions].modules
from pydantic import BaseModel, Field
from minibot.app.extensions import ExtensionContext
from minibot.llm.tools.base import ToolContext

class WordCountArgs(BaseModel):
    text: str = Field(description="Text to count words in.")

def register(mb: ExtensionContext) -> None:
    @mb.tool
    async def word_count(args: WordCountArgs, context: ToolContext) -> dict[str, int]:
        """Count the words in a piece of text."""
        return {"words": len(args.text.split())}

See the Extending MiniBot guide for the full customization ladder. The pluggable surfaces — tools, event subscriptions, services, channels — are covered in extensions and events; external tools arrive via MCP.

Quick start

pip install minibot
# add extras as needed, e.g.: pip install "minibot[telegram,stt,rag,rabbitmq]"

minibot configure   # interactive wizard, writes config.toml
minibot              # start the daemon

Extras: telegram (aiogram + Telegram markdown rendering — the daemon needs it only when [channels.telegram] is enabled), rag (pypdf, PDF ingestion for the RAG tool), stt (speech-to-text via faster-whisper), rabbitmq (RabbitMQ task queue backend — not needed with the default sqlite backend), graph (networkx, the optional relation-graph tool). Compact HTML rendering in http_request uses selectolax, which ships with the base install.

MCP needs no extra: the MCP client is a JSON-RPC implementation with no third-party SDK dependency.

No Telegram bot yet? Run minibot console instead of minibot to chat with it in your terminal.

Docker

pipx run minibot configure   # writes config.toml — must run on the host, docker-compose.yml mounts it read-only
# no pipx? `pip install minibot` into a throwaway venv and run `minibot configure` there instead.

docker compose up -d

docker-compose.yml builds and starts the minibot image. The Qdrant and RabbitMQ services are commented out — [tools.rag].backend and [tasks].backend both default to "sqlite" — and are only needed if you switch either to "qdrant" or "rabbitmq".

Configure it with your AI agent

Configure MiniBot with your AI agent (Claude Code, Codex, OpenCode, pi, ...): paste this prompt.

Configure MiniBot for me:
1. Read the machine-readable docs at
   https://sonic182.github.io/minibot/llms.txt and follow the Getting Started,
   Configuration, Credential vault and Security links it lists.
2. Ask me as little as possible — one short batch of questions, then decide the rest
   yourself with secure defaults:
   - the Telegram allowlist chat/user ids (the bot token goes in the vault);
   - which LLM provider to use. Recommend the ChatGPT Codex subscription
     (`chatgpt_codex`) or OpenCode Go, both with model `gpt-6-luna` and
     `reasoning_effort = "high"`;
   - whether to run in Docker. It is optional: only worth it for isolation if I enable
     the dangerous tools below.
3. Copy `config.example.toml` to `config.toml` and edit it yourself — do not run
   `minibot configure`, that wizard is interactive and meant for humans. The templates
   ship with the repo and with the installed package.
4. Default to a secure install: leave the dangerous tools off — `python_exec`, `bash`,
   `apply_patch`, and `file_storage` with `allow_outside_root = false`. Enable one only
   if I explicitly ask, and say which tools are dangerous when you do.
5. Use the credential vault: enable `[vault]`, keep every credential out of config.toml,
   and write a `${secret:NAME}` placeholder for each (or `auth_secret` for an HTTP MCP
   server). Ask me for the secret *names*, never a secret value, and never write one
   down. Install the `vault` extra (and `codex` for the Codex provider).
6. Walk me through the vault: `minibot vault init`, then `minibot vault edit` to add the
   values, and `minibot vault list` to confirm. For Codex, also run `minibot codex login`.
7. Start MiniBot and confirm the logs are clean.

Stop after that and tell me what you configured and what still needs my input.

For the full reference, run
`curl --silent https://sonic182.github.io/minibot/llms-full.txt`

Both machine-readable files are published alongside the site: llms.txt is the concise, curated index, and llms-full.txt is a single-file dump of the complete documentation.

Demo

Screenshots of Minibot understanding images, summarizing web pages, generating charts, and transcribing voice messages — see the demo gallery.

Metadata

Release files for minibot 0.28.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minibot 0.28.0
File Size Uploaded
minibot-0.28.0.tar.gz 554.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minibot 0.28.0
File Interpreter ABI Platform
minibot-0.28.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / minibot-0.28.0.tar.gz

Download URL minibot-0.28.0.tar.gz
Size 554.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e4ed579a7086f96b66876798201970fb6880adacbba7c060ff4ed4226c235d5b
BLAKE2b-256 checksum
How to use checksums
02eb7f7740b6842f668a595bef167a609af856e07619a5188aa45ddd16d494a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / minibot-0.28.0-py3-none-any.whl

Download URL minibot-0.28.0-py3-none-any.whl
Size 692.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3063b3f778371f0719c89c3ee7f98fd796cabb03dc0ce62d015778cc49c0502
BLAKE2b-256 checksum
How to use checksums
3442cc44f6a26f3362cb5b0c3fed54340906302bafb795b117ff97330e1fac28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

0.32.0

2 release files

This release

0.28.0 This release

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.3

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page