{"id":50965627,"url":"https://github.com/snakeying/kernel","last_synced_at":"2026-06-18T20:01:41.263Z","repository":{"id":337913779,"uuid":"1155793262","full_name":"snakeying/kernel","owner":"snakeying","description":"More than a chatbot — it remembers everything and gets things done. 不只是聊天机器人 —— 它记住一切，执行任何任务。","archived":false,"fork":false,"pushed_at":"2026-02-11T23:06:14.000Z","size":253,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-12T08:53:13.584Z","etag":null,"topics":["claude-code","codex-cli","telegrambot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snakeying.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-11T22:58:33.000Z","updated_at":"2026-02-11T23:06:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/snakeying/kernel","commit_stats":null,"previous_names":["snakeying/kernel"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/snakeying/kernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeying%2Fkernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeying%2Fkernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeying%2Fkernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeying%2Fkernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snakeying","download_url":"https://codeload.github.com/snakeying/kernel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeying%2Fkernel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34505423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","codex-cli","telegrambot"],"created_at":"2026-06-18T20:01:39.440Z","updated_at":"2026-06-18T20:01:41.257Z","avatar_url":"https://github.com/snakeying.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\nKernel\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003ePersonal AI Assistant on Telegram\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eMulti-provider LLM · Long-term Memory · Voice I/O · CLI Delegation\u003c/strong\u003e\u003cbr/\u003e\n  \u003cem\u003eMore than a chatbot — it remembers everything and gets things done.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README_CN.md\"\u003e简体中文\u003c/a\u003e | English\n\u003c/p\u003e\n\n---\n\n## 🤔 What is this?\n\nKernel is a **personal Telegram bot** that puts a powerful AI assistant in your pocket:\n\n```\nYou (Telegram) ←→ Kernel ←→ LLM (Claude / OpenAI / DeepSeek / ...)\n                    ↕              ↕\n              Long-term Memory   Tools (CLI agents, MCP servers, ...)\n```\n\nSend a message, get an AI response. Send a voice note, get a voice reply. Ask it to edit code, it delegates to Claude Code or Codex. It remembers what you tell it — across sessions, forever.\n\n---\n\n## ✨ Core Features\n\n| Feature | Description |\n|---------|-------------|\n| 💬 Multi-provider | Switch between Claude, OpenAI, DeepSeek and any OpenAI-compatible API at runtime |\n| 🧠 Long-term memory | AI autonomously stores and recalls important info (preferences, facts, plans) |\n| 🔧 CLI delegation | Delegates coding/file tasks to Claude Code or Codex CLI |\n| 🌐 MCP tools | Connects to external MCP servers (web search, docs, etc.) |\n| 🎙️ Voice I/O | Speech-to-text (Whisper) + text-to-speech (Edge TTS) — send voice, get voice back |\n| 📎 File support | Send text/code files directly in chat for analysis |\n| 🖼️ Image understanding | Send photos with captions for vision-capable models |\n| 📝 Session management | Multiple conversations with auto-generated titles, resume anytime |\n| 🎭 Customizable personality | Define your bot's character via `SOUL.md` |\n| 🔒 Single-user | Locked to your Telegram ID — no one else can use it |\n\n---\n\n## 🚀 Quick Start\n\n### 📋 Prerequisites\n\n| Tool | Required |\n|------|----------|\n| Python | ≥ 3.11 |\n| uv | Yes (package manager) |\n| Telegram Bot Token | Yes (from [@BotFather](https://t.me/BotFather)) |\n| LLM API Key | Yes (at least one provider) |\n| Claude Code CLI | Optional (for CLI delegation) |\n\n### ⚙️ Setup\n\n```bash\n# 1. Clone the repo\ngit clone \u003crepo-url\u003e \u0026\u0026 cd kernel\n\n# 2. Create venv and install dependencies\nuv venv .venv --python 3.11\nuv sync\n\n# 3. Copy config template and fill in your tokens\ncp config.example.toml config.toml\n# Edit config.toml with your Telegram token, user ID, and API keys\n\n# 4. Run\nuv run python -m kernel\n```\n\n### 🔑 Minimal config.toml\n\n```toml\n[telegram]\ntoken = \"YOUR_BOT_TOKEN\"          # From @BotFather\nallowed_user = 123456789          # Your Telegram user ID\n\n[general]\ndefault_provider = \"anthropic\"\n\n[providers.anthropic]\ntype = \"claude\"\napi_key = \"sk-ant-...\"\nmax_tokens = 16384\ndefault_model = \"claude-sonnet-4-5-20250929\"\nmodels = [\"claude-sonnet-4-5-20250929\"]\n```\n\nSee `config.example.toml` for all options including OpenAI-compatible providers, STT/TTS, CLI agents, and MCP servers.\n\n---\n\n## 💬 Bot Commands\n\n| Command | What it does |\n|---------|-------------|\n| `/new` | Start a new conversation |\n| `/history` | List recent conversations |\n| `/resume #n` | Continue a previous conversation |\n| `/retitle [#n]` | Regenerate conversation title |\n| `/del_history #n` | Delete a conversation |\n| `/provider [name]` | View or switch LLM provider |\n| `/model [name]` | View or switch model |\n| `/remember \u003ctext\u003e` | Save something to long-term memory |\n| `/memory` | View all memories |\n| `/forget #n` | Delete a memory |\n| `/cancel` | Cancel the current task |\n| `/status` | View bot status |\n\n---\n\n## 🧠 How Memory Works\n\nKernel has two layers of memory:\n\n- **Session history** — recent messages kept in context (configurable rounds)\n- **Long-term memory** — persistent SQLite store with full-text search (Chinese + English)\n\nThe AI decides on its own when to search or store memories. You can also manage them manually via `/remember`, `/memory`, and `/forget`.\n\n---\n\n## 🔧 CLI Delegation\n\nWhen you ask Kernel to do something that requires file operations, code editing, or shell commands, it delegates to a CLI agent:\n\n- **Claude Code** — for general coding tasks\n- **Codex** — alternative CLI agent\n\nThe AI calls the `delegate_to_cli` tool automatically. Results are streamed back to you in Telegram.\n\n---\n\n## 🌐 MCP Integration\n\nKernel can connect to [MCP](https://modelcontextprotocol.io/) servers to extend its capabilities:\n\n```toml\n[[mcp.servers]]\nname = \"exa\"\ntype = \"http\"\nurl = \"https://mcp.exa.ai/mcp\"\n```\n\nTools from MCP servers are registered alongside built-in tools — the AI can use them seamlessly.\n\n---\n\n## 🎙️ Voice\n\nSend a voice message → Kernel transcribes it (Whisper API) → AI responds → reply is synthesized as voice (Edge TTS, free).\n\nRequires `[stt]` and `[tts]` sections in config. Text fallback is always available.\n\n---\n\n## 🎭 Personality\n\nDrop a `SOUL.md` file next to your `config.toml` to customize the bot's character, tone, and rules. Kernel loads it automatically as the system prompt foundation.\n\n---\n\n## ❓ FAQ\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: How do I get my Telegram user ID?\u003c/summary\u003e\n\nMessage [@userinfobot](https://t.me/userinfobot) on Telegram. It will reply with your user ID.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: Can I use multiple LLM providers?\u003c/summary\u003e\n\nYes. Define multiple providers in config.toml and switch between them at runtime with `/provider`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: What file types can I send?\u003c/summary\u003e\n\nText and code files (UTF-8): `.py`, `.js`, `.ts`, `.json`, `.yaml`, `.md`, `.sql`, `.html`, `.css`, and many more. Binary files (PDF, images, archives) are not supported as file attachments — but you can send images as photos.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: Where is data stored?\u003c/summary\u003e\n\nAll runtime data (SQLite database, logs, temp files) is stored in the `data/` directory relative to your config file. Configurable via `general.data_dir`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: Can I deploy this on a server?\u003c/summary\u003e\n\nYes. Run it on any Linux server with Python 3.11+. Use a dedicated system user (not root) for security. The bot uses long-polling, so no inbound ports are needed.\n\n\u003c/details\u003e\n\n---\n\n## 📚 More Information\n\n- [ARCHITECTURE.md](ARCHITECTURE.md) — Technical details, module structure, internal mechanisms\n- `config.example.toml` — Full configuration reference with comments\n\n---\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnakeying%2Fkernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnakeying%2Fkernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnakeying%2Fkernel/lists"}