A recursive, tool-equipped CLI AI Agent written in Rust.
rust-agent provides a local interactive terminal (REPL) where a user can converse with an advanced LLM (DeepSeek V4 via OpenRouter by default) that has direct, programmatic access to its host machine under safe sandboxed boundaries.
The agent features a hierarchical memory system: a 16k token rolling conversation window (L1), summarized evicted turns into a 4k token knowledge graph wiki in SQLite (L2), and full transcript archiving (L3). It can delegate sub-tasks to nested instances of itself (sub-agents) with similar tool sets, enabling recursive problem-solving.
Key Features
Hierarchical Memory
Three-tier memory system: 16k token rolling window (L1), 4k token knowledge graph wiki in SQLite (L2), and full transcript archiving (L3) for context retention across long sessions.
Recursive Sub-Agent Delegation
Break down hard queries by spawning sub-agents with identical toolkits. Depth is tracked and capped at 5 levels to prevent infinite loops.
Sandboxed Filesystem Access
Read, write, and list files within the current working directory. Path traversal is blocked via component-aware sandboxing.
Code Execution
Run local shell commands with safety filters that block destructive operations like Remove-Item, rm -rf, and Format-Volume.
SQLite Turn Tracing
Every session, turn, and tool call is logged to SQLite with project-level isolation. Supports keyword, recent, and semantic search over conversation history.
Background Embedding Pipeline
Async vector embedding generation (1024-dim via qwen3-8b) for semantic search over past conversations without blocking the REPL.