This guide will help you get started with PandaAGI in two ways: using the ready-made chat interface for immediate results or integrating the SDK in your Python code for custom applications.
1

Get API Key

1. Visit https://agi.pandas-ai.com/ and sign in with GitHub 2. Access your dashboard to get your API key 3. Copy your API key for the next step
2

Launch Chat Interface

The fastest way to experience PandaAGI is through our ready-made chat interface:
# Clone the repository
git clone https://github.com/sinaptik-ai/panda-agi.git
cd panda-agi/examples/ui

# Set your API key
echo "PANDA_AGI_KEY=your-api-key-here" > ./backend/.env
echo "TAVILY_API_KEY=your-tavily-api-key-here" >> ./backend/.env
echo "WORKSPACE_PATH=./workspace" >> ./backend/.env

# Start the application
./start.sh
This launches a production-ready chat interface at http://localhost:3000
3

Start Chatting

PandaAGI Chat InterfaceTry these powerful prompts:
  • “Research the latest AI developments and create a summary report”
  • “Analyze this CSV data and create visualizations” (after uploading a file)
  • “Design a database schema for an e-commerce platform”

Working with the SDK

The PandaAGI SDK connects you to a pre-configured autonomous general AI agent with built-in capabilities for web browsing, file system access, and code execution. You simply submit tasks and receive results:

Quick introduction to use the SDK

Try it out yourself!

Open In Colab

Working with the Chat Interface (UI)

PandaAGI Chat Interface

PandaAGI Chat Interface

PandaAGI includes a production-ready chat interface that lets you interact with your AI agent without writing any code. This is perfect for:
  • Quickly demonstrating AI capabilities to stakeholders
  • Testing different prompts and use cases
  • Providing a polished UI for non-technical users
  • Learning how the agent thinks and uses tools

Features of the Chat UI

Real-time Streaming

See agent responses, thinking, and actions as they happen

File Upload

Upload files for the agent to analyze or process

Conversation History

Maintain context across multiple interactions

Mobile Responsive

Works seamlessly on desktop and mobile devices

Running the Chat Interface

Want to customize the chat interface? Check out the Chat Interface Guide for detailed documentation on how to extend and modify the UI.

Advanced Configuration

Custom Environment

You can configure your AI agent with different execution environments:
from panda_agi.envs import LocalEnv, DockerEnv

# Use local environment (limited capabilities but no Docker required)
local_env = LocalEnv("./workspace")

# Use Docker environment (full capabilities, requires Docker)
docker_env = DockerEnv("./workspace")

agent = Agent(environment=docker_env)

Conversation Management

Manage conversation state for multi-turn interactions:
from panda_agi.handlers import LogsHandler
from panda_agi.envs import DockerEnv

# Create event handler
handlers = [LogsHandler(use_colors=True, show_timestamps=True)]

# Create agent with conversation ID for persistence
agent = Agent(
    environment=DockerEnv("./workspace"),
    conversation_id="unique-conversation-id",
    event_handlers=handlers
)

# First interaction
response1 = await agent.run("Find information about electric vehicles")
print(f"First task completed: {response1.output}")

# Later interaction (continues the same conversation)
response2 = await agent.run("Now compare the top 3 models")
print(f"Second task completed: {response2.output}")

Accessing Agent Attachments

The AgentResponse object provides access to files created or referenced by the agent:
from panda_agi import Agent
from panda_agi.envs import DockerEnv

async def handle_attachments():
    agent = Agent(environment=DockerEnv("./workspace"))
    
    response = await agent.run("Create a Python script that generates a CSV report")
    
    # Access the final output message
    print(f"Agent response: {response.output}")
    
    # Access any files created by the agent
    if response.attachments:
        print(f"Agent created {len(response.attachments)} file(s):")
        for file_path in response.attachments:
            print(f"  📄 {file_path}")
            
            # You can now read or process these files
            with open(file_path, 'r') as f:
                content = f.read()
                print(f"File size: {len(content)} characters")
    else:
        print("No files were created by the agent")
    
    await agent.disconnect()

Event Handling

Filter and process specific event types for custom UIs:
from panda_agi import BaseHandler, EventType
from panda_agi.client.models import BaseStreamEvent

class CustomEventHandler(BaseHandler):
    def process(self, event: BaseStreamEvent) -> None:
        if event.type == EventType.THINKING:
            print(f"Agent is thinking: {event.data}")
        elif event.type == EventType.ACTION:
            print(f"Agent is taking action: {event.data}")
        elif event.type == EventType.RESULT:
            print(f"Agent produced result: {event.data}")

# Use custom handler
handler = CustomEventHandler("CustomUI")
response = await agent.run("Create a data visualization", event_handlers=[handler])

Next Steps

Now that you’re up and running with PandaAGI, explore these resources to learn more: