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)
runtime—AgentRuntimeReAct loop + event streamllm— OpenAI-compatible chat client (retry / jittered backoff / response-shape validation)tools—ToolRegistry(register / dispatch / mode filtering)actions—Action+UndoEngine(pure, storage-free undo)memory—replay_messages/recap_text+MemoryProviderevents—EventSink(display + record channels) + SSE serializationcontext/modes—AgentContext+AgentMode/ToolCategory
Optional bundles (betaloop.bundles)
host—AgentHosthost-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.store—RunStore/ConversationStore/BlobStoreProtocols +JsonlRunStore(default, zero-database JSONL + content-addressed blob spillover). Hosts wanting a DB implement the Protocols; the default needs none.subagents—SubagentEngine+SubagentRoster/SubagentSpec+delegatetool: isolated worker agents the orchestrator hands subtasks to, tagged so undo still reverts them while the orchestrator's context stays lean.admin—tool_categories/list_tools_admin/list_tool_packages_admin/check_packagesover 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 reverterssandbox— Python code execution (bubblewrap or passthrough backend)skills— markdown skill-pack library +load_skilltool
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
UndoEnginefed 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6239649ea6ee13579fa7f3b51699bf0ec6141d20a94154b21d2a6e5e91e5030f
|
|
| MD5 |
2102753ba8920a06cc913c4be6f9f0b7
|
|
| BLAKE2b-256 |
7eabb683126d89155efff966ea5f12a7ac16f7ba07bdfafeb2b2b606e4294887
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc5e97b6ce7170ddd867431c375029053189eab64b6c5a950acb375dc2850a5
|
|
| MD5 |
b77d1d107497807b70be79b4e5abbacd
|
|
| BLAKE2b-256 |
0347f8c08da4a4710a9558097b4318dd855b078d530a409ce5123fdbd8d7a69f
|