bubbuild/bub

Bub it. Build it. A hook-first runtime for agents that live alongside people.

What it solves

Bub provides a lightweight Python runtime for building AI agents designed to operate in shared environments, such as group chats. It addresses the problem of "framework sprawl" and hidden state by ensuring that humans and agents work within the same runtime boundaries with a transparent, auditable history.

How it works

Bub uses a hook-first architecture where every stage of a message's journey—from session resolution and prompt building to model execution and output rendering—is a pluggable hook. Instead of maintaining mutable session state, it uses a "tape context" where context is rebuilt from append-only records. This allows the same runtime to be deployed across different surfaces (CLI, Telegram, or custom channels) using adapters.

Who it’s for

Developers building AI agents that need to collaborate with humans in real-time, shared communication channels, and those who prefer a modular, plugin-based system over rigid agent frameworks.

Highlights

  • Hook-based extensibility: Every turn stage is a pluggy hook, allowing developers to override specific parts of the agent's logic without forking the runtime.
  • Tape context: Uses append-only records for context, making it easier to inspect, replay, and hand off sessions.
  • Surface agnostic: A single runtime pipeline that works across CLI, Telegram, and other custom channels.
  • Operator equivalence: Treats humans and agents as equals within the runtime, ensuring a consistent evidence trail.

Related

  • Project
  • Project
  • Project
  • Project
  • Project