A high-performance AI Telegram Agent built in Rust with a 7-layer cognitive architecture. Designed for minimal resource consumption (Docker image < 15MB, RAM < 50MB) while supporting complex memory systems and dynamic skills.
| Layer | Responsibility |
|---|---|
| 1. Soul Layer | Identity, personality, speaking style loaded from soul.toml |
| 2. Memory Layer | SQLite-backed: Short-term, Long-term, Episodic, Semantic, Reflection |
| 3. Planner Layer | Orchestrator combining Soul + Memory + User input |
| 4. Skill Layer | Dynamic skill matching via triggers without core recompilation |
| 5. Tool Layer | Pure function executors: HTTP, File System |
| 6. LLM Layer | Multi-provider abstraction: OpenAI, Claude, Qwen, Local/Ollama |
| 7. Telegram Runtime | Async long-polling, per-user session management |
Run the Docker container with interactive setup wizard:
docker run -it --rm \
-v soul-agent-data:/app/data \
-v soul-agent-config:/app/config \
ghcr.io/username/soul-agent:latestThe wizard will guide you through:
- Entering your Telegram Bot Token
- Selecting LLM provider and API key
- Configuring your bot's soul (name, identity, speaking style)
After setup, the bot automatically starts as a daemon.
soul-agent/
├── src/
│ ├── main.rs # Entry point
│ ├── lib.rs # AppState
│ ├── config.rs # Configuration management
│ ├── soul/ # Soul Layer
│ ├── memory/ # Memory Layer (5 types)
│ ├── planner/ # Planner Layer
│ ├── skill/ # Skill Layer
│ ├── tool/ # Tool Layer
│ ├── llm/ # LLM Layer (multi-provider)
│ ├── telegram/ # Telegram Runtime
│ └── wizard/ # Docker CLI Wizard
├── Cargo.toml
├── Dockerfile
└── README.md
# Local build
cargo build --release
# Docker build (optimized for size < 15MB)
docker build -t soul-agent .Drop a .toml file into the skills/ directory:
name = "weather"
description = "Get weather information"
triggers = ["cuaca", "weather"]
tools = ["http_get"]
prompt_template = "Fetch weather for: {{location}}"
required_args = ["location"]No recompilation required!
| Variable | Description |
|---|---|
TELEGRAM_TOKEN |
Bot token from @BotFather |
LLM_PROVIDER |
openai, claude, qwen, or local |
LLM_API_KEY |
API key for the selected provider |
LLM_MODEL |
Model name (e.g., gpt-4o-mini) |
LLM_BASE_URL |
Custom base URL (optional) |
LOG_LEVEL |
debug, info, warn, error |
MIT