Skip to main content

AgentBus

Test PyPI Python License: MIT

The Zero-Daemon, SQLite-Backed Event Bus & Visual Cockpit for Multi-Agent Coding.

When Cursor, Claude Desktop, Antigravity, terminal bots (Hermes, Aider), and custom Python scripts work together in the same workspace, coordinating them usually devolves into messy, append-only log.md files or heavy cloud dashboards.

AgentBus gives your AI agents a fast, typed, local pub/sub highway backed by a single SQLite file (.agentbus/events.db) and gives you an interactive God View Mission Control TUI to watch every handoff, trace execution lineage, and approve dangerous actions in real time.


⚡ 30-Second Quickstart (The "Ah-Ha" Moment)

You don't need complex configurations or Docker daemons to see AgentBus in action.

1. Install

# Installs AgentBus, its isolated Python runtime, and verifies the CLI.
curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/onicarps/agentbus/main/install.sh | bash

The installer does not create a bus in whichever directory you happened to run it from. It prints the direct command path for immediate use and adds its command directory to new interactive shells (bash, zsh, and fish).

Create a project workspace and initialize your first agent:

mkdir -p ~/my-agent-workspace && cd ~/my-agent-workspace
~/.local/bin/agentbus init --apply --producer-id my-agent

(Or via package manager in an existing environment: pipx install okf-agentbus or uv tool install okf-agentbus — the interactive TUI monitor is bundled out-of-the-box.)

2. Launch the Visual Monitor (Terminal A)

~/.local/bin/agentbus monitor

(Or use the standalone command: agentbus-monitor)

You are now in the God View TUI dashboard:

  • Live Event Stream: Watch real-time multi-agent activity as it occurs.
  • Trace Waterfall: Inspect trace_id lineage and parent-span relationships.
  • HITL Approvals: Review pending approvals with one-keystroke hotkeys ([a] approve / [r] reject).

3. Send Your First Message (Terminal B)

Open another terminal in the same folder and publish a handoff event:

~/.local/bin/agentbus publish \
  --topic okf/handoff \
  --producer-id my-agent \
  --payload '{"from":"my-agent","to":"reviewer","summary":"Added auth endpoints; please review and write tests."}'

👉 Look back at Terminal A: the event immediately pops up on your monitor!


🛠️ Why AgentBus?

Approach Limitations How AgentBus Solves It
Shared log.md file Race conditions, zero schemas, no delivery guarantees, unsearchable history Typed topics, monotonic event IDs, SQLite transactional integrity, advisory file locks
Cloud SaaS (e.g. LangSmith) Latency, cloud data egress, vendor lock-in, heavy setup for local development 100% local SQLite storage, zero cloud egress by default, instant startup
Heavy Brokers (Redis, Kafka) Background daemon requirements, port collisions, Docker overhead Zero daemons: embedded SQLite sidecar per project directory (.agentbus/events.db)
Framework Runtimes (LangGraph, CrewAI) Locked into a single Python runtime or process Connects heterogeneous agents across IDEs (Cursor, Claude Desktop), CLI tools, and scripts via standard MCP and CLI

📦 Fresh Boot & Installation Guide

AgentBus requires Python 3.11+. The one-command installer bootstraps an isolated runtime automatically, including on a machine without Python. The God View interactive monitor (rich + textual) is bundled with the base package.

Handles fresh boots, non-root environments, and Linux PEP 668 (externally-managed-environment) automatically:

curl --proto '=https' --tlsv1.2 -LsSf https://raw.githubusercontent.com/onicarps/agentbus/main/install.sh | bash

Option B: Standalone CLI Tool (pipx or uv)

If you prefer isolated CLI tools without creating project virtual environments:

# Using uv (fastest)
uv tool install okf-agentbus

# Using pipx
pipx install okf-agentbus

Option C: In an existing virtual environment

If you have an active project virtual environment (.venv):

pip install -U okf-agentbus

💡 System Python: On modern Linux (Ubuntu 24.04+, Debian 12+) and macOS Homebrew, system Python correctly rejects bare pip install. Use the one-command installer above, uv tool install okf-agentbus, or pipx install okf-agentbus; do not bypass the OS protection.


🔌 Connecting Your AI Coding Agents

AgentBus speaks standard Model Context Protocol (MCP) over stdio as well as standard CLI commands.

1-Click Auto-Configuration

Navigate to your project workspace and run:

agentbus init --apply --producer-id my-agent

For a fresh default workspace, init maps my-agent to the least-privileged engineer role so its first okf/handoff publish works. It scans for installed tools (Cursor, Claude Desktop, Antigravity) and automatically generates the necessary MCP configuration without changing existing custom RBAC policies.

Manual IDE Configurations

For Cursor (~/.cursor/mcp.json or .cursor/mcp.json)

{
  "mcpServers": {
    "agentbus": {
      "command": "agentbus",
      "args": ["mcp-serve"],
      "env": {
        "AGENTBUS_WORKSPACE": "/path/to/your/project",
        "AGENTBUS_PRODUCER_ID": "cursor"
      }
    }
  }
}

For Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "agentbus": {
      "command": "agentbus",
      "args": ["mcp-serve"],
      "env": {
        "AGENTBUS_WORKSPACE": "/path/to/your/project",
        "AGENTBUS_PRODUCER_ID": "claude"
      }
    }
  }
}

Once connected, your AI agents will automatically see tools like:

  • agentbus_publish — publish task updates, handoffs, and questions.
  • agentbus_poll — check for incoming assignments.
  • agentbus_lock_acquire / agentbus_lock_release — prevent file edit collisions.

💡 Practical Examples for Beginners & Intermediates

Example 1: CLI Coordination (Zero Code)

Simulate two agents working together directly from the shell:

# Agent A publishes a completed task:
agentbus publish \
  --topic okf/handoff \
  --payload '{"from":"alice","to":"bob","summary":"Refactored database models"}'

# Agent B polls for new tasks:
agentbus poll --topic okf/handoff --since-id 0

Example 2: Python Script (Publishing & Polling)

Integrate any custom Python agent or bot in 5 lines:

from pathlib import Path
from agentbus.rbac import ensure_default_roles
from agentbus.store import EventStore

# Connect to current project workspace
workspace = Path.cwd()
ensure_default_roles(workspace)  # install the local role policy first
store = EventStore(workspace)

# Publish an event
event, _ = store.publish(
    topic="okf/handoff",
    producer_id="codex",
    schema_version="1.0",
    payload={"from": "codex", "to": "all", "summary": "Job completed successfully"},
)
print(f"Published event #{event.event_id}")

# Poll new events
messages = store.poll("okf/handoff", since_id=0)
for ev in messages["events"]:
    print(f"[{ev['event_id']}] {ev['payload']['summary']}")

store.close()

Example 3: Human-in-the-Loop (HITL) Safety Intercepts

Catch dangerous AI operations (e.g. database migrations, shell scripts, deletions) before they execute:

# 1. Register an intercept rule: any handoff containing 'DROP' requires human approval
agentbus config set-intercept --topic okf/handoff --contains "DROP" --ttl-minutes 30

# 2. When an agent tries to publish:
agentbus publish \
  --topic okf/handoff \
  --payload '{"from":"agent","to":"db","summary":"DROP TABLE users"}'
# => Status becomes: PENDING_APPROVAL

# 3. View and approve/reject it in the TUI:
agentbus monitor
# Press [A] to approve or [R] to reject!

Example 4: Preventing File Collisions with Advisory Locks

When multiple agents write code at the same time, they can accidentally overwrite each other. Use advisory leases:

# Agent 1 locks a file before editing:
agentbus lock acquire --resource src/models.py --owner-id agent-1 --ttl 300

# Agent 2 checks lock status:
agentbus lock status --resource src/models.py

# Agent 1 releases the lock when finished:
agentbus lock release --resource src/models.py --owner-id agent-1 --lease-id <LEASE_ID>

Example 5: 1-Click Multi-Agent Swarm (agentbus up)

Instead of opening 5 terminal windows, orchestrate your agents, file watchers, and monitor together:

# 1. Generate default .agentbus/swarm.yaml
agentbus up --init

# 2. Start the swarm (daemons + God View monitor)
agentbus up

# 3. Check running background workers
agentbus ps

# 4. Tear down the swarm cleanly
agentbus down

📚 Complete Examples Catalog

Check out the examples/ folder for fully isolated, executable Python scripts:

See the Examples Guide for full documentation on each recipe.


⌨️ CLI Cheat Sheet

Command What it does
agentbus monitor Launch the interactive God View TUI dashboard (agentbus-monitor also works)
agentbus publish --topic <t> --payload '<json>' Publish an event to the local SQLite bus
agentbus poll --topic <t> [--since-id <id>] Read published events from the bus
agentbus init --apply --producer-id <id> Auto-discover MCP configs for Cursor/Claude/Antigravity
agentbus doctor Run non-destructive diagnostic checks on SQLite, schema, and environment
agentbus lock acquire --resource <path> Acquire an exclusive lease/lock on a file or resource
agentbus lock release --resource <path> Release a previously held lease
agentbus config set-intercept --topic <t> Create Human-in-the-Loop approval rules
agentbus up Boot multi-agent swarm services declared in swarm.yaml
agentbus ps View active swarm background services
agentbus down Terminate all active swarm processes

📖 Deep-Dive Documentation


📄 License

MIT — see LICENSE.

Metadata

Release files for okf-agentbus 0.26.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.26.0
File Size Uploaded Provenance Actions
okf_agentbus-0.26.0.tar.gz 384.3 kB With provenance Details for okf_agentbus-0.26.0.tar.gz

Built distributions (wheels)

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

Total release size: 37.5 MB

Release files / okf_agentbus-0.26.0.tar.gz

Download URL okf_agentbus-0.26.0.tar.gz
Size 384.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c789e081dc0a5e36b9d25418d1826d7fc768359839c01d4f250756b96d8308db
BLAKE2b-256 checksum
How to use checksums
483c6a7b5adee6af2d40e75c5c67947ec6c6d350c7c6a29a06fd43b508f36987
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 Oct 21, 2026.

Transparency log

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

Download URL okf_agentbus-0.26.0-py3-none-win_amd64.whl
Size 7.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
da6e4d3ee0a09c2d407f02b065c92569e77d21d9f5683553cf88f1850650453b
BLAKE2b-256 checksum
How to use checksums
0eb15842a2281bfe4a24fb58c5842da2c7dfff29dec1a7157afbe5eb9f333176
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 Oct 21, 2026.

Transparency log

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

Download URL okf_agentbus-0.26.0-py3-none-manylinux2014_x86_64.whl
Size 7.6 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
65a6551e76bfa830fa6c0dc8689a18a42953987ec6ee54e37f4a43976816b6f1
BLAKE2b-256 checksum
How to use checksums
10ca85e90b357f278792afa40b398851b5689ab172e219a93549a9a275d0c8a2
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 Oct 21, 2026.

Transparency log

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

Download URL okf_agentbus-0.26.0-py3-none-manylinux2014_aarch64.whl
Size 6.9 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
7e5b920747fd57cb1fa977c489d36d967d97eac8ddfef226c7bb64a2f2f7ea11
BLAKE2b-256 checksum
How to use checksums
bfc117fdda255e624ba787d1d3382a7a5a2f2f266ef4b6ae5b96f952db8b9e33
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 Oct 21, 2026.

Transparency log

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

Download URL okf_agentbus-0.26.0-py3-none-macosx_11_0_x86_64.whl
Size 7.7 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
fc831aff9c9b59c29f37d0a838bf542c95cc0c11f1291a32537dda116cb45514
BLAKE2b-256 checksum
How to use checksums
2acd6e1f5ea9b1bd25c0ad3eb733d2a80aa3c0392a96ecacc0a2875c141ba890
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 Oct 21, 2026.

Transparency log

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

Download URL okf_agentbus-0.26.0-py3-none-macosx_11_0_arm64.whl
Size 7.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
61d163c9beda2036b2f1e4556a6fa8d6ceca5a2f6a3038d13b245ac29175aade
BLAKE2b-256 checksum
How to use checksums
a8874dae8d9bc80a1682ed00aa7d2fe20769493cd2553e4d541b37bee8954a15
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 Oct 21, 2026.

Transparency log

Security for okf-agentbus 0.26.0

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for okf_agentbus-0.26.0.tar.gz

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 Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.26.0 This release

6 release files Full provenance

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