yoagent
An embeddable Rust agent loop that streams from seven LLM protocols, runs tools, and loops until the task is done.
- Source repo
- yologdev/yoagent
- Stars
- ★ 179
- Last updated
- 3mo ago
- FARS reviewed
- Sep 17, 2026
- License
- MIT
- Primary language
- Rust
- FA score
- 63/100 · Some gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude API
- Cost
- Free, no paid service needed
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- A Rust developer building a local coding agent: use the bundled
cliexample withbash, file read/write, andsearchto find TODOs or edit code from a terminal. - Not a fit if
- Teams that need built-in RAG, vector stores, or embedding pipelines
- Teams standardized on Python or TypeScript that cannot adopt a Rust crate
- Teams looking for a managed hosted service or GUI rather than a library
- Maintenance
- Commits in the last 6 monthslast commit 2026-08-28
- Source review
- 63/100 · Some gaps
What does this agent do, and when should you use it?
yoagent is an MIT-licensed Rust crate (0.15, MSRV 1.86) that packages an LLM agent loop rather than a full application framework. Its core is the stateless agent_loop() function, with an optional Agent wrapper that adds conversation history, a tool registry, and steering/follow-up queues. It streams from seven wire protocols through ModelConfig and provider implementations: Anthropic Messages, OpenAI Completions, OpenAI Responses, Azure OpenAI, Google Gemini, Google Vertex, and Amazon Bedrock ConverseStream. The loop emits typed AgentEvents, executes built-in tools such as bash, read_file, write_file, edit_file, list_files, and search, and can call external tools through MCP servers or OpenAPI specs. Around that core it adds ToolMiddleware gating, InputFilter, branching Session history, sub-agents with SharedState, context compaction, AgentSkills loading, cost tracking, and optional GASP run recording for replayable logs.
An application creates an Agent from a ModelConfig (or drives agent_loop() directly), registers tools, and calls prompt(). The provider layer opens a streaming request and emits AgentStart, TurnStart, MessageUpdate text/reasoning deltas, ToolExecutionStart/ToolExecutionEnd, TurnEnd, and AgentEnd events. Built-in tools read, write, edit, list, and search files and run shell commands with timeout and deny patterns; custom tools implement the AgentTool trait, while MCP and OpenAPI adapters register external operations as tools. Every tool call passes through ToolMiddleware (Allow, Modify(args), Deny(reason)), and user input can pass through InputFilter before reaching the model. Session stores history as a parent/child tree with JSONL persistence, SubAgentTool delegates to child loops with independent model/tool/skill settings, and ContextTracker plus tiered compaction manage context. Optional features add GASP event-log recording, OpenAPI tools, and structured outputs via prompt_structured::<T>().
- A Rust developer building a local coding agent: use the bundled
cliexample withbash, file read/write, andsearchto find TODOs or edit code from a terminal. - A team that needs to switch among Anthropic, OpenAI, Gemini, Bedrock, and local Ollama: keep one loop and change
ModelConfiginstead of writing separate adapters. - A platform team adding approval and policy to tool calls: gate every invocation with
ToolMiddlewareAllow/Modify/Deny, and useInputFilterfor PII redaction or prompt-injection checks before the model sees input. - An agent builder that needs delegation without re-pasting large artifacts: use
SubAgentToolfor child tasks andSharedStateto share results by key. - A team that needs auditable, replayable agent runs: use the tree-shaped
Sessionfor checkpoints and branches, or enable thegaspfeature to record runs as clone-and-replay event logs. - A CI pipeline that must test tool-calling, cancellation, and steering deterministically: script multi-turn conversations with
MockProviderand avoid network calls or API keys.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Environment variables
ANTHROPIC_API_KEYGROQ_API_KEYGEMINI_API_KEY- Config files
Cargo.toml- Runtime
- Rust 1.86
How do you install or deploy this agent?
Requires Rust 1.86 or newer (the crate's MSRV). Add it to Cargo.toml:
[dependencies]
yoagent = "0.15"
tokio = { version = "1", features = ["full"] }To try the bundled coding-agent CLI with no API key, install Ollama and run:
git clone https://github.com/yologdev/yoagent && cd yoagent
ollama serve &
cargo run --example cli -- --provider ollamaHosted providers read their conventional environment variables, such as ANTHROPIC_API_KEY or GROQ_API_KEY; pass --api-url for LM Studio, llama.cpp, or vLLM.
How do you use this agent?
Build an agent from a ModelConfig, register tools::default_tools(), then consume the event stream:
use yoagent::provider::ModelConfig;
use yoagent::{tools, Agent, AgentEvent, StreamDelta};
#[tokio::main]
async fn main() {
let mut agent = Agent::from_config(ModelConfig::claude_sonnet_5())
.with_system_prompt("You are a coding assistant.")
.with_tools(tools::default_tools());
let mut events = agent.prompt("Find every TODO in src/ and summarise them").await;
while let Some(event) = events.recv().await {
match event {
AgentEvent::MessageUpdate { delta: StreamDelta::Text { delta }, .. } => print!("{delta}"),
AgentEvent::ToolExecutionStart { tool_name, .. } => println!("\n▶ {tool_name}"),
AgentEvent::AgentEnd { .. } => break,
_ => {}
}
}
agent.finish().await;
}Swap providers by changing the config; the API key follows the provider's convention:
Agent::from_config(ModelConfig::groq("llama-3.3-70b-versatile", "Llama 3.3 70B")); // GROQ_API_KEY
Agent::from_config(ModelConfig::google("gemini-2.5-pro", "Gemini 2.5 Pro")); // GEMINI_API_KEY
Agent::from_config(ModelConfig::ollama("http://localhost:11434", "llama3.1:8b")); // no keySafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
Inherits capabilities of connected MCP servers; audit third-party servers before enabling.
What are this agent's strengths and limitations?
- The loop is a stateless free function:
agent_loop()takes its inputs explicitly, andAgentis only an optional wrapper, so you are not forced into the crate's state model. - Seven native wire protocols rather than one OpenAI-compatible shim, preserving provider-specific features such as thinking budgets, prompt-cache breakpoints, and reasoning deltas.
- Every tool call passes through one
ToolMiddlewarechoke point with Allow/Modify/Deny, which is the basis for approval prompts and policy engines. - History is a tree-shaped
Sessionthat can seek, checkpoint, and branch without overwriting the original branch, with JSONL persistence. - 456 of 463 tests run without network or API keys;
MockProviderscripts multi-turn tool calls and honours cancellation, so abort and steering paths are testable. - Production components ship in the box: MCP, OpenAPI tools, sub-agents, SharedState, skills loading, cost tracking, and loop detection.
- It is a Rust crate: adopters need a Rust 1.86+ toolchain, and there is no Python or TypeScript SDK.
- It deliberately omits vector stores, embedding pipelines, RAG, and task graphs; those require pairing with projects such as rig or swiftide.
- Bedrock explicit
cachePointblocks are not yet wired, and only Anthropic and native OpenAI receive client-side cache hints. - Some capabilities are feature-gated (
openapi,gasp), so you must choose compile features; OpenTelemetry is bridged app-side because the library carries no OTel dependency. - There is no hosted service or web UI; you deploy and operate it yourself, and runtime depends on a model provider (local Ollama or a hosted API).
How does this agent compare with similar options?
The README positions yoagent against two Rust projects. It points to rig when you need RAG pipelines, vector stores, embeddings, transcription, or image generation, and to swiftide for typed task graphs and streaming RAG indexing alongside agents. yoagent's differentiator is a hostable, gateable tool-calling loop with native multi-provider protocols, middleware, branching sessions, and replayable runs, rather than bundling retrieval and orchestration layers.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| yoagent This agent | 63 · Some gaps | Library / SDKFree | ★ 179 | 3mo ago | Rust | OpenAI API · Claude API |
| zerostack | 69 · Some gaps | CLIFree + model costs | ★ 1.8k | 2d ago | Rust | OpenAI API · Claude API |
| bbarit-oss | 57 · Major gaps | CLIFree + model costs | ★ 151 | 4mo ago | Rust | ChatGPT · Codex · Claude Code · OpenAI API · Claude API |
| agentty | 73 · Some gaps | CLIFree + model costs | ★ 561 | today | C++ | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
Trust is thin overall. Least privilege: README and SECURITY.md state plainly that the bash tool runs shell commands and file tools read/write disk, and that the crate ships no default policy — ToolMiddleware, bash deny patterns and path restrictions must be configured by the application, so defaults are broad; scored 1 only because restriction mechanisms exist. User confirmation: ToolMiddleware provides Allow/Modify/Deny gating, but no confirmation flow is on by default, so 1. Data flow transparency: README says API keys come from env vars and are not logged, but does not describe which third-party endpoints receive data or retention, so 1. Sensitive data: SECURITY.md explicitly treats key leakage into logs/tracing/serialized sessions as a vulnerability and InputFilter is offered for PII redaction, a reasonably clear statement, so 2. Dependency security: Cargo.toml pins several version floors with rationale, but there is no audit, SBOM or vulnerability-scanning evidence, so 1. External effects: tools really execute commands and write files, with no sandbox and no default recovery, so 1. Rollback: Session supports seek/branch/checkpoint and GASP enables replay, but that is conversation-history rollback, not rollback of external side effects, so 1. Source attribution: LICENSE and Cargo.toml give author and repository, but publisher identity is unverified and no third-party code provenance is stated, so 1.
Self-consistency: the README module map, example table and feature descriptions align with Cargo.toml features (openapi, gasp) and example declarations (gasp_emit, llm_compaction_live require gasp); no outright contradiction found, but README says version 0.15 while Cargo.toml is 0.18.1, a documentation lag, so 2. Dependency availability: dependencies are common, actively maintained crates on crates.io, with MSRV and resolver=3 policy documented, but no lockfile or offline-availability note, so 2. Failure messages: README states tools return stdout and stderr even on failure, edit_file gives fuzzy-match hints, retry covers only rate-limit and network errors, and context-overflow detection covers 15+ provider error strings — specific, but all documentation claims, so 2.
Audience and scenarios: README targets Rust developers, offers a no-key local Ollama quick start, hosted-model switching, and positioning against rig and swiftide, so 3. Capability boundaries: it explicitly declares itself deliberately narrow, ships no vector stores, embeddings or task graphs, and lists when to use it versus alternatives, so 3. Trigger precision: the agent is prompt-driven and tool calls are model-decided; no trigger conditions, routing or intent determination are described, so 2. Environment fit: Linux/macOS tested, Windows compile-check only, built-in tools depend on unix commands, MSRV 1.86 — constraints are stated but cross-platform capability is limited, so 2.
Information architecture: README is well structured with module map, example table, collapsible feature sections and links to docs and changelog, so 3. Install notes: a Cargo.toml dependency snippet and a git clone run example are given, but the effect of feature flags on installation is not detailed, so 2. Naming stability: crate and module names are stable, but README's 0.15 versus Cargo.toml's 0.18.1 is inconsistent and pre-1.0 has no LTS, so 2. Examples and FAQ: ten runnable examples are listed with key requirements plus inline code snippets, but there is no dedicated FAQ, so 3. Known limitations: README mentions Bedrock not caching automatically, cachePoint unwired, Windows compile-only, and no default policy, but these are not consolidated into a limitations section, so 2. License: MIT with a complete LICENSE file, consistent across Cargo.toml and README, so 3. Versioning and changelog: a CHANGELOG link and version number exist, but no changelog content is present in the supplied files, so 2. Maintenance responsibility: SECURITY.md gives a reporting channel and response window, but publisher identity is unverified and there is no governance or maintainer commitment statement, so 1.
Output usability: event streams, structured outputs, cost statistics and session persistence make output programmatically consumable, but these are documentation claims, so 2. Marginal value: it offers seven native wire protocols and a pluggable loop in the Rust ecosystem, differentiating it from rig and swiftide, but tool-calling loops are not scarce, so 2. Cost benefit: cost tracking, context compaction and loop detection help control spend, but LlmCompaction explicitly adds token cost and no measured data is provided, so 2.
Claim traceability: many README claims point to concrete source files and modules (e.g. src/agent_loop.rs, src/session.rs), which is good traceability, but test counts and CI results cannot be confirmed from static files, so 2. Cross-source corroboration: README, Cargo.toml, CI workflows and SECURITY.md corroborate each other on features, MSRV and test matrix, though the version number is inconsistent, so 2. Fact-inference separation: the docs largely distinguish implemented from unimplemented items (e.g. Bedrock cachePoint unwired), but some performance and quality claims lack supporting evidence, so 2.
- The crate ships no default security policy: the bash tool executes shell commands and file tools read/write disk; ToolMiddleware, deny patterns and path restrictions must be configured by the application, so out-of-the-box use treats model output as trusted instructions.
- Publisher identity is unverified, and the README version (0.15) disagrees with Cargo.toml (0.18.1); rely on crates.io and the actual repository contents before installing.
- There is no dependency audit, SBOM or vulnerability-scanning evidence, and the dependency set is fairly large (reqwest, tokio, etc.); run cargo audit and pin versions before production use.
- README claims about test counts, CI passing and GASP conformance cannot be confirmed from static files and should not be treated as reliability evidence.
- Built-in tools depend on unix commands and Windows is compile-check only; cross-platform deployment needs independent verification.
FAQ
Do I need an API key just to try it?
--provider ollama or --api-url for local models. Hosted services need their conventional variables, such as ANTHROPIC_API_KEY or GROQ_API_KEY.Does it lock me into one LLM vendor?
ModelConfig change.Can I drive the loop without adopting the Agent wrapper?
agent_loop() is stateless and takes everything it needs as arguments; Agent is an optional stateful wrapper that adds history and queues.Does it include a vector database or RAG?
How can I test tool-calling in CI without network access?
MockProvider to script multi-turn tool calls and text replies. It emits real StreamEvents and honours cancellation; the repository says 456 of 463 tests need no network or API keys.Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.