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.2.0.tar.gz (64.7 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.2.0-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for betaloop-0.2.0.tar.gz
Algorithm Hash digest
SHA256 42e06b57d281303088a34ca5250fd2c4ec31f0f86cc6ee8bb9da3a971b9b191c
MD5 5b9da2dcb976aab3dd0916c13bf99a99
BLAKE2b-256 7d6897384fc2b1eb20301ed34c802ee269054de7d600b11fbf262c552e88e8d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: betaloop-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 56.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17edb4089d9984ac6918dbcb8e3ceaa060dacf21f736999ad5bab5f93bf83385
MD5 7509b415f7102bc14cb01733c3614393
BLAKE2b-256 2ed943d21da2fad8a3c275125302e4a29ce4249e2158d7a9ce27a2d0ff1d6b89

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