| Crates.io | axonerai |
| lib.rs | axonerai |
| version | 0.1.1 |
| created_at | 2025-11-23 03:20:32.8908+00 |
| updated_at | 2025-11-23 03:43:53.188583+00 |
| description | A type-safe, blazing fast agentic AI framework in Rust |
| homepage | |
| repository | https://github.com/Manojython/axonerai |
| max_upload_size | |
| id | 1946076 |
| size | 95,649 |
A type-safe, high-performance agentic AI framework in Rust.
Why AxonerAI?
Add to your Cargo.toml:
[dependencies]
axonerai = "0.1"
tokio = { version = "1", features = ["full"] }
uuid = { version = "1", features = ["v4"] }
use axonerai::agent::Agent;
use axonerai::groq::GroqProvider;
use axonerai::tool::ToolRegistry;
use axonerai::tools::{Calculator, WebSearch};
use axonerai::file_session_manager::FileSessionManager;
use std::path::PathBuf;
use std::time::Instant;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// 1. Create a provider
let provider = GroqProvider::new(
std::env::var("GROQ_API_KEY")?
);
// 2. Register tools
let mut registry = ToolRegistry::new();
registry.register(Box::new(Calculator));
registry.register(Box::new(WebSearch::new()));
// 3. Create session manager (optional - pass None for stateless)
let session_manager = FileSessionManager::new(
uuid::Uuid::new_v4().to_string(),
PathBuf::from("./sessions"),
)?;
// 4. Create agent
let system_prompt = "You are a helpful assistant. You have several tools at your disposal. \
Do not give information without proper usage of tools.".to_string();
let agent = Agent::new(
Box::new(provider),
registry,
Some(system_prompt),
Some(session_manager), // Or None for stateless
);
// 5. Interactive loop
let mut input = String::new();
println!("🤖 Agent starting... (type 'quit' to exit)");
loop {
println!("\nYou 🦁: ");
println!("---------------");
std::io::stdin().read_line(&mut input).expect("Failed to read line");
if input.trim().to_lowercase() == "quit" || input.trim().to_lowercase() == "exit" {
println!("Bye! 👋");
break;
}
let start_time = Instant::now();
let response = agent.run(input.trim()).await?;
let elapsed = start_time.elapsed();
println!("----------------------------------------");
println!("{}", response);
println!("Time taken: {:?}", elapsed);
input.clear();
}
Ok(())
}
The Framework is currently hardcoded to use :
openai/gpt-oss-20bgpt-5-miniFeel free to modify this in the respective files in the src crate
| Provider | Model Examples |
|---|---|
| Groq | openai/gpt-oss-20b(currently hardcoded, but can be changed to llama-3.3-70b-versatile or something else,) |
| Anthropic | claude-sonnet-4-20250514, claude-3-haiku-20240307 |
| OpenAI | gpt-5-mini (currently hardcoded), gpt-4o-mini |
// Groq (free tier available!)
use axonerai::groq::GroqProvider;
let provider = GroqProvider::new(api_key, "llama-3.3-70b-versatile".to_string());
// Anthropic
use axonerai::anthropic::AnthropicProvider;
let provider = AnthropicProvider::new(api_key, "claude-sonnet-4-20250514".to_string());
// OpenAI
use axonerai::openai::OpenAIProvider;
let provider = OpenAIProvider::new(api_key, "gpt-4o".to_string());
use axonerai::tool::{Tool, ToolResult};
use serde_json::{json, Value};
use anyhow::Result;
pub struct MyTool;
impl Tool for MyTool {
fn name(&self) -> String {
"my_tool".to_string()
}
fn description(&self) -> String {
"Does something useful".to_string()
}
fn input_schema(&self) -> Value {
json!({
"type": "object",
"properties": {
"input": {
"type": "string",
"description": "The input to process"
}
},
"required": ["input"]
})
}
fn execute(&self, input: Value) -> Result<String> {
let input_str = input["input"].as_str().unwrap_or("");
Ok(format!("Processed: {}", input_str))
}
}
Register it:
use axonerai::tool::ToolRegistry;
let mut registry = ToolRegistry::new();
registry.register(Box::new(MyTool));
# Required for your chosen provider
GROQ_API_KEY=your_groq_key
ANTHROPIC_API_KEY=your_anthropic_key
OPENAI_API_KEY=your_openai_key
# For WebSearch tool
GOOGLE_API_KEY=your_google_key
GOOGLE_CX=your_search_engine_id
| Feature | AxonerAI | LangChain |
|---|---|---|
| Language | Rust | Python |
| Type Safety | Compile-time | Runtime |
| Performance | Fast | Slow |
| Learning Curve | Moderate | Easy |
Important: AxonerAI provides tools for web search and web scraping. Users are responsible for ensuring their use complies with applicable laws, terms of service, and ethical guidelines.
WebSearch Tool:
WebScraper Tool:
robots.txt directivesWhen using AxonerAI with LLM providers, you must comply with their respective terms:
By using AxonerAI, you agree that:
MIT
Contributions welcome! Please open an issue or PR on GitHub.