Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentRust

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.

Architecture (7 Layers)

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

Quick Start

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:latest

The wizard will guide you through:

  1. Entering your Telegram Bot Token
  2. Selecting LLM provider and API key
  3. Configuring your bot's soul (name, identity, speaking style)

After setup, the bot automatically starts as a daemon.

Project Structure

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

Building

# Local build
cargo build --release

# Docker build (optimized for size < 15MB)
docker build -t soul-agent .

Adding Custom Skills

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!

Environment Variables

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

License

MIT

About

(Under development)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages