Agent
TheAgent class is the primary entry point for PraisonAI TypeScript SDK. It provides a simple, unified API for creating AI agents with instructions, tools, and optional persistence.
Quickstart
Installation
Basic Usage
Simple Agent
Agent with Custom Name
Agent with Model Selection
Agent with Tools
Pass plain JavaScript functions as tools - schemas are auto-generated:Multiple Tools
Agent with Persistence
Use thedb() factory for easy database setup:
Database URL Formats
Agent Configuration
Full Configuration Options
Advanced Mode (Role/Goal/Backstory)
For more structured agent definitions:Session Management
Methods
chat(prompt: string)
Send a message and get a response:start(prompt: string)
Alias forchat():
execute()
Execute without a new prompt (uses existing context):Environment Variables
Examples
Research Agent
Code Assistant
See Also
- Agents (Multi-Agent) - Orchestrate multiple agents
- Workflow - Step-based workflows
- Tools - Custom tool development
- Database - Persistence options

