General AI Agent System
Project description
Ouro is derived from Ouroboros—the ancient symbol of a serpent consuming its own tail to form a perfect circle. It represents the ultimate cycle: a closed loop of self-consumption, constant renewal, and infinite iteration.
At Ouro AI Lab, this is our blueprint. We are building the next generation of AI agents capable of autonomous evolution—systems that learn from their own outputs, refine their own logic, and achieve a state of infinite self-improvement.
Installation
Prerequisites: Python 3.12+.
pip install ouro-ai
Or install from source (for development):
git clone https://github.com/ouro-ai-labs/ouro.git
cd ouro
./scripts/bootstrap.sh # requires uv
Quick Start
1. Configure Models
On first run, ~/.ouro/models.yaml is created with a template. Edit it to add your provider and API key:
models:
openai/gpt-4o:
api_key: sk-...
anthropic/claude-sonnet-4:
api_key: sk-ant-...
ollama/llama2:
api_base: http://localhost:11434
default: openai/gpt-4o
See LiteLLM Providers for the full list.
2. Run
# Interactive mode
ouro
# Single task (returns raw result)
ouro --task "Calculate 123 * 456"
# Resume last session
ouro --resume
# Resume specific session (ID prefix)
ouro --resume a1b2c3d4
CLI Reference
| Flag | Short | Description |
|---|---|---|
--task TEXT |
-t |
Run a single task and exit |
--model ID |
-m |
LiteLLM model ID to use |
--resume [ID] |
-r |
Resume a session (latest if no ID given) |
--verbose |
-v |
Enable verbose logging to ~/.ouro/logs/ |
Interactive Commands
Slash Commands
| Command | Description |
|---|---|
/help |
Show help |
/clear |
Clear conversation and start fresh |
/stats |
Show memory and token usage statistics |
/resume [id] |
List or resume a previous session |
/model |
Pick a model (arrow keys + Enter) |
/model edit |
Open ~/.ouro/models.yaml in editor (auto-reload on save) |
/theme |
Toggle dark/light theme |
/verbose |
Toggle thinking display |
/compact |
Trigger memory compression and show token savings |
/exit |
Exit (also /quit) |
Keyboard Shortcuts
| Key | Action |
|---|---|
/ |
Command autocomplete |
Ctrl+C |
Graceful interrupt (cancels current operation, rolls back incomplete memory) |
Ctrl+L |
Clear screen |
Ctrl+T |
Toggle thinking display |
Ctrl+S |
Show quick stats |
| Up/Down | Navigate command history |
Features
- Unified agent loop: Think-Act-Observe cycle — planning, sub-agents, and tool use all happen in one loop, chosen autonomously by the agent
- Self-verification: An outer loop verifies the agent's answer against the original task and re-enters if incomplete
- Memory compression: LLM-driven summarization when context exceeds a token threshold, with multiple strategies (
sliding_window,selective,deletion) - Git-aware memory: Git-based memory system that persists and manages agent memory through version control
- Session persistence: Conversations saved as human-readable YAML files under
~/.ouro/sessions/, resumable via--resumeor/resume - Parallel exploration: Concurrent tool calls for exploring codebases and gathering information in parallel
- Parallel sub-agents: Spawn multiple sub-agents to work on independent subtasks simultaneously
Tools
| Tool | Description |
|---|---|
read_file |
Read file contents |
write_file |
Write content to a file |
search_files |
Search for files by name |
edit_file |
Exact string replacement in files |
smart_edit |
LLM-assisted file editing |
glob_files |
Glob pattern file matching |
grep_content |
Regex search in file contents |
calculate |
Evaluate expressions / run Python code |
shell |
Execute shell commands |
shell_task_status |
Check background shell task status |
web_search |
Web search (DuckDuckGo) |
web_fetch |
Fetch and extract web page content |
explore_context |
Explore project structure and context |
parallel_execute |
Run multiple tool calls in parallel |
notify |
Send email notifications (Resend) |
manage_todo_list |
Manage a task/todo list |
Project Structure
ouro/
├── main.py # Entry point (argparse)
├── cli.py # CLI wrapper (`ouro` entry point)
├── interactive.py # Interactive session, model setup, TUI
├── config.py # Runtime config (~/.ouro/config)
├── agent/
│ ├── base.py # BaseAgent (ReAct + Ralph loops)
│ ├── agent.py # LoopAgent
│ ├── verification.py # LLMVerifier for Ralph loop
│ ├── context.py # Context injection (cwd, platform, date)
│ ├── tool_executor.py # Tool execution engine
│ └── todo.py # Todo list data structure
├── llm/
│ ├── litellm_adapter.py # LiteLLM adapter (100+ providers)
│ ├── model_manager.py # Model config from ~/.ouro/models.yaml
│ ├── retry.py # Retry with exponential backoff
│ └── message_types.py # LLMMessage, LLMResponse, ToolCall
├── memory/
│ ├── manager.py # Memory orchestrator + persistence
│ ├── compressor.py # LLM-driven compression
│ ├── short_term.py # Short-term memory (sliding window)
│ ├── token_tracker.py # Token counting + cost tracking
│ ├── types.py # Core data structures
│ └── store/
│ └── yaml_file_memory_store.py # YAML session persistence
├── tools/ # 18 tool implementations
├── utils/
│ ├── tui/ # TUI components (input, themes, status bar)
│ ├── logger.py # Logging setup
│ └── model_pricing.py # Model pricing data
├── docs/ # Documentation
├── test/ # Tests
├── scripts/ # Dev scripts (bootstrap.sh, dev.sh)
└── rfc/ # RFC design documents
Configuration
Runtime settings live in ~/.ouro/config (auto-created). Key settings:
| Setting | Default | Description |
|---|---|---|
MAX_ITERATIONS |
1000 |
Maximum agent loop iterations |
TOOL_TIMEOUT |
600 |
Tool execution timeout (seconds) |
RALPH_LOOP_MAX_ITERATIONS |
3 |
Max verification attempts |
MEMORY_ENABLED |
true |
Enable memory management |
MEMORY_COMPRESSION_THRESHOLD |
60000 |
Token threshold for compression |
MEMORY_SHORT_TERM_SIZE |
100 |
Messages kept at full fidelity |
RETRY_MAX_ATTEMPTS |
3 |
Rate-limit retry attempts |
See Configuration Guide for all settings.
Documentation
- Configuration -- model setup, runtime settings, custom endpoints
- Examples -- usage patterns and programmatic API
- Memory Management -- compression, persistence, token tracking
- Extending -- adding tools, agents, LLM providers
- Packaging -- building, publishing, Docker
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
For development setup, see the Installation section (install from source).
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ouro_ai-0.2.2.tar.gz.
File metadata
- Download URL: ouro_ai-0.2.2.tar.gz
- Upload date:
- Size: 148.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7509734f883abbd9dc913ff2417c78a9fc9b8f10ad511b65e13139491f2267a
|
|
| MD5 |
cc2039e7987f4e4bfcb312200f220aec
|
|
| BLAKE2b-256 |
670f0e2c2d5619d0e35e9451d10224fe57ee8cfed52e6cffac7f086fe22ba9e3
|
Provenance
The following attestation bundles were made for ouro_ai-0.2.2.tar.gz:
Publisher:
release.yml on ouro-ai-labs/ouro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ouro_ai-0.2.2.tar.gz -
Subject digest:
c7509734f883abbd9dc913ff2417c78a9fc9b8f10ad511b65e13139491f2267a - Sigstore transparency entry: 928371367
- Sigstore integration time:
-
Permalink:
ouro-ai-labs/ouro@60846ba74e937da71e000c6d4e07a7e28220f44c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ouro-ai-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@60846ba74e937da71e000c6d4e07a7e28220f44c -
Trigger Event:
push
-
Statement type:
File details
Details for the file ouro_ai-0.2.2-py3-none-any.whl.
File metadata
- Download URL: ouro_ai-0.2.2-py3-none-any.whl
- Upload date:
- Size: 141.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48796c16478e9798c258efe8a1789242ffce55012ad39c08875686d925ac02da
|
|
| MD5 |
4bee6263174e23d9366a8977a6170105
|
|
| BLAKE2b-256 |
5808d38704d1c604e1b4a93586afc87a4947cb57287958020462943e4a028bbe
|
Provenance
The following attestation bundles were made for ouro_ai-0.2.2-py3-none-any.whl:
Publisher:
release.yml on ouro-ai-labs/ouro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ouro_ai-0.2.2-py3-none-any.whl -
Subject digest:
48796c16478e9798c258efe8a1789242ffce55012ad39c08875686d925ac02da - Sigstore transparency entry: 928371370
- Sigstore integration time:
-
Permalink:
ouro-ai-labs/ouro@60846ba74e937da71e000c6d4e07a7e28220f44c -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ouro-ai-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@60846ba74e937da71e000c6d4e07a7e28220f44c -
Trigger Event:
push
-
Statement type: