rig
Library Featured
An opinionated library for building LLM powered applications.
- Downloads
- 64,485
- Dependents
- 234
- Stars
- 9,096
- Forks
- 1,019
- Contributors
- 225
- Commits
- 1,750
- Latest release
- 0.46.0 ·
About
📑 Docs
•
🌐 Website
•
🤝 Contribute
•
✍🏽 Blogs
•
![]()
Rig is a Rust library for building LLM applications, and rig, a terminal
coding agent built on it that you extend with Bevy plugins.
The coding agent
cargo install rig-cli
rig
In the agent, /login signs in with a ChatGPT plan or saves a provider's API
key, or export the key (such as OPENAI_API_KEY) before starting. /model picks
one of the models those reach, and of a local Ollama or llama.cpp server once
OLLAMA_API_BASE_URL or LLAMACPP_API_BASE_URL names it (or its key is set);
/help lists the commands. rig -p "fix the failing test"
answers one prompt without the terminal view.
Read the full README
- Everything is a plugin. The agent is a Bevy app; its
tools, commands, sessions, sign-in and terminal view are each a plugin, turned
on or off in
settings.toml, so any of them can be removed, replaced or added to. - It rebuilds itself.
/reloadrebuilds the agent with your plugin crates and restarts it in the same session, and keeps the old build running if the new one does not compile. - Scriptable.
rig -p --jsonandrig --jsondrive it over pipes;rig help-agentsis the protocol. - More when you want it. Subagents are an optional plugin, and the tools work on remote hosts over ssh or any command.
The agent guide covers the keys, sessions, compaction, plugins and files, and the plugin guide shows how to write a tool, command or panel. The agent needs Rust 1.97.1 or newer and runs on Linux and macOS.
The library
cargo add rig
use rig::prelude::*;
use rig::providers::openai::{self, OpenAI};
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
// The client reads `OPENAI_API_KEY` and builds the models it serves.
let model = OpenAI::from_env()?.completion(openai::GPT_6_1_SOL);
let comedian = AgentBuilder::new(model)
.preamble("You are a comedian here to entertain the user using humour and jokes.")
.build();
let response = comedian.prompt("Entertain me!").await?;
println!("{}", response.output());
Ok(())
}
#[tokio::main] needs tokio's macros and rt-multi-thread features
(cargo add tokio --features macros,rt-multi-thread).
- 20+ model providers and 10+ vector stores, each under one interface
- Agents with tools, multi-turn streaming and typed hooks
- Completion, embedding, transcription, audio and image generation
- GenAI semantic conventions for OpenTelemetry
- Recording and replay of an agent's effects (
rig-cassette) - Browser WASM (
wasm32-unknown-unknown) for the core and the agent runtime (target support)
More in examples/, the docs and the
API reference.
rig-core no longer forces serde_json's preserve_order or
float_roundtrip features. Without them, JSON object keys sort by name,
including schema properties and JSON text embedded in prompts, embeddings
and tool results. Parsing floating-point numbers can change their low bits.
To restore the previous configuration, add this to your application's
Cargo.toml dependencies:
serde_json = { version = "1", features = ["preserve_order", "float_roundtrip"] }
Cargo unifies features across dependencies. rig-cassette with traffic
(and therefore rig-traffic) still enables both features. rig-claude-cloak,
rig-mcp-client and rig-mongodb through BSON still enable preserve_order. These are
application-level serde_json choices; Rig has no forwarding feature.
Crates
The rig crate re-exports the core and the agent runtime, and each companion
crate behind a feature.
| Crate | What it is |
|---|---|
rig-core | Provider-neutral messages, completion and embedding models, tool contracts, the conversation type, vector-store contracts, and the providers |
rig-agent | The agent builder, prompting and streaming, hooks, the tool registry and the serializable AgentRun |
rig-memory | Windows, compaction, and saving, resuming and forking conversations |
rig-cassette | Effect logs: recording, replay and checkpoints |
rig-tools | Coding tools any rig agent can use: read, write, edit, search, shell |
rig-ecs, rig-harness | The agent kernel on Bevy's ECS, and the harness the coding agent's plugins build on |
rig-tui, rig-basics | The terminal view, and the coding agent's default plugins |
rig-traffic | Opt-in provider HTTP recording in the session store, using the cassette engine |
rig-mcp-client | The coding agent's MCP client, off by default: MCP servers' tools, with an opt-in plugin that asks before a project's server starts |
rig-acp | rig acp, off by default: the coding agent for ACP clients (editors such as Zed) |
Integrations
rig = { version = "0.46.0", features = ["lancedb", "fastembed"] }
| Integration | Crate | Feature | Module path |
|---|---|---|---|
| AWS Bedrock | rig-bedrock | bedrock | rig::bedrock |
| AWS S3Vectors | rig-s3vectors | s3vectors | rig::s3vectors |
| Candle (local Llama/SmolLM2/Qwen3 tools, YOLOv8 pose) | rig-candle | candle | rig::candle |
| Cloudflare Vectorize | rig-vectorize | vectorize | rig::vectorize |
| FastEmbed | rig-fastembed | fastembed | rig::fastembed |
| Google Gemini gRPC | rig-gemini-grpc | gemini-grpc | rig::gemini_grpc |
| Google Vertex AI | rig-vertexai | vertexai | rig::vertexai |
| HelixDB | rig-helixdb | helixdb | rig::helixdb |
| LanceDB | rig-lancedb | lancedb | rig::lancedb |
| Conversations over time | rig-memory | memory | rig::memory |
| Milvus | rig-milvus | milvus | rig::milvus |
| MongoDB | rig-mongodb | mongodb | rig::mongodb |
| Neo4j | rig-neo4j | neo4j | rig::neo4j |
PostgreSQL (vector store; with memory, a session store) | rig-postgres | postgres | rig::postgres |
| Qdrant | rig-qdrant | qdrant | rig::qdrant |
| ScyllaDB | rig-scylladb | scylladb | rig::scylladb |
SQLite (vector store; with memory, a session store) | rig-sqlite | sqlite | rig::sqlite |
| SurrealDB | rig-surrealdb | surrealdb | rig::surrealdb |
| TypeSafe Jev (experimental judgments) | rig-typesafeai | typesafeai | rig::typesafeai |
Community
Projects built on Rig are listed in awesome-rig; open a pull request there to add yours. Questions and ideas are welcome on Discord, and CONTRIBUTING.md says how to contribute. Rig is MIT licensed.
[!WARNING] Rig is pre-1.0. Releases contain breaking changes; each release's changelog and migration notes say what changed and how to move.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- Optional
- Binds native code: libsqlite3-sys (feature sqlite), ring (feature surrealdb)
- Python bindings
- No Python binding crate found
- License
- MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
An opinionated library for building LLM powered applications. |
64,485 downloads over 30 days | 234 | 9,096 | 0.46.0 | GPU support unknown | Binds native code: libsqlite3-sys (feature sqlite), ring (feature surrealdb) | MIT |
|
rust-mcp-sdk Featured
An asynchronous SDK and framework for building MCP-Servers and MCP-Clients, leveraging the rust-mcp-schema for type safe MCP Schema Objects. |
29,764 downloads over 30 days | 51 | 199 | 2.0.0 | GPU support unknown | No native code found | MIT |
|
autoagents Listed
Agent Framework for Building Autonomous Agents |
8,627 downloads over 30 days | 4 | 779 | 0.4.0 | CUDA, WebGPU, Metal, ROCm, Vulkan | Binds native code: llama-cpp-sys-2, ort-sys, alsa-sys (feature audio-capture), intel-mkl-src (feature full), rquickjs-sys (feature codeact) | Apache-2.0 OR MIT |
|
rs-graph-llm Listed
A high-performance, type-safe framework for building multi-agent workflow systems in Rust |
5,308 downloads over 30 days | 8 | 388 | 0.8.1 | GPU support unknown | No native code found | MIT |
|
memvid Listed
Core library for Memvid v2, a crash-safe, deterministic, single-file AI memory. |
5,276 downloads over 30 days | 2 | 17,386 | 2.0.140 | CUDA, Metal | Binds native code: zstd-sys, link-cplusplus (feature llama-cpp), llama_cpp_sys (feature llama-cpp), ort-sys (feature logic_mesh) | Apache-2.0 |
|
rmcp-openapi Listed
Library for converting OpenAPI specifications to MCP tools |
4,330 downloads over 30 days | 2 | Not measured | 0.32.1 | GPU support unknown | No native code found | MIT |
|
An open protocol that gives AI agents a secure, sandboxed place to run code and use tools — with lean context usage. AXP works alongside MCP |
Not measured | Not applicable | 3 | Not measured | Not measured | Not measured | Apache-2.0 |
Why FeaturedIt passes every Featured gate.
What it meets
- It has 109 active dependents and 96 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
- Active dependents are at 100% of their peak. Featured needs at least 50%.
- Docs are present. The release commit or a manifest ties the crate to the repository.
- No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
- The last activity is on 9 Nov 2026, 0 days ago. The rules expect an update within 560 days. Dormancy rule
Exact rules: Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.46.0 base 140, doubled for 64485 downloads per month, doubled for 109 active users: E = 560 daysdormancy: last activity 2026-11-09, 0 days ago, E = 560: activefeatured: featured: active_users 109, new_adopters 96, former_glory 1
Crates23 crates
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption109 active dependents, 96 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 109 | crates.io database dump | Yes | |
| New dependents (365 days) | 96 | crates.io database dump | Yes | |
| Peak active dependents | 108 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: on the check date3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-11-09 | GitHub repository | Yes | |
| Latest release | 2026-10-31 | crates.io database dump | Yes | |
| First release | 2024-05-29 | crates.io database dump | Yes | |
| Latest version | 0.46.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 8 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 1 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution14 releases, 64,485 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 14 | crates.io database dump | Yes | |
| Downloads over 30 days | 64485 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository9,096 stars, 1,019 forks, 225 contributors, 1,750 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 9096 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 1019 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 225 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 1750 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | Binds native code: libsqlite3-sys (feature sqlite), ring (feature surrealdb) | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 234 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.