How quasarbrains/simple-agent works
Simple Agent is a conversational LLM agent whose principal loop gathers environmental context, recalls memory and goals, asks a model to reason, then executes returned tool calls or presents a reply. Its runtime also supports selectable model providers, persistent vector-store memory, role-specific tool sets, and task tracking. The graph follows relationships shown in excerpts or explicitly documented in the README; some unsampled implementations are represented by their existing directories, and uncertain wiring is omitted.
Main entry points: agent.py Agent loop · simple-agent.py CLI interaction · index.py Tool registry and runner · llms Provider adapters
Components 17
Agent runtime
- CLI interaction
simple-agent.py - Agent loop
agent/agent.py
Reasoning and memory
- Environment perception
agent/environment.py - Task agency
agent/agency.py - Memory engine
agent/memory.py - Vector store interface
memory/vector_store.py - Simple vector store
memory/simple_vector_store.py
Model providers
- LLM interface
llms/llm.py - Provider adapters
llms
Tools and roles
- Tool registry and runner
tools/index.py - Core tools
tools/libraries/core - Role definitions
roles/core - Role switching
roles/identity.py
Events and output
- Event bus
utils/pubsub.py
Other components
- User
- Model APIs
- Web and search services
Connections 22
- User → CLI interaction: sends input
simple-agent.py - CLI interaction → Agent loop: starts
simple-agent.py - CLI interaction → Provider adapters: selects provider
simple-agent.py - CLI interaction → Simple vector store: selects store
simple-agent.py - Agent loop → Environment perception: reads perception
agent/agent.py - Agent loop → Memory engine: queries memory
agent/agent.py - Agent loop → Task agency: reads tasks
agent/agent.py - Agent loop → LLM interface: requests response
agent/agent.py - Agent loop → Tool registry and runner: runs tool calls
agent/agent.py - Agent loop → Role switching: initializes roles
agent/agent.py - Memory engine → Vector store interface: uses store
agent/memory.py - Simple vector store → Vector store interface: implements
memory/simple_vector_store.py - LLM interface → Tool registry and runner: uses tool schemas
llms/llm.py - Provider adapters → LLM interface: implements interface
llms/anthropic.py - Provider adapters → Model APIs: calls APIs
- Tool registry and runner → Core tools: dispatches calls
tools/index.py - Role definitions → Core tools: selects tool sets
roles/core/researcher.py - Role switching → Role definitions: switches roles
roles/identity.py - Core tools → Web and search services: searches and fetches
- CLI interaction → Event bus: subscribes events
simple-agent.py - Agent loop → Event bus: publishes events
agent/agent.py - Tool registry and runner → Event bus: logs activity
tools/index.py