Skip to main content

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.19.0 (August 2026): Release-integrity gates, honest runtime diagnostics, registered Codex/Pi headless adapters, and untrusted-event prompt containment, on top of the MCP Python SDK v2 migration. See the changelog for details.

Note: Install as okf-agentbus (CLI command remains agentbus). Extras: [obs,devex,jupyter,sdk].

⚡ 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.18)

  • MCP Python SDK v2 (v0.18): migrated the stdio MCP server while preserving the existing event-store contract.
  • Resilient delivery (v0.16.4): bounded retry with jitter, retry-exhausted dead letters and file spillover for SQLite contention.
  • Async suspend/resume (v0.16): durable waits and correlated wake events let headless agents yield without busy polling.
  • Headless runners (v0.15): opt-in adapters for heterogeneous CLI agents with bounded chain behavior and structured acknowledgements.
  • Wake plane and Go helpers (v0.12-v0.13): platform-packaged workers, role leases, wake ingress and webhook delivery.
  • Jupyter async client (v0.11): from agentbus.jupyter import AsyncAgentBus + %agentbus start — non-blocking polls that yield to the notebook event loop.
  • TypeScript client (v0.11): packages/js/agentbus-client — Node EventEmitter + MCP stdio spawn (@agentbus/agentbus-client, path install for now).
  • 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

Jupyter notebooks:

pip install -U "okf-agentbus[jupyter]"
%load_ext agentbus.jupyter
%agentbus start
# or
from agentbus.jupyter import AsyncAgentBus
bus = AsyncAgentBus()  # AGENTBUS_WORKSPACE or cwd
bus.on_event(print)
await bus.start_background(interval=1.0)

TypeScript (from monorepo checkout):

cd packages/js/agentbus-client && npm install && npm test
# set AGENTBUS_WORKSPACE + agentbus on PATH, then use createStdioMcpClient / AgentBus

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"}'

Before operating or releasing a workspace, run the read-only diagnostics:

agentbus doctor --workspace /path/to/workspace
agentbus doctor --workspace /path/to/workspace --json

The command inspects the target without publishing to its bus. Write-path and MCP stdio checks run in temporary isolated workspaces. --strict makes warnings (including absent optional Go helpers) fail CI.

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.

Metadata

Release files for okf-agentbus 0.21.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for okf-agentbus 0.21.0
File Size Uploaded
okf_agentbus-0.21.0.tar.gz 300.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for okf-agentbus 0.21.0
File
okf_agentbus-0.21.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
okf_agentbus-0.21.0-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
okf_agentbus-0.21.0-py3-none-manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
okf_agentbus-0.21.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details
okf_agentbus-0.21.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 34.8 MB

Release files / okf_agentbus-0.21.0.tar.gz

Download URL okf_agentbus-0.21.0.tar.gz
Size 300.4 kB
Tags Source
SHA-256 checksum
How to use checksums
18f7fece781852c4403adf45bdea16a7fd30d4faabd7b45129ea672f1908b95f
BLAKE2b-256 checksum
How to use checksums
81d12beb2e549850852356f796c829c06c943bbcbe01d38d5f0d36454e631142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / okf_agentbus-0.21.0-py3-none-win_amd64.whl

Download URL okf_agentbus-0.21.0-py3-none-win_amd64.whl
Size 7.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0447a3a958256ee97dc6ba28d3eee4576b813dd1d0b3d5e73396f65a8a4871f0
BLAKE2b-256 checksum
How to use checksums
b0e7372dffdf60785d01dbda55bbb88227deb5ad84f5d01e287063a8aceb63b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / okf_agentbus-0.21.0-py3-none-manylinux2014_x86_64.whl

Download URL okf_agentbus-0.21.0-py3-none-manylinux2014_x86_64.whl
Size 7.0 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3e63a2bef68d3b62a345cab0fd4b976a955066eb5b2e5b61b78c6480cb7c7049
BLAKE2b-256 checksum
How to use checksums
00461ae2460a2558efd9f2c22b820ee7bedc1bf463ff2ffe50a410233029603a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / okf_agentbus-0.21.0-py3-none-manylinux2014_aarch64.whl

Download URL okf_agentbus-0.21.0-py3-none-manylinux2014_aarch64.whl
Size 6.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
59909f5fecf2fb9e21e6367e22f7287e7c1c8ee6e7216f7c3b7d4c2ae7166d55
BLAKE2b-256 checksum
How to use checksums
8b6823af78b0c574597823c19029fb65ad321da0c03ca6bb9a753d78bbc51ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / okf_agentbus-0.21.0-py3-none-macosx_11_0_x86_64.whl

Download URL okf_agentbus-0.21.0-py3-none-macosx_11_0_x86_64.whl
Size 7.2 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
11ef763f78a2efe7b272bad03342649388cfb3f38e43b7b82292eaedfab447c3
BLAKE2b-256 checksum
How to use checksums
0034808d3ad748835f6f2e4a79b839ad9032b1629532afae15d2d545e1e9a382
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / okf_agentbus-0.21.0-py3-none-macosx_11_0_arm64.whl

Download URL okf_agentbus-0.21.0-py3-none-macosx_11_0_arm64.whl
Size 6.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ae915fcbfe016daf3d176ecdfd8349ab05672c4abf1cd7890cd2bdf34edb240f
BLAKE2b-256 checksum
How to use checksums
157d718d417e50a803be24b406f6ba1c27471cb77954077615cee9f58060aec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.24.2

6 release files

0.24.0

6 release files

This release

0.21.0 This release

6 release files

0.20.2

6 release files

0.20.0

6 release files

0.19.0

6 release files

0.17.0

6 release files

0.16.3

6 release files

0.16.2

6 release files

0.16.1

6 release files

0.16.0

6 release files

0.15.0

6 release files

0.14.0

6 release files

0.13.0

6 release files

0.12.1

6 release files

0.12.0

6 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.10.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page