A modern and extensible AI agent implemented in Rust with a command line interface, RAG (Retrieval-Augmented Generation) capabilities, MCP (Model Context Protocol) integration.
- π€ LLM Integration - Powered by Anthropic's Claude models for intelligent conversations
- π Configurable MCP Servers - Configurable MCP servers are registered and launched at runtime
- π RAG Pipeline - Semantic search using Qdrant vector database and Voyage AI embeddings
- π MOTD Support - Daily message of the day display for emotional support (and fun)
- π¦ Docker Backend - Backend server hosted inside docker container for compatibility and easy setup
- π Session Management - Persistent conversation history with save/load capabilities
- π¨οΈ Extensible Commands - Modular command system with automatic registration
- π οΈ Extensible Custom Tools - Modular custom tool system with automatic registration
- βοΈ Configurable - JSON-based configuration for models, tokens, and behavior
Project modules are documented in their respective README files
| Module | Docs | Brief |
|---|---|---|
common |
src/common/README.md | Common functionality for all modules |
commands |
src/commands/README.md | Extensible command modules |
tools |
src/tools/README.md | Extensible custom tool modules |
connection |
src/connection/README.md | Clients for 3rd party services |
mcp |
src/mcp/README.md | MCP clients and server hosting |
app (Core) |
src/app/README.md | Core functionality and integration |
- Current version is only tested on WSL2 Ubuntu
- Rust 1.70+ (2024 edition)
- Docker Desktop
- Anthropic API Key
- For RAG Capabilities:
- Needs either Voyage or local embedding model deployment via HTTP server
- Voyage AI API Key
- TODO link for local text embedding deployment
- Qdrant vector database
- Locally installed & deployed using Docker (handled automatically)
- Needs either Voyage or local embedding model deployment via HTTP server
git clone https://github.com/JTP75/puetce.git
cd puetce
Puetce includes an automated setup script that creates necessary directories and configuration files:
cargo run --bin setupThis setup script will:
- Create configuration directory at:
- Linux:
$HOME/.config/rustbot/ - macOS:
$HOME/Library/Application Support/com.puetceco.rustbot/ - Windows:
%APPDATA%\puetceco\rustbot\config\
- Linux:
- Create data directory at:
- Linux:
$HOME/.local/share/rustbot/ - macOS:
$HOME/Library/Application Support/com.puetceco.rustbot/ - Windows:
%APPDATA%\puetceco\rustbot\data\
- Linux:
- Create cache directory at:
- Linux:
$HOME/.cache/rustbot - macOS:
$HOME/Library/Caches/com.puetceco.rustbot/ - Windows:
%APPDATA%\puetceco\rustbot\cache\
- Linux:
- Create necessary storage subdirectories
- Copy default configuration and environment files to correct locations:
NOTE: The docker-compose.yml is configured for Linux by default. If running on a different platform, you will need to change the backend volume mappings appropriately.
For macOS:
services:
backend:
# ...
volumes:
- ${HOME}/Library/Application Support/com.puetceco.rustbot:/root/.config/rustbot
- ${HOME}/Library/Application Support/com.puetceco.rustbot:/root/.local/share/rustbot
- ${HOME}/Library/Caches/com.puetceco.rustbot:/root/.cache/rustbot
# ...After running setup, edit the .env file created in your config directory (according to the template). The Anthropic API key is always mandatory and the Voyage key is only needed you want to set up the RAG pipeline without a local embedding model.
ANTHROPIC_API_KEY=INSERT_REQUIRED_ANTHROPIC_KEY_HERE
VOYAGE_API_KEY=OPTIONAL_VOYAGE_KEYBy default, only minimal features are enabled, including:
- Anthropic API Integration
- Custom tools (get/set MOTD, greeting)
- Set
use_voyage_embeddingtotruein embedding_config.json- Alternatively, set up local embedding model (TODO)
- Set
enable_qdranttotruein vectordb_config.json - Copy new config files to config directory (overwrite)
NOTE: You will need to run docker compose with the "rag" profile to launch qdrant. Additionally, if you setup local embedding, you will need to run with "localrag" profile:
docker compose --profile rag up -ddocker compose --profile localrag up -d- Set
enable_mcp_serverstotruein bot_config.json - Add MCP servers to mcp_servers.json
- Copy new config files to config directory (overwrite)
Frontend client
cargo install --path . --bin puetce-clientBackend server
docker-compose buildStart backend server:
docker-compose up -d # no rag pipeline
docker-compose --profile rag up -d # rag pipeline with voyage embedding
docker-compose --profile localrag up -d # rag pipeline with local embedding model (requires separate installation)This handles:
- Starting each configured MCP server
- Hosting the Qdrant vector database service
- Hosting the backend server
Start frontend client instance:
puetce-clientThis handles:
- Initializing the app and session manager
- Starting the CLI
If the rag profile is enabled, you can open the Qdrant Dashboard in your browser on localhost. This allows access to existing collections, tutorials, and visualization tools.
Today is Monday, January 1, 2024.
Here is todays MOTD!
> hello
Hello there! My name is puetce.
> help
Available commands are:
load aliases=()
wexit aliases=(wq)
hello aliases=()
get-collection aliases=(getc)
whereami aliases=()
exit aliases=(q | quit)
store aliases=()
message aliases=(msg)
set-collection aliases=(setc)
save aliases=(w)
message-tools aliases=(msgt)
...
> help load
load
DESC
Load a session file over the current session
HELP
Usage: load <filename>
Filename must be specified
> msgt whats on my agenda for today?
25 hours of coding
>
Conversation sessions can be saved and loaded using the save and load commands. Sessions are managed and persisted to:
~/.local/share/rustbot/sessions/
Command history is saved to:
~/.local/share/rustbot/rustyline_history.txt
The commands and tools modules were designed with extensibility in mind.
- Adding new commands: See Creating a New Command
- Adding new tools: See Creating a New Tool
tokio- Asynchronous runtime with full feature setserde/serde_json- Serialization and JSON supportreqwest- HTTP client for API callsaxum- HTTP server for backendqdrant-client- Vector database operationsyup-oauth2- OAuth2 authentication for Google APIschrono- Date and time handlingdirectories- Platform-specific configuration pathsdotenvy- Environment variable loading from.envfilesrustyline- Interactive CLI with history and line editinglog/env_logger- Logging framework and implementationfiglet-rs- ASCII art text generationrand- Random number generationonce_cell- Lazy static initializationderive_builder- Builder pattern macrosctor- Constructor functions
For versions and features, see Cargo.toml