Rig

Rust LLM/agent framework for tool-calling, reasoning workflows, and retrieval-augmented systems.

Overview

Rig is a Rust framework for building LLM-powered applications. It provides modular abstractions for tool-calling agents, reasoning workflows, and retrieval-augmented generation (RAG). Unlike the other Rust projects in this section, Rig is a general-purpose agent framework rather than a coding-specific tool — but it provides the foundational building blocks for building one.

AttributeValue
Language / StackRust + Tokio
GitHubgithub.com/0xplaygrounds/rig
LicenseMIT
Closest MatchRust agent framework (like LangChain for Rust)
MaturityActive development

Key Features

  • Modular tool system — Define tools as Rust structs with auto-generated JSON schemas.
  • Multi-provider LLM support — OpenAI, Anthropic, Cohere, and local models via Ollama.
  • Agent workflows — Compose agents with explicit reasoning steps and tool orchestration.
  • RAG support — Vector stores, embeddings, and retrieval pipelines.
  • Type-safe — Leverages Rust's type system for compile-time tool validation.

Architecture

Rig follows a builder-pattern architecture where agents are composed from "providers" (LLM backends), "tools" (functions the agent can call), and "pipelines" (multi-step workflows). It is designed to be embedded in larger Rust applications rather than run as a standalone service. The framework handles LLM communication, tool schema generation, and response parsing, leaving the orchestration logic to the application developer.

Strengths

  • Type safety — Rust's type system catches tool schema mismatches at compile time.
  • Modularity — Composable building blocks let you build exactly the agent you need.
  • Performance — Rust-native with async Tokio for high-throughput agent workloads.
  • Multi-provider — Not locked to a single LLM vendor.
  • Active development — Regular releases and growing community.

Gaps vs Open SWE

  • General-purpose — Not designed specifically for coding agents; no built-in file editing tools.
  • No sandbox — No built-in execution isolation.
  • No GitHub/Slack — No platform integrations included.
  • Library, not platform — You build the service layer yourself.

Relevance to xCoder

Rig is our primary reference for Rust agent framework design. If we build a Rust-native agent runtime (separate from our TypeScript driver), Rig provides the tool-calling and LLM abstraction layers. Its type-safe tool system is something we may emulate in our own Rust execution substrate. We consider Rig the "LangChain for Rust" and track its evolution closely.

Research note

Rig's approach to type-safe tool definitions (derive macros generating JSON schemas) is a pattern we want to replicate. We are evaluating whether to use Rig directly for our Rust worker layer or build a custom tool registry inspired by its design.