<!-- source: https://deepwiki.com/MervinPraison/PraisonAI/12-development-sdks -->

# Development SDKs

- README.md
- api.md
- src/praisonai/README.md

This document provides an overview of the Python and TypeScript/JavaScript Software Development Kits (SDKs) for PraisonAI. It covers installation, basic usage patterns, and the API surface for programmatic agent development.

For detailed API documentation of individual classes and methods, see [Python API Reference](/MervinPraison/PraisonAI/12.1-python-api-reference). For JavaScript-specific usage, see [TypeScript/JavaScript SDK](/MervinPraison/PraisonAI/12.2-typescriptjavascript-sdk). For CLI-based usage without coding, see [CLI Interface](/MervinPraison/PraisonAI/7.1-cli-interface). For framework-level architecture, see [Architecture Overview](/MervinPraison/PraisonAI/1.1-architecture-overview).

## SDK Architecture Overview

```

```

**Package Distribution Model**

PraisonAI provides two distinct Python packages:

The `praisonai` package depends on `praisonaiagents`, so installing `praisonai` gives you both the CLI and the full SDK.

Sources: [README.md172-186](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L172-L186) [src/praisonai/README.md172-186](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/README.md?plain=1#L172-L186)

## Installation

### Python SDK

**Core SDK Only:**

```

```

**Full Framework with CLI:**

```

```

**Optional Feature Groups:**

```

```

### JavaScript SDK

```

```

### Environment Configuration

At least one LLM provider API key is required:

```

```

Sources: [README.md172-216](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L172-L216) [src/praisonai/README.md172-216](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/README.md?plain=1#L172-L216)

## Python SDK Quick Start

### Minimal Example - Single Agent

```

```

The `Agent` class [src/praisonai-agents/praisonaiagents/agent/agent.py1-2000](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/agent/agent.py#L1-L2000) is the core building block. Key parameters:

- instructions (or role , goal , backstory ) - Agent's persona and behavior
- tools - List of functions, BaseTool instances, or MCP servers
- model - LLM model identifier (default: gpt-4o )
- memory - Enable persistent memory (bool or config)
- knowledge - Add knowledge sources (list of paths)

### Multi-Agent Coordination

```

```

The `Agents` class [src/praisonai-agents/praisonaiagents/agents/agents.py1-500](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/agents/agents.py#L1-L500) (alias: `AgentTeam`) orchestrates multi-agent workflows with sequential, parallel, or hierarchical execution.

Sources: [README.md522-551](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L522-L551) [api.md22-169](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L22-L169)

## Agent Creation Patterns

```

```

### Specialized Agent Types

**DeepResearchAgent** - Multi-provider deep research with citations:

```

```

**QueryRewriterAgent** - RAG query optimization:

```

```

**ImageAgent** - Image generation and editing:

```

```

Sources: [api.md24-169](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L24-L169) [README.md580-651](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L580-L651)

## Core API Components

```

```

### Agent Class Key Methods

### Task Class Key Attributes

Sources: [api.md29-92](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L29-L92) [api.md214-222](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L214-L222)

## Tools and Extensions

```

```

### Custom Tool Definition

**Function-based:**

```

```

**Class-based:**

```

```

### MCP Tool Integration

```

```

The `MCP` class [src/praisonai-agents/praisonaiagents/mcp/mcp.py1-500](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/mcp/mcp.py#L1-L500) wraps MCP servers and exposes their tools as callable Python functions.

Sources: [api.md172-203](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L172-L203) [README.md1407-1450](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1407-L1450)

## Memory and Knowledge Systems

```

```

### Memory Configuration

```

```

### Knowledge Base Integration

```

```

### RAG Pipeline

```

```

Sources: [api.md236-272](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L236-L272) [api.md274-342](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L274-L342) [README.md653-708](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L653-L708)

## Workflow Orchestration

```

```

### Sequential Workflow

```

```

### Parallel Execution

```

```

### Routing Pattern

```

```

### Loop Pattern

```

```

### Evaluator-Optimizer Pattern

```

```

Sources: [README.md774-876](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L774-L876) [api.md206-226](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L206-L226)

## JavaScript/TypeScript SDK

```

```

### Basic Usage

```

```

### Multi-Agent Example

```

```

### Custom Tools

```

```

**Note:** The JavaScript SDK is less feature-complete than the Python SDK. For advanced features like memory, knowledge, and RAG, use the Python SDK or call the Python API via HTTP.

Sources: [README.md188-192](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L188-L192) [src/praisonai/README.md188-192](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/README.md?plain=1#L188-L192)

## API Surface Summary

### Core Classes

### Specialized Agents

### Tool System

### Workflow Patterns

### Configuration

For detailed method signatures and parameters, see [Python API Reference](/MervinPraison/PraisonAI/12.1-python-api-reference).

Sources: [api.md1-600](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L1-L600)

## Package Structure and Lazy Loading

```

```

The `praisonaiagents` package uses lazy loading [src/praisonai-agents/praisonaiagents/_lazy.py1-200](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/_lazy.py#L1-L200) to minimize startup time. Modules are imported on-demand using `__getattr__` in `__init__.py`. This reduces initial import time from ~420ms to ~20ms in silent mode.

**Key Performance Characteristics:**

**Lazy Loading Implementation:**

```

```

This allows importing specific classes without loading the entire framework:

```

```

Sources: [README.md128-150](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L128-L150) Diagram 5 in initial context

## Advanced Features

### Handoff System

```

```

### Planning Mode

```

```

### Autonomous Execution

```

```

### Run Until Criteria Met

```

```

### Guardrails

```

```

### Session Management

```

```

Sources: [api.md344-364](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L344-L364) [api.md378-454](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L378-L454) [api.md489-513](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L489-L513)

## Performance Considerations

### Benchmarks

PraisonAI Agents is optimized for fast agent instantiation:

**Optimization Techniques:**

1. Lazy Loading - Modules imported on-demand via __getattr__ src/praisonai-agents/praisonaiagents/_lazy.py 1-200
2. Optional Dependencies - Feature groups reduce install size and import time
3. Module Caching - _lazy_cache prevents repeated imports
4. Zero Overhead - Features like memory and knowledge only load when used

### Best Practices

**For Minimal Latency:**

```

```

**For Full Features:**

```

```

**Async for Concurrency:**

```

```

Sources: [README.md128-150](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L128-L150) Diagram 5 in initial context

## Error Handling and Debugging

### Common Patterns

```

```

### Verbose Mode

```

```

### Telemetry

```

```

### Tool Execution Tracing

```

```

Sources: [api.md366-376](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L366-L376) [api.md530-542](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L530-L542)

## API Server Mode

Agents can be launched as HTTP APIs using FastAPI:

```

```

**Endpoints Created:**

- POST /agent - Execute agent with prompt
- GET /agent/health - Health check
- GET /agent/tools - List available tools

**MCP Server Mode:**

```

```

**A2A Server Mode:**

```

```

Sources: [api.md69](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/api.md?plain=1#L69-L69) [README.md1484-1523](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1484-L1523)

## Migration Guide

### From Other Frameworks

**From LangChain:**

```

```

**From CrewAI:**

```

```

**From AutoGen:**

```

```

### Version Compatibility

- Python 3.8+ required
- Node.js 16+ for JavaScript SDK
- Optional dependencies loaded on demand

Sources: README.md examples throughout

## Code Examples by Use Case

### Simple Q&A Agent

```

```

### Agent with Web Search

```

```

### Multi-Agent Research Pipeline

```

```

### Workflow with Routing

```

```

### Agent with Memory

```

```

### RAG Agent

```

```

### Image Generation Agent

```

```

Sources: [README.md522-876](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L522-L876)
