TypeScript SDK

PraisonAI TypeScript SDK – Complete AI Agent Framework

PraisonAI TypeScript SDK

The PraisonAI TypeScript SDK provides a complete framework for building AI agents, workflows, and applications.

Installation

bash
npm install praisonai
# or
pnpm add praisonai

Supports both ESM (import) and CommonJS (require). See Packaging & Bundlers for bundler and React Native setup.

Quick Start

typescript
import { Agent, createAgent } from 'praisonai';

// Create a simple agent
const agent = createAgent({
  name: 'Assistant',
  instructions: 'You are a helpful assistant.',
  llm: 'openai/gpt-4o-mini'
});

// Chat with the agent
const response = await agent.chat('Hello!');
console.log(response.text);

Features

Core Features

  • Agents – Create and manage AI agents
  • Workflows – Multi-agent orchestration
  • Tools – Extend agent capabilities
  • Memory – Persistent conversation memory
  • Sessions – Conversation management

Specialized Agents

Advanced Features

Integrations

CLI

The SDK includes a full CLI. See TypeScript CLI Reference.

bash
# Install globally
npm install -g praisonai

# Use the CLI
praisonai-ts chat "Hello!"
praisonai-ts auto "Build a web scraper"
praisonai-ts research "AI trends 2024"

LLM Providers

typescript
import { createProvider, getAvailableProviders } from 'praisonai';

// List available providers
const providers = getAvailableProviders();

// Create a provider
const openai = createProvider('openai/gpt-4o-mini');
const anthropic = createProvider('anthropic/claude-3-sonnet');
const google = createProvider('google/gemini-pro');

Environment Variables

bash
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...
PRAISONAI_MODEL=openai/gpt-4o-mini