A simple, elegant open-source framework for production-ready AI agents. Tools are plain Python functions with auto-generated schemas, driven by 12 lifecycle hooks and a plugin system, one line to expose HTTP + P2P services.
ConnectOnion is a production-ready AI agent framework built around the principle "tools are just functions." Plain Python functions serve as tools directly — type annotations auto-convert to OpenAI function calling schemas, docstrings become tool descriptions, with no decorators or wrapper classes needed.
The framework provides 12 ordered lifecycle hooks (after_user_input → on_complete) where plugins are simply lists of event handlers. Built-in plugins include re_act (reflection + planning), auto_compact (automatic context compression), subagents (sub-agent generation), and ulw (fully autonomous mode) — directly paralleling Claude Code's core capabilities.
For multi-agent collaboration, host() exposes HTTP + P2P relay services in one line. Fast Rules offers three trust presets (open / careful / strict) that resolve 90% of trust decisions before any LLM call, achieving zero-token security gating. A built-in approval system automatically intercepts dangerous operations like bash commands and file deletion.
The tool ecosystem covers bash/Shell (with bashlex safe parsing), FileTools, BrowserAutomation (Playwright), Gmail, Outlook, GoogleCalendar, Memory, and TodoList — all supportable via co copy for source-level customization. The @xray decorator enables interactive breakpoint debugging: pause execution, inspect variables, edit return values, and preview the LLM's next planned step.
Multi-model support is handled through openai, anthropic, and litellm SDKs for GPT, Claude, Gemini, and other mainstream models, with shorthand aliases like co/gemini-2.5-pro. The Skills system features three-level auto-discovery (project → user → built-in) and is compatible with Claude Code's .claude/skills/ format. CLI commands include co create (project templates), co ai (built-in AI coding assistant), co copy, and co status. A macOS menu bar app (OpenOnion for macOS) and chat.openonion.ai chat frontend are also provided.
Unconfirmed items: License inconsistency (pyproject.toml declares MIT, LICENSE file is Apache-2.0 — Apache-2.0 per LICENSE file); team background not publicly available; chat frontend source location not found in main repo; $5 free credit mechanism unclear; P2P relay implementation details not disclosed.