yologdev/yoagent

The agent loop for Rust — stream from 7 LLM protocols, run tools, loop until done.

What it solves

yoagent is a specialized framework for building AI agents in Rust. It focuses specifically on the "agent loop"—the process of prompting an LLM, streaming responses, executing tools, and repeating the process until a final answer is reached. Unlike general-purpose LLM frameworks, it avoids including vector stores or RAG pipelines, focusing instead on the machinery required to run tool-calling agents in production.

How it works

The core of the project is a stateless agent_loop() function that manages the interaction between the LLM and the tool execution environment. It provides an optional Agent wrapper for managing history and queues. The framework supports seven native wire protocols (including Anthropic, OpenAI, Gemini, and Bedrock) to ensure provider-specific features like thinking budgets and prompt-cache breakpoints are preserved.

Key architectural features include:

  • Session Trees: History is managed as a tree rather than a list, allowing users to fork, checkpoint, and seek through conversation turns.
  • Extensions: A single plugin contract allows developers to gate, modify, or redact tool calls and results, and enforce budgets.
  • Extensions: A single plugin contract allows developers to gate, modify, or redact tool calls and tool results, and enforce budgets.
  • Sub-agents: The system supports delegating tasks to child loops with their own models and tools.

Who it’s for

Rust developers who need a robust, production-ready tool-calling loop for AI agents without the overhead of a general-purpose LLM orchestration layer.

Highlights

  • Native Protocol Support: Implements 7 native protocols instead of a single OpenAI-compatible shim.
  • Tree-based History: Supports branching and editing earlier turns without destroying original branches.
  • Offline Testing: Includes a MockProvider to script multi-turn conversations for testing without API keys.
  • ** uma Wasm Support**: Supports wasm32-unknown-unknown for deployment to environments like Cloudflare Workers.
  • Built-in Tools: Ships with native tools for bash, file system operations, and search.
  • Recordable Runs: Can record runs into a GASP repo as an append-only semantic event log.

Related

  • Project
  • Project
  • Project
  • Project