Skip to main content

General AI Agent System

Project description

OURO

One loop is all you need.

ouro is an AI agent built on a single, unified loop. Planning, parallel sub-agents, self-verification — everything folds into the same loop, chosen autonomously by the agent itself, not by a hardcoded workflow. Simple architecture, emergent capability.

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-3-5-sonnet-20241022:
    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 Toggle compact output
/exit Exit (also /quit)

Keyboard Shortcuts

Key Action
/ Command autocomplete
Ctrl+C Cancel current operation
Ctrl+L Clear screen
Ctrl+T Toggle thinking display
Ctrl+S Show quick stats
Up/Down Navigate command history

How It Works

Agent loop: The agent follows a Think-Act-Observe cycle. It reasons about the task, selects a tool, observes the result, and repeats until it has an answer. Planning, sub-agent dispatch, and tool use all happen inside this single loop.

Ralph verification: For single tasks (--task), an outer loop verifies the agent's answer against the original task. If incomplete, feedback is injected and the agent loop re-enters. Configurable via RALPH_LOOP_MAX_ITERATIONS (default: 3).

Memory compression: When context grows past a token threshold, older messages are compressed via LLM summarization. Recent messages are kept at full fidelity. Strategies: sliding_window (default), selective, deletion.

Session persistence: Conversations are saved as YAML files under ~/.ouro/sessions/. Resume with --resume or /resume.

Features

  • AGENTS.md support: Project-specific instructions guide the agent automatically (see AGENTS.md Guide)
  • Memory management: Automatic compression and persistence of conversation history
  • Ralph verification: Self-verification loop for single tasks
  • Tool-rich: 18+ specialized tools for file ops, code navigation, web search, and more

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

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ouro_ai-0.2.0.tar.gz (136.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ouro_ai-0.2.0-py3-none-any.whl (126.6 kB view details)

Uploaded Python 3

File details

Details for the file ouro_ai-0.2.0.tar.gz.

File metadata

  • Download URL: ouro_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 136.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ouro_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cde6b8f9fcd57723073250df56897b8f7477f08a29553acbf0b49c0a37cf2007
MD5 77da081bfa4098a454e2c53fdce88bb1
BLAKE2b-256 60e8d1353a2574bc4440349b8c9b2ff4c9fbf47e6e9aeee51acc20031ca12b0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ouro_ai-0.2.0.tar.gz:

Publisher: release.yml on ouro-ai-labs/ouro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ouro_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ouro_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 126.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ouro_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de1580483f6e3e048117163387e071bc81c7f109cc3a9c0e3a9d402b0d14fe6f
MD5 2201d014574e1b2f172845a0a6d70223
BLAKE2b-256 e8ddb761caa54b5ef8ce5ae7e5405622c78f4ec070e27d0afb490cb7255c615c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ouro_ai-0.2.0-py3-none-any.whl:

Publisher: release.yml on ouro-ai-labs/ouro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page