rig

Library Featured

An opinionated library for building LLM powered applications.

Checked · Sources

Downloads
64,485
Dependents
234
Stars
9,096
Forks
1,019
Contributors
225
Commits
1,750
Latest release
0.46.0 ·

About

From the project README ·

Rig logo

📑 Docs   •   🌐 Website   •   🤝 Contribute   •   ✍🏽 Blogs   •   Ryzome

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. /reload rebuilds 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 --json and rig --json drive it over pipes; rig help-agents is 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.

CrateWhat it is
rig-coreProvider-neutral messages, completion and embedding models, tool contracts, the conversation type, vector-store contracts, and the providers
rig-agentThe agent builder, prompting and streaming, hooks, the tool registry and the serializable AgentRun
rig-memoryWindows, compaction, and saving, resuming and forking conversations
rig-cassetteEffect logs: recording, replay and checkpoints
rig-toolsCoding tools any rig agent can use: read, write, edit, search, shell
rig-ecs, rig-harnessThe agent kernel on Bevy's ECS, and the harness the coding agent's plugins build on
rig-tui, rig-basicsThe terminal view, and the coding agent's default plugins
rig-trafficOpt-in provider HTTP recording in the session store, using the cassette engine
rig-mcp-clientThe 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-acprig acp, off by default: the coding agent for ACP clients (editors such as Zed)
Integrations
rig = { version = "0.46.0", features = ["lancedb", "fastembed"] }
IntegrationCrateFeatureModule path
AWS Bedrockrig-bedrockbedrockrig::bedrock
AWS S3Vectorsrig-s3vectorss3vectorsrig::s3vectors
Candle (local Llama/SmolLM2/Qwen3 tools, YOLOv8 pose)rig-candlecandlerig::candle
Cloudflare Vectorizerig-vectorizevectorizerig::vectorize
FastEmbedrig-fastembedfastembedrig::fastembed
Google Gemini gRPCrig-gemini-grpcgemini-grpcrig::gemini_grpc
Google Vertex AIrig-vertexaivertexairig::vertexai
HelixDBrig-helixdbhelixdbrig::helixdb
LanceDBrig-lancedblancedbrig::lancedb
Conversations over timerig-memorymemoryrig::memory
Milvusrig-milvusmilvusrig::milvus
MongoDBrig-mongodbmongodbrig::mongodb
Neo4jrig-neo4jneo4jrig::neo4j
PostgreSQL (vector store; with memory, a session store)rig-postgrespostgresrig::postgres
Qdrantrig-qdrantqdrantrig::qdrant
ScyllaDBrig-scylladbscylladbrig::scylladb
SQLite (vector store; with memory, a session store)rig-sqlitesqliterig::sqlite
SurrealDBrig-surrealdbsurrealdbrig::surrealdb
TypeSafe Jev (experimental judgments)rig-typesafeaitypesafeairig::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.

Build by Playgrounds

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.

rig beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
rig This page Featured

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

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

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
axp App Listed

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 days
  • dormancy: last activity 2026-11-09, 0 days ago, E = 560: active
  • featured: 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
Adoption109 active dependents, 96 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents109crates.io database dumpYes
New dependents (365 days)96crates.io database dumpYes
Peak active dependents108crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: on the check date3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-09GitHub repositoryYes
Latest release2026-10-31crates.io database dumpYes
First release2024-05-29crates.io database dumpYes
Latest version0.46.0crates.io database dumpYes
Days the oldest outside issue waits for a reply8GitHub repositoryYes
Maintainer replies over 365 days1GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution14 releases, 64,485 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases14crates.io database dumpYes
Downloads over 30 days64485crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository9,096 stars, 1,019 forks, 225 contributors, 1,750 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars9096GitHub repositoryYes — one part of the repository route
GitHub forks1019GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account225GitHub contributorsYes — one part of the repository route
Commits on the default branch1750GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: libsqlite3-sys (feature sqlite), ring (feature surrealdb)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly234crates.io database dumpNo

Corrections and review history

Report a correction

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.