Agent class is the primary entry point for the PraisonAI TypeScript SDK — instructions, tools, and optional persistence in one API.
Quick Start
1
Simple Usage
2
Install
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
Structured Output Options
See Structured Output for the full guide.
Behaviour notes (v1.7.4)
- Importing
praisonaino longer requiresOPENAI_API_KEY. The key is checked at OpenAI client creation, so Anthropic / Google users canrequire('praisonai')without it. - Default
temperature: 0.7is omitted for reasoning-family models (gpt-5*,o1*,o3*,o4*), which reject anytemperaturefield. An explicittemperaturestill takes effect. Agent.chat()no longer double-appends the user prompt to history. This is a bugfix — no code change needed.
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
Related
AgentTeam
Multi-agent orchestration
AgentFlow
Step-based workflows
Tools
Custom tool development

