PandaAGI Architecture Overview

PandaAGI is a fully agentic execution ecosystem built for developers who want AI that does things, not just generates content. The system consists of three core components: the API, the SDK, and the execution environments.

Specialized Agent Orchestration

Tasks routed to dedicated general AI agents optimized for specific roles

Structured Parallelism

Tasks broken into subtasks that execute independently then merge

Resilience and Recovery

Automatic retries and reassignment for robust execution

Event-Driven Communication

Real-time events for monitoring and response
PandaAGI Architecture Diagram - Light ModePandaAGI Architecture Diagram - Dark Mode

PandaAGI Architecture Diagram

Separation of Concerns

AI Layer

Task understanding, planning, and orchestration of tool execution

Tool Layer

Specific operations in the local environment (file operations, API calls)

Application Layer

User experience and business logic development

The PandaAGI API

A bidirectional WebSocket API built for real-time, stateful interaction with your agents.
Unlike traditional REST APIs, the PandaAGI API keeps a live connection between your application and your agent—enabling:

Streaming Execution

Real-time updates as your agent works through tasks

Dynamic State Management

Persistent context and memory across interactions

Continuous Interaction

Send tasks, receive results, and monitor execution in-flight

Secure Communication

Encrypted connections with API key authentication

The PandaAGI SDK

We don’t believe developers should spend their time wiring sockets, managing agent state, or reinventing orchestration logic. The PandaAGI SDK exists to shift that burden away from you.
The SDK handles the complex infrastructure so you can focus on building powerful applications:
  • Sets up secure, persistent socket connections
  • Manages agent state across tasks
  • Tracks tools and context
  • Enables agents to reason, act, and adapt without manual glue code
The general AI agents generate real-time events in their own execution environment.

The Execution Environments

General AI agents that reason need a place to act. The execution environment is that space: a clean, isolated context where agents can safely operate.

Isolated & Secure

Each environment is ephemeral, containerized, and independent—created for a single user or session

Flexible Deployment

Run on the cloud, on your own hardware, or across both

Self-Contained

Execution is local to the agent—self-contained, inspectable, and secure

Full-Featured

Write and run code, store state, interact with external systems, and build mental models

Getting Started with PandaAGI

1

Install the SDK

# Using Poetry (recommended)
poetry add panda_agi

# Or with pip
pip install panda_agi
2

Set up your environment

# Set your API key
export PANDA_AGI_KEY="your-api-key"
3

Create your first agent

from panda_agi import Agent
from panda_agi.envs import LocalEnv
from panda_agi.handlers import LogsHandler

# Create a local environment
env = LocalEnv(base_path="./my_workspace")

# Initialize agent with the environment
agent = Agent(environment=env)

# Run the agent with event handlers
handlers = [LogsHandler(use_colors=True, show_timestamps=True)]
response = await agent.run("Build me a simple web app", event_handlers=handlers)
print(f"Web app creation completed: {response.output}")

Explore PandaAGI Components