Open Agent Loops
A minimal, provider-agnostic agentic loop built on swappable interfaces.
The fundamental pieces to build and extend your own agent — your Jarvis, your Cortana, your Samantha.
A minimal, provider-agnostic agentic loop. Every fundamental piece sits behind an interface, so it can be swapped without touching the loop — the point of the package is to make the components of the agent plug-and-play, independently testable, and reliable.
Getting Started
Run your first agent loop, add a real model client, and gate tool calls.
API Reference
Every public symbol, generated from the source TSDoc.
Why It Exists
- Plug-and-play seams — the model client, memory, tools, and stop conditions are all interfaces. Implement them with a plain object or function.
- Streaming by default —
ModelClient.stream()returns an async iterable ofStreamEvents, so reasoning, text, and tool calls arrive incrementally. - Bring your own front end — the loop is headless. It emits a typed
AgentEventstream viaonEvent; render it to a console, the DOM, a TUI, or anywhere — the same run drives a CLI or a browser UI unchanged. - Provider-agnostic — nothing in the core references a specific LLM SDK. Any
OpenAI-compatible endpoint works with a raw
fetch. - Runs anywhere — the core has no platform APIs and a single dependency
(
zod), so the same ESM build runs in Node, Bun, Deno, and the browser. - Independently testable — each seam is verified in isolation with deterministic test doubles; zero network.