Provider-agnostic
Native loop calls LLMs directly. Anthropic, OpenAI, Gemini, Ollama, Bedrock, Copilot, DeepSeek. Connectors drive external agents behind the same interface.
Composable. Provider-agnostic. Headless. One Agent interface, every LLM. NDJSON over stdio. Embeddable in your own Rust project.
Install in seconds. No API keys required for local models.
{"type":"session_created","session_id":"019f4a2c-...","timestamp":1719876543}
{"type":"user_message","content":"explain this codebase"}
{"type":"thinking_delta","content":"Let me explore the repository structure..."}
{"type":"tool_call","tool":"glob","args":{"pattern":"**/*.rs"}}
{"type":"tool_result","files":["src/main.rs","src/lib.rs","..."]}
{"type":"markdown_delta","content":"This is a Rust project organized as..."}
{"type":"turn_completed","tokens":{"input":1247,"output":583}}
Native loop calls LLMs directly. Anthropic, OpenAI, Gemini, Ollama, Bedrock, Copilot, DeepSeek. Connectors drive external agents behind the same interface.
Optional plugin: search_web + scrape_page + researcher role. DuckDuckGo and SearXNG backends with automatic fallback.
AgentBuilder fluent API composes providers + engine + plugins. The flex headless runner streams NDJSON over stdio.
Verify/SubmitVerdict spawn a fresh-context subagent that never sees the maker's reasoning — only artifacts and a rubric. Optional plugin, zero footprint when disabled.
run_goal drives repeated turns to a stated outcome under explicit stop-rules. flex serve --enable-routines runs the same goals unattended, on a cron schedule or a webhook.
flex serve: bearer-auth HTTP/SSE with an OpenAPI spec. Binds loopback-only unless given an explicit token — no CORS layer, no unauthenticated routes.
./scripts/install_mac.sh
Builds the release binary and installs the flex runner to ~/.local/bin (macOS/Linux). On Windows use ./scripts/install_windows.sh (Git Bash / WSL / MSYS2) → %USERPROFILE%\.local\bin. Works from any project directory.
flex run --provider deepseek --model deepseek-v4-pro -p "explain this codebase"
Works with any project. No configuration needed.
The AgentBuilder fluent API composes providers, the native
engine, and plugins into an EngineService. It ships in the
agentloop-sdk crate under packages/sdk.
use agentloop_sdk::AgentBuilder;
let service = AgentBuilder::new()
.provider("deepseek")
.model("deepseek-v4-pro")
.provider_key("deepseek", "sk-...")
.enable_plugin("search")
.build()?;
.provider(id)
Preferred provider (anthropic, openai, gemini, deepseek, ...).
.model(ref)
Default model, optionally provider/model-qualified.
.provider_key(id, key)
API key for a built-in provider, bypassing env vars.
.cwd(path) / .headless()
Sandbox to a directory (default: cwd), or run read-only with no project.
.verbosity(level)
NDJSON output verbosity: Low, Medium, High.
.enable_plugin(id)
Enable a built-in plugin ("search", "learning", "verifier").
.plugin(impl Plugin)
Register a custom plugin.
.custom_providers(specs)
Client-configured OpenAI-compatible providers.
.all_providers(true)
Register every provider whose credentials resolve.
.fallback_models(models)
Engine-wide failover chain for sessions that don't set their own.
.enable_workflow_tool(true)
Register RunWorkflow: declarative multi-step subagent pipelines.
.build()
Resolve providers, fold in plugins, return EngineService.
Built-in providers are detected from environment variables. Use
.provider_key(id, key) to supply keys programmatically.
OpenAI-compatible endpoints can be added via
.custom_providers(vec![CustomProviderSpec { ... }]).
Hub-and-spoke, layered bottom-up: contracts (pure data types) at the base, core (traits and registries) above, then everything else depends outward. The engine crate knows nothing about providers — the providers facade resolves credentials and hands a prebuilt registry to the engine.