Skip to main content
The 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 the db() 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 praisonai no longer requires OPENAI_API_KEY. The key is checked at OpenAI client creation, so Anthropic / Google users can require('praisonai') without it.
  • Default temperature: 0.7 is omitted for reasoning-family models (gpt-5*, o1*, o3*, o4*), which reject any temperature field. An explicit temperature still 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 for chat():

execute()

Execute without a new prompt (uses existing context):

Environment Variables

Examples

Research Agent

Code Assistant

AgentTeam

Multi-agent orchestration

AgentFlow

Step-based workflows

Tools

Custom tool development