Brief AI
›

Rust: Seven Tools for Developing AI Agents

AI Tools·Tom Levy·

Rust: Seven Tools for Developing AI Agents

Rust: Seven Tools for Developing AI Agents
Key Takeaways
1Rig supports over 20 model providers.
2rmcp is the official Rust kit for the MCP protocol to create clients and servers.
3Swiftide can suspend a process while waiting for human approval.
Why it matters : these tools enable building in Rust the connections, memory, and coordination necessary for agents, around a model API or a local model.

Seven Rust libraries and frameworks enable the development of AI agents, from connecting to models to cooperation among specialized agents. Rig notably supports over 20 model providers. The available functions also cover access to external services, document retrieval, and voice interactions.

AutoAgents and Anda Coordinate Multiple Agents

With AutoAgents, multiple agents can share a task rather than assigning it to a single program. This Rust framework organizes their communications through an actor system and offers configurable memory, tool calls, and various execution strategies. It also supports local model engines and tools based on WebAssembly.

One possible use case would be to distribute a software project among agents responsible for planning, programming, testing, and reviewing changes, allowing each to handle their part while coordinating with others.

Anda, on the other hand, combines tools, memory, and sub-agents. It controls the flow of tasks, the choice of models, the context used, and interactions between agents, with asynchronous execution. It also supports persistent memory extensions and reusable skills. A personal assistant could thus search for documents, delegate certain tasks, and retain useful information for future exchanges.

rmcp and Rig Connect Agents to Tools

The official rmcp kit provides the means to develop clients and servers for the Model Context Protocol, or MCP, in Rust. It can transform Rust functions into tools accessible to agents, connect to existing servers, and manage resources such as query instructions. Exchanges can occur through local processes or via HTTP.

A server could, for example, provide access to GitHub, files, or databases. The same tools can be used by other agents compatible with MCP, without additional integration specific to each. Anda also has MCP connections.

Rig, for its part, brings together connections to models, conversational management, continuously produced responses, and tool calls. Changing models requires minimal code modifications; custom tools and vector databases can be connected. The agent can select its tools, while Rig ensures their exchanges with the model. This combination could be used to explore the web, gather and analyze information before drafting a report.

The evening letterFree · 7 pm

The AI brief the pros read every evening

The 7 best AI stories, the essentials in 5 min. Free.

Included when you join: our pick of the best AI guides & comparisons.

Choose your rhythm

Free · No spam · Unsubscribe in 1 click

Swiftide and LangChain Rust Handle Documents

Swiftide targets complex processes and augmented generation through retrieval. Its features include a runtime environment for agents, task graphs, tool calls, and indexing chains. Independent tasks can run simultaneously; a process can also be paused for human validation and then resumed. A research agent could consult multiple sources in parallel, process their documents, and generate a common report.

LangChain Rust incorporates several concepts from LangChain for Python: agents, tools, chains, memory, and document retrieval. It specifically manages ReAct agents, where the model selects a tool, observes the result, and then determines the next steps. Integrations provide access to databases and vector stores. A support service could use it to consult internal documentation, retrieve past exchanges, and formulate a response based on these elements.

ADK-Rust Supports Voice Interactions

ADK-Rust brings together the construction and deployment of agents in a modular framework. It includes model integrations, tools, memory, and session management. Execution can follow a sequence, occur in parallel, or use loops.

It also offers real-time voice capabilities, observability, evaluation, and deployment tools. A voice assistant could combine these functions to interact with users, request external APIs, retrieve past conversations, and have multiple agents perform tasks.

Transitioning from Python to Rust and Getting Started with Rig

Python, long favored for developing AI applications, remains suitable for experimentation and prototyping. However, developers and companies are turning to Rust for production, where speed, memory consumption, security, and the ability to handle thousands of simultaneous requests are critical. Rust offers memory safety, efficient resource management, and concurrency support.

Building an agent in this language does not require executing the entire model part in Rust: the application can call a large language model API or use a local model.

The syntax bears similarities to C++, but a developer coming from Python must learn the rules of ownership and borrowing. Abid Ali Awan recommends that beginners in Rust and AI agents start with a simple project using Rig. Its documentation provides numerous examples and can also be handed off to a programming agent tasked with completing a project.

Brief AI — AI news in French

The essentials of artificial intelligence news, decoded and explained every day.