← all repositories
bubbuild/bub

The agent runtime that started in group chats, not demos

A small, hook-first Python runtime for agents that share conversations with people — because group chats don't tolerate hidden state or framework magic.

★1.7k stars Python AgentsCoding Assistants
bub
Velocity · 7d
+0.4
★ / day
Trend
→steady
star history

What it does Bub is a small Python runtime for agents that work in shared environments — the group-chat situation where multiple humans and multiple agents share one conversation and everyone needs to see what happened. Every inbound message passes through a single turn pipeline (resolve_session → load_state → build_prompt → run_model → save_state → render_outbound → dispatch_outbound), and every stage of it is a hook. The same pipeline drives the CLI, Telegram, and any channel you add, and it follows the agents.md and Agent Skills conventions instead of inventing its own tool format.

The interesting bit The hooks run on pluggy — the same machinery pytest is built on — so you override one stage or replace the whole flow without forking, and external plugins load after builtins and take precedence. Equally unusual is the context model: state is rebuilt from append-only records (a tape) rather than hauled around as mutable session state, which makes turns inspectable, replayable, and safe to hand off mid-conversation. There’s also a stated principle of operator equivalence — humans and agents live inside the same boundaries and evidence trail, no privileged operator class.

Key highlights

  • Every turn stage is a pluggy hook; the contract lives in src/bub/hookspecs.py, builtins are replaceable, later plugins win.
  • Tape context: append-only records instead of mutable session state — inspectable, replayable, handoff-friendly.
  • One runtime across surfaces: CLI, Telegram, and custom channels share the same inbound pipeline; adapters change the surface, not the model.
  • Batteries included but replaceable: tools, skills, and model execution ship with the core.
  • Grounded in open conventions (agents.md, Agent Skills) rather than a bespoke format.

Caveats

  • The default model is an OpenRouter free tier (openrouter:openrouter/free) — enough for a first turn, but the README is silent on what you should run for anything serious.
  • Plugin dependencies live in a separate uv project under ~/.bub/bub-project, managed by the runtime itself — a tidy isolation trick that also puts dependencies where your project’s lockfile can’t see them.
  • Telegram is the only bundled non-CLI channel; anything else means writing your own adapter.

Verdict Worth a close look if you’re building agents that coexist with people in shared channels, or if you’ve ever wanted to rewire an agent framework stage by stage instead of forking it. If you want a heavyweight platform with every integration pre-wired, Bub will feel small — deliberately so.

Frequently asked

What is bubbuild/bub?
A small, hook-first Python runtime for agents that share conversations with people — because group chats don't tolerate hidden state or framework magic.
Is bub open source?
Yes — bubbuild/bub is open source, released under the Apache-2.0 license.
What language is bub written in?
bubbuild/bub is primarily written in Python.
How popular is bub?
bubbuild/bub has 1.7k stars on GitHub and is currently holding steady.
Where can I find bub?
bubbuild/bub is on GitHub at https://github.com/bubbuild/bub.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.