Skip to main content

betaloop

A reusable, storage-free ReAct agent kernel: the engine, framework and protocols that drive a tool-calling agent, plus optional capability bundles. It knows nothing about how runs are stored (or even whether they are) — persistence is an optional EventSink a host plugs in. Any application (a thesis-writing platform, a coding agent, ...) implements its own tools + prompt + storage and reuses this kernel.

Core (zero I/O, zero business)

  • runtimeAgentRuntime ReAct loop + event stream
  • llm — OpenAI-compatible chat client (retry / jittered backoff / response-shape validation)
  • toolsToolRegistry (register / dispatch / mode filtering)
  • actionsAction + UndoEngine (pure, storage-free undo)
  • memoryreplay_messages / recap_text + MemoryProvider
  • eventsEventSink (display + record channels) + SSE serialization
  • context / modesAgentContext + AgentMode / ToolCategory

Optional bundles (betaloop.bundles)

  • hostAgentHost host-adapter framework: message assembly, run envelope (run_start/done), error funneling, StoreSink (persist via a store), undo_run, DictToolAdapter (wrap a dict-based tool system). Eliminates the per-host boilerplate round 1 left behind.
  • storeRunStore/ConversationStore/BlobStore Protocols + JsonlRunStore (default, zero-database JSONL + content-addressed blob spillover). Hosts wanting a DB implement the Protocols; the default needs none.
  • subagentsSubagentEngine + SubagentRoster/SubagentSpec + delegate tool: isolated worker agents the orchestrator hands subtasks to, tagged so undo still reverts them while the orchestrator's context stays lean.
  • admintool_categories / list_tools_admin / list_tool_packages_admin / check_packages over a registry + display packages (admin-panel source; packages are grouping only, tools stay per-name togglable).
  • workspace — sandboxed file I/O + read/write/edit/list tools + file undo reverters
  • sandbox — Python code execution (bubblewrap or passthrough backend)
  • skills — markdown skill-pack library + load_skill tool

Install

pip install betaloop
# local dev (editable + test/lint deps):
pip install -e ".[dev]"

Storage model

The kernel stores nothing. A host provides:

  • an EventSink (write side) — persists message records however it likes (DB / file / nowhere);
  • a MemoryProvider (read side, optional) — replays prior turns;
  • an UndoEngine fed from wherever the host kept actions.

Minimal host sketch

from betaloop import LLMConfig, ToolRegistry
from betaloop.bundles import AgentHost, JsonlRunStore
from betaloop.bundles.workspace import register_file_tools

registry = ToolRegistry()
register_file_tools(registry, lambda ctx: f"/data/{ctx.user_id}")  # your files
store = JsonlRunStore("/var/lib/myapp/agent")                       # zero-DB default
host = AgentHost(registry,
                 LLMConfig(model=..., base_url=..., api_key=...),
                 store, build_system_prompt=my_prompt_builder)

ctx = AgentContext(run_id=rid, user_id=uid)
async for event in host.run(ctx, task, history=prior_turns):
    ...  # forward run_start / step / tool_call / tool_result / done to your frontend

A host supplies only its tools, system prompt, and (optionally) a store backend — the engine, persistence, run envelope, undo, and (via subagents) delegation are all reused.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

betaloop-0.3.0.tar.gz (69.6 kB view details)

Uploaded Source

Built Distribution

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

betaloop-0.3.0-py3-none-any.whl (60.1 kB view details)

Uploaded Python 3

File details

Details for the file betaloop-0.3.0.tar.gz.

File metadata

  • Download URL: betaloop-0.3.0.tar.gz
  • Upload date:
  • Size: 69.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for betaloop-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6239649ea6ee13579fa7f3b51699bf0ec6141d20a94154b21d2a6e5e91e5030f
MD5 2102753ba8920a06cc913c4be6f9f0b7
BLAKE2b-256 7eabb683126d89155efff966ea5f12a7ac16f7ba07bdfafeb2b2b606e4294887

See more details on using hashes here.

File details

Details for the file betaloop-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: betaloop-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 60.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for betaloop-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccc5e97b6ce7170ddd867431c375029053189eab64b6c5a950acb375dc2850a5
MD5 b77d1d107497807b70be79b4e5abbacd
BLAKE2b-256 0347f8c08da4a4710a9558097b4318dd855b078d530a409ce5123fdbd8d7a69f

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 Sentry Error logging StatusPage Status page