Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Build your first AI agent in under 5 minutes.
Your First Agent
Create the Project
cargo new my-agent
cd my-agent
Add Dependencies
# Cargo.toml
[dependencies]
praisonai = "0.1"
tokio = { version = "1", features = ["full"] }
Set API Key
export OPENAI_API_KEY="your-key"
Write the Code
// src/main.rs
use praisonai::Agent;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let agent = Agent::new()
.name("Assistant")
.instructions("You are a helpful assistant")
.build()?;
let response = agent.chat("What is Rust?").await?;
println!("{}", response);
Ok(())
}
Run It
Output:Rust is a systems programming language focused on safety,
concurrency, and performance...
Give your agent abilities with tools:
use praisonai::{Agent, tool};
#[tool]
fn get_weather(city: String) -> String {
format!("Weather in {}: Sunny, 72°F", city)
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let agent = Agent::new()
.name("Weather Bot")
.instructions("Help with weather queries")
.tool(get_weather)
.build()?;
agent.chat("What's the weather in Tokyo?").await?;
// Agent calls get_weather("Tokyo") automatically
Ok(())
}
What’s Next?
Agent Configuration
Customize your agent
Memory
Enable conversation memory
Agent Teams
Multiple agents working together