| Crates.io | acai |
| lib.rs | acai |
| version | 0.2.0 |
| created_at | 2024-11-05 14:50:21.936934+00 |
| updated_at | 2025-05-17 03:38:06.382272+00 |
| description | Implementation of the Agent2Agent (A2A) protocol |
| homepage | |
| repository | https://github.com/rescrv/acai |
| max_upload_size | |
| id | 1436640 |
| size | 601,234 |
acai is a robust Rust framework for building and integrating with AI agent services. It provides a seamless interface for agent-to-agent communication, enabling the creation of sophisticated AI systems that can interact with each other and with external services. acai implements a JSON-RPC based protocol that makes it easy to build agents that can handle complex tasks, streaming responses, and asynchronous workflows.
acai excels at enabling reliable communication between different AI agents. Its protocol is designed to support complex interactions while maintaining a clean separation of concerns:
The server-side components of acai are built to handle the complexities of agent services:
acai includes a fully-featured client that simplifies interaction with agent services:
acai is designed to support a variety of agent interaction patterns:
Setting up a basic acai server is straightforward:
use acai::{server, AgentServer};
// Create a server with default configuration
let server = AgentServer::new();
// Register handlers for various endpoints
server.register_handler("example/method", example_handler);
// Start the server
server.start("127.0.0.1:8000").await?;
Connecting to an acai service is equally simple:
use acai::{Client, ClientConfig};
// Create a client with the target URL
let client = Client::new(ClientConfig::new("https://example.com/agent"));
// Send a task and get a response
let response = client.send("example_task_id", message).await?;
// Or subscribe to streaming updates
let mut stream = client.stream("example_task_id").await?;
while let Some(update) = stream.next().await {
// Process the update
}
acai is built around a few core concepts:
The architecture separates concerns between client and server components while keeping the communication protocol clear and extensible.
acai is under active development. While the core functionality is stable, new features are being added regularly to enhance its capabilities. The API is subject to change as we refine the framework based on real-world usage and feedback.
Notably absent is any notion of persistence.
Contributions to acai are welcome! Please feel free to submit issues and pull requests. When contributing code:
cargo clippy and cargo fmt before submittingApache 2.0. All contributions must retain this license.
Comprehensive API documentation is available at docs.rs.
For examples and more detailed usage information, check the examples/ directory in the
repository.