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.1.0.tar.gz (59.5 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.1.0-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for betaloop-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cbe4f40883c46210c66433a17a88e41d436e12208e6a5f4a35448bbe4008db8d
MD5 2423fe58e393a8d89cb88c6567699115
BLAKE2b-256 29e40157839dd33ba5fef035cab64fa2627de99a967e201d9d3ff71151070440

See more details on using hashes here.

File details

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

File metadata

  • Download URL: betaloop-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 52.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a041eb7946f87dea6ac4989796e491d01c7c0fe1d7cb8835820d9a93dcfa3c1e
MD5 41679b218a85e0c3c3bcbcba42bfb738
BLAKE2b-256 4bb7b0d47af08d035988b79cb0af460586cec814e802513550283b754ab25704

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