ConnectOnionConnectOnion

ConnectOnion

Build AI agents in 8 lines, not 50

Terminal
$pip install connectonion

Copy and run to get started in 30 seconds

Production ReadyMIT LicensePython 3.9+PyPI DownloadsDiscord

Framework Status (v0.3.2 - Production Ready)

Stable: Core agent, tools, LLM integration, CLI, auto-logging
New: Interactive debugging (@xray), Python REPL, breakpoints
ConnectOnion Philosophy

Keep simple things simple

Make complicated things possible

How It Works

It's just this simple:

Agent =Markdown + Functions
Markdown
your prompt
+
Functions
your tools
=
Agent
AI assistant

Complete Example

This is all the code you need:

main.py
1from connectonion import Agent 2 3# 1. Write your prompt 4prompt = "You are a helpful assistant" 5 6# 2. Define your function 7def calculate(expression: str) -> str: 8 return str(eval(expression)) 9 10# 3. Create agent 11agent = Agent(prompt, tools=[calculate]) 12 13# That's it! Use it: 14result = agent.input("What's 42 * 17?") 15print(result) # "42 * 17 equals 714"
Python REPL
Interactive
42 * 17 equals 714

See the Difference

Same AI agent, different approach

Lines of Code85% less
8 lines
~50 lines

Same result, way less boilerplate

1from connectonion import Agent
2
3def calculate(expression: str) -> str:
4    return str(eval(expression))
5
6agent = Agent("You are a helpful assistant", 
7              tools=[calculate])
8
9result = agent.input("What's 42 * 17?")
10print(result)

Same result, 85% less code

No boilerplate. No complexity. Just agents.

AI-Powered Development

Vibe Coding with Claude Code

Install the Claude Code plugin and let AI write your ConnectOnion agents for you.

Claude Code
Official Anthropic Plugin
Install Claude Code Plugin

Free plugin โ€ข 2-minute setup โ€ข Start coding with AI

1

Copy Documentation

Click the button above

2

Paste to Your AI

Any AI coding assistant

3

Start Building

AI writes perfect code

Direct access to the authors on Discord โ€ข Shape the framework with us

Start Simple, Ship Production-Ready

Zero setup complexity, full production capabilities

Zero Setup

Functions become tools instantly

Debug Mode

@xray shows everything

Auto Logging

Every interaction logged to .co/logs/

Professional CLI

$ co init
โœ“ Project ready in 5 seconds
  • Project templates
  • Environment management
  • Best practices built-in

Interactive Debugging

NEW
agent.auto_debug()
๐Ÿ” Breakpoint hit!
> Press 'c' to continue
> Press 'e' to edit variables
  • Pause at breakpoints
  • Python REPL access
  • Test "what if" scenarios
Learn more
Interactive Debugging

Agents That Debug Themselves

Pause at breakpoints, inspect variables, test edge cases - all in real-time

main.py
1from connectonion import Agent 2from connectonion.decorators import xray 3 4@xray # This tool becomes a breakpoint 5def search_emails(query: str): 6 return api.search(query) 7 8def send_email(to: str, body: str): 9 return api.send(to, body) 10 11agent = Agent( 12 name="email_assistant", 13 tools=[search_emails, send_email] 14) 15 16# Debug with a prompt - starts immediately! 17agent.auto_debug("Send email to John")
Python REPL
Interactive
๐Ÿ” Interactive Debug Session Started
Agent: email_assistant | Tools: 2
Debugging: "Send email to John"
ย 
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
๐Ÿ”ด @xray BREAKPOINT: search_emails
ย 
๐Ÿ“Š Local Variables:
query = "John"
result = "Found 1 email from john@company.com"
ย 
๐Ÿ“ Context:
User: "Send email to John"
Iteration: 1/10
Tools executed: 1/2
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
ย 
โšก What do you want to do?
โ†’ Continue execution ๐Ÿš€ [c or Enter]
Edit variables ๐Ÿ” [e]
Quit debugging ๐Ÿšซ [q]
ย 
๐Ÿ’ก Tip: Press 'c' to continue or '?' for help
> c
ย 
โ†’ Tool: send_email(to="john@company.com", ...)
โ† Result: Email sent successfully
ย 
โœ“ Task complete (1.2s)

@xray Breakpoints

Decorate any tool with @xray - agent pauses automatically. Inspect variables, context, and full execution state.

Zero Learning Curve

Arrow keys or shortcuts (c/e/q). Tips always shown. No docs needed.

Time-Travel Testing

Press e for Python REPL. Change one variable, watch entire agent behavior change. Test edge cases instantly.

Learn Interactive Debugging

Available in v0.3.2 โ€ข Coming soon: Ask AI, View trace, Step mode

Multi-Agent Systems

Agents That Work Together

One line to serve. One line to connect. That's all you need.

1

Serve an Agent

main.py
1from connectonion import Agent 2 3def translate(text: str) -> str: 4 return translation_result 5 6agent = Agent( 7 "You are a translator", 8 tools=[translate] 9) 10 11# Make it available to others 12agent.serve()
Python REPL
Interactive
๐ŸŸข Agent Online
Public Key: 0x3d4017c3...
ย 
Debug: https://oo.openonion.ai/...
Protocol: co://0x3d4017c3...
ย 
[Waiting for connections...]
2

Connect to It

main.py
1from connectonion import connect 2 3# Connect using public key 4translator = connect( 5 "0x3d4017c3..." 6) 7 8# Use it like any function 9result = translator.input( 10 "Translate 'Hello' to Spanish" 11) 12 13print(result)
Python REPL
Interactive
"Hola"

Zero Config

Public key is auto-generated

Web Debugger

Test agents in browser instantly

Long Tasks

Built for 20+ minute operations

What You Get

Ed25519 Identity: Cryptographic public key as address
Auto Relay: NAT traversal handled automatically
Signed Messages: All communication verified
Protocol URL: co:// links open debug interface

Ready to Start?

Build your first agent today

Terminal
$pip install connectonion