Skip to main content

SQLite-backed MCP event bus and control surface for heterogeneous agent orchestration.

Project description

AgentBus

Test Python License: MIT

The SQLite-Backed MCP Event Bus & Control Surface for Heterogeneous Agent Swarms.

When Cursor, Claude, Antigravity, and Terminal Agents (like Hermes) share a workspace, they usually coordinate through fragile append-only files (log.md). That works until you need SLA timeouts, Human-in-the-Loop (HITL) intercepts, strict schema validation, or cryptographic RBAC.

AgentBus replaces the "Game of Telephone" with a localhost sidecar: a Python MCP server backed by SQLite. No orchestrator runtime lock-in. No heavy cloud dashboard. Just a hyper-fast local pub/sub built for top-tier AI orchestration.

v0.10.0 (July 2026): Orchestration DXagentbus up/down/ps/logs + swarm.yaml (Compose-style). Plus God View mesh (watch/tail/--wiretap). One command swarm, no more 5-pane tmux.

Note: Install as okf-agentbus (CLI command remains agentbus). For watchers: pip install 'okf-agentbus[obs,devex]'.

⚡ The "Ah-Ha" Moment: Zero-Restart Integration

Already running Aider, OpenHands, or custom agents in tmux panes? Do not kill your sessions. AgentBus features a dual-interface architecture (MCP + CLI). You don't need to wire up JSON configs to test it today. Just prompt your running agent:

"Use your terminal to run agentbus publish --topic okf/handoff --payload '{\"from\":\"grok\",\"to\":\"hermes\",\"summary\":\"Write tests\"}'"

The SQLite bus instantly captures it, without requiring the MCP server. Once you're convinced by the Mission Control TUI, you can wire up the strongly-typed MCP server for your next boot.

Why AgentBus?

Alternative Limitation AgentBus
log.md blackboard No schema, race conditions Typed topics, monotonic IDs, advisory locks
LangGraph / CrewAI Same-runtime lock-in Heterogeneous out-of-process clients (IDE + CLI)
LangSmith Cloud-only, backward-looking Local SQLite, forward-looking Execution TUI
Redis pub/sub Extra daemon, complex setup Zero-config SQLite, native stdio MCP

Feature Arsenal (v0.3 - v0.9)

  • God View Mesh (v0.9): Passive OS + MCP observability so silent agents still leave bus footprints (system/mcp, system/fs, system/shell, system/monologue).
  • Mission Control TUI (v0.8+): A rich, keyboard-driven Textual dashboard (agentbus monitor). Trace waterfall, HITL, Wiretap pane, Dark Agent warnings.
  • Pluggable Pydantic Schemas (v0.7): Code-first @bus.topic decorators to enforce strict JSON schemas at the insertion layer.
  • Distributed Context (v0.6): Pass massive context (like git diffs) via --attach. Hard 1MB payload limits prevent context window explosion.
  • Agentic Observability (v0.5): Native OpenTelemetry-style trace_id and parent_span_id lineage.
  • SLA Timeouts & Dead-Letter (v0.4): Prevent phantom deadlocks. If an agent ghosts the swarm, SLA timers route the payload to okf/dead-letter.
  • Swarm RBAC & Droid Proofs (v0.3): Cryptographic JWT/UUID tokens ensure only authorized agents can publish to restricted topics.
  • HITL Intercepts (v0.3): Catch dangerous payloads (e.g., DROP TABLE) and place them in PENDING_APPROVAL for human review via the TUI.

Install

The fastest way (Installs & Auto-wires your IDEs in one step):

curl -sSL https://raw.githubusercontent.com/onicarps/agentbus/main/install.sh | bash

Or manually via pip:

pip install -U "okf-agentbus[devex,sdk]"
agentbus init --apply --producer-id my-agent

Quickstart & Examples

The best way to understand AgentBus is to read our copy-pasteable examples.

See the examples/ directory for 7 flawless, isolated Python scripts covering every feature from basic Pub/Sub to Pydantic Schemas and SLA Timeouts.

# Terminal A — Launch the Mission Control TUI
agentbus monitor

# Terminal B — Publish a handoff
agentbus publish \
  --topic okf/handoff \
  --payload '{"from":"cursor","to":"hermes","summary":"Write tests"}'

God View Observability (v0.9.0): Track silent agents by wiretapping their operations:

# Intercept MCP tool calls
mcp-serve --wiretap

# Watch file edits and command executions
agentbus watch

# Tail internal agent reasoning logs
agentbus tail

Events will stream into the TUI's Wiretap pane as system/mcp, system/fs, system/shell, and system/monologue topics.

📦 Workspace Isolation (The .agentbus directory)

AgentBus operates on the concept of Workspace Isolation (similar to how git uses .git or Docker uses docker-compose.yml).

The bus and its events are physically scoped to the directory you run it in. This prevents your Swarm from tracking your entire operating system or cross-contaminating different projects.

When you navigate to a specific project folder and run agentbus init or agentbus up, it creates a localized .agentbus/events.db SQLite database specifically for that directory.

1-Click Swarm Orchestration (v0.10.0)

Instead of manually opening 5 tmux panes to start your agents and observability daemons, use the new orchestrator:

cd /path/to/my-project

# 1. Generate a boilerplate .agentbus/swarm.yaml
agentbus up --init

# 2. Boot the swarm (Watchers, Agents, and TUI) in one click
agentbus up

# 3. View running background agents
agentbus ps

# 4. Safely kill the entire swarm
agentbus down

Documentation

For full architectural documentation, see the docs/ directory.

License

MIT — see 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

okf_agentbus-0.10.2.tar.gz (80.3 kB view details)

Uploaded Source

Built Distribution

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

okf_agentbus-0.10.2-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file okf_agentbus-0.10.2.tar.gz.

File metadata

  • Download URL: okf_agentbus-0.10.2.tar.gz
  • Upload date:
  • Size: 80.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for okf_agentbus-0.10.2.tar.gz
Algorithm Hash digest
SHA256 dc78b4852a5c3817ea227f586f6e3110025c62d8cd9a1eaefc584ef295a21828
MD5 c5acce2d193f7e6b1a511f8f9dfc08a5
BLAKE2b-256 c7960d187718713a6bbd08c521b4d2056187cc900743eae867a78b3818ac293f

See more details on using hashes here.

File details

Details for the file okf_agentbus-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: okf_agentbus-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for okf_agentbus-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c18f0c44b9fedfad734dddfbbb5a74aededb13319fbe899d578f534c430d583
MD5 800a37f54a3c3460274212b85b43c348
BLAKE2b-256 a7002c4a68650439d4062bd91dafe47793401ea5a2431fadab1c31874f9f9073

See more details on using hashes here.

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