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.
Agent
Defined in the agent module.
Rust AI Agent SDK
The core Agent struct Agents are the primary execution unit in PraisonAI. They combine: - LLM provider for generating responses - Tools for performing actions - Memory for conversation history - Instructions for behavior
Fields
Name Type Description idStringUnique agent ID nameStringAgent name instructionsStringSystem instructions llmArc<dyn LlmProvider>LLM provider toolsArc<RwLock<ToolRegistry>>Tool registry memoryArc<RwLock<Memory>>Memory configAgentConfigConfiguration
Methods
new
Create a new agent builder
simple
fn simple ( instructions : impl Into < String >) -> Result < Self >
Create an agent with minimal config
Parameters:
Name Type instructionsimpl Into<String>
Get the agent ID
name
Get the agent name
instructions
fn instructions ( & self ) -> & str
Get the instructions
model
Get the LLM model name
chat
async fn chat ( & self , prompt : & str ) -> Result < String >
Chat with the agent (main entry point) This is the primary method for interacting with an agent. It handles the full conversation loop including tool calls.
Parameters:
start
async fn start ( & self , prompt : & str ) -> Result < String >
Start a conversation (alias for chat)
Parameters:
run
async fn run ( & self , task : & str ) -> Result < String >
Run a task (alias for chat)
Parameters:
async fn add_tool ( & self , tool : impl Tool + ' static ) -> ()
Add a tool to the agent
Parameters:
Name Type toolimpl Tool + 'static
async fn tool_count ( & self ) -> usize
Get the number of tools
clear_memory
async fn clear_memory ( & self ) -> Result <()>
Clear conversation memory
history
async fn history ( & self ) -> Result < Vec < Message >>
Get conversation history
Source
View on GitHub praisonai/src/agent/mod.rs at line 39