| Crates.io | agentai |
| lib.rs | agentai |
| version | 0.1.5 |
| created_at | 2024-12-27 12:05:37.001199+00 |
| updated_at | 2025-07-20 12:06:48.821614+00 |
| description | AgentAI is a Rust library designed to simplify the creation of AI agents. |
| homepage | |
| repository | https://github.com/AdamStrojek/rust-agentai |
| max_upload_size | |
| id | 1496353 |
| size | 137,306 |
AgentAI is a Rust library designed to simplify the creation of AI agents. It leverages the GenAI library to interface with a wide range of popular Large Language Models (LLMs), making it versatile and powerful. Written in Rust, AgentAI benefits from strong static typing and robust error handling, ensuring reliable and maintainable code. Whether you're developing simple or complex AI agents, AgentAI provides a streamlined and efficient development process.
This library is under heavy development. The interface may change at any time without notice.
ToolBox.ToolBox (version 0.1.5)This release introduces the ToolBox, a new feature providing an easy-to-use interface for supplying tools to AI agents.
We are continuously working to improve AgentAI. Here are some of the features planned for the near future:
To add the AgentAI crate to your project, run the following command in your project's root directory:
cargo add agentai
This command adds the crate and its dependencies to your project.
Available features for agentai crate.
To enable any of these features, you need to enter this command:
cargo add agentai -F mcp-client
Features list:
mcp-client (enabled by default) — Enables experimental support for Agent Tools based on MCP Serversmacros (enabled by default) — Enables support for macro #[toolbox]tools-buildin (enabled by default) — Enables support for buildin toolstools-web (enabled by default) — Enables support for web toolsHere is a basic example of how to create an AI agent using AgentAI:
use agentai::Agent;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut agent = Agent::new("You are a useful assistant");
let answer: String = agent.run("gpt-4o", "Why is the sky blue?", None).await?;
println!("Answer: {}", answer);
Ok(())
}
For more examples, check out the examples directory. To run an example, use the following command, replacing <example_name> with the name of the example file (without the .rs extension):
cargo run --example <example_name>
For instance, to run the simple example:
cargo run --example simple
Full documentation is available on docs.rs.
Contributions are welcome! Please see our CONTRIBUTING.md for more details.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the creators of the GenAI library for providing a robust framework for interfacing with various LLMs.