AI agents · OpenClaw · self-hosting · automation

Quick Answer

Best AI Agent Frameworks for Rust in 2026: Rig, Swiftide

Published:

The short answer

Start with Rig for Rust agents, use Swiftide for retrieval-heavy pipelines, and add the official rmcp crate for MCP tools. As of November 28, 2026:

  • Rig: best overall agent and LLM application framework.
  • Swiftide: best for streaming indexing and RAG pipelines.
  • genai: best thin multi-provider client when you do not want a framework.
  • rmcp (official MCP Rust SDK): the standard way to speak MCP.
  • langchain-rust and AutoAgents: niche options for LangChain-style chains and multi-agent experiments.

Working in Go or .NET instead? See the best AI agent frameworks for Go and for .NET.

The comparison

LibraryRoleLicenseGitHub starsLatest release (Nov 28, 2026)Pick it for
Rig (rig-core)Agents, tools, embeddings, vector storesMIT~9,3000.47.1 (Nov 25, 2026)Most Rust agent apps
SwiftideIndexing, query and agent pipelinesMIT~8000.34.0 (Nov 6, 2026)RAG and streaming ingestion
genaiMulti-provider chat clientApache-2.0~9500.7.6 (Nov 28, 2026)One API over many providers
async-openaiOpenAI API clientMIT~2,0000.43.0 (Nov 1, 2026)OpenAI-compatible endpoints
rmcpOfficial MCP SDKsee repo~4,2003.12.0 (Nov 26, 2026)MCP servers and clients
langchain-rustLangChain-style chainsMIT~1,400v8.0.0 (Nov 3, 2026)Teams porting LangChain designs
AutoAgentsMulti-agent frameworkApache-2.0~8000.4.0 (Jul 8, 2026)Experiments; slower release pace

Stars and releases were read from GitHub and crates.io on November 28, 2026.

1. Rig: best overall

Rig describes itself as a library to “build modular and scalable LLM applications in Rust”. Its core idea is a set of traits (completion models, embedding models, vector stores, tools) with many provider implementations, so an agent written against Rig can switch from OpenAI to Anthropic or a local model by changing the client. Agents combine a model, a preamble, tools and optional dynamic context from a vector store. Releases are frequent (0.47.0 on November 20 and 0.47.1 on November 25, 2026), and it is by far the most downloaded crate in this group. It has not reached 1.0, so pin versions and read release notes.

2. Swiftide: best for retrieval pipelines

Swiftide focuses on fast, streaming indexing and query pipelines: load documents, chunk, enrich with an LLM, embed and store, then retrieve and answer, with agent support on top. Pick it when most of your work is getting data into a vector store reliably and quickly. For the retrieval side in general, see how to add a reranker to a RAG pipeline.

3. Thin clients: genai and async-openai

Many Rust services need nothing more than a typed client and a loop. genai (Apache-2.0) offers one interface over OpenAI, Anthropic, Gemini, Ollama, DeepSeek, OpenRouter and more. async-openai is the long-standing typed client for OpenAI’s API and works with any OpenAI-compatible endpoint. Write your own agent loop on top: send messages with tool definitions, run the tools the model requests, append results, repeat.

4. MCP: rmcp

The official Rust SDK for the Model Context Protocol, rmcp, lets a Rust program act as an MCP server (exposing tools and resources to Claude, ChatGPT, Cursor and other clients) or as a client calling other MCP servers. Version 3.12.0 shipped on November 26, 2026. A community alternative, rust-mcp-sdk, is smaller.

Local inference from Rust

For on-device or self-hosted models, mistral.rs runs quantized models with an OpenAI-compatible server, and candle is Hugging Face’s minimalist ML framework for Rust. See the best on-device LLM runtimes for how these compare with llama.cpp and MLX.

How to choose

  1. Agent with tools and retrieval → Rig.
  2. Ingestion and RAG at volume → Swiftide.
  3. One or two model calls in a service → genai or async-openai.
  4. Expose your service to AI assistants → rmcp.

Last verified: November 28, 2026.

Sources