---
title: 'Quickstart'
description: 'Get up and running with PandaAGI SDK in under 5 minutes'
---

## Installation

Get started by installing the PandaAGI SDK using pip:

<CodeGroup>

```bash pip
pip install panda-agi
```

```bash poetry
poetry add panda-agi
```

```bash conda
conda install -c conda-forge panda-agi
```

</CodeGroup>

## What the Agent Can Do

The autonomous agent comes pre-equipped with powerful capabilities:

<CardGroup cols={2}>
  <Card
    title="Web Research"
    icon="globe"
  >
    Search, browse, and extract information from websites automatically
  </Card>
  <Card
    title="File Operations"
    icon="folder"
  >
    Create, read, modify, and organize files in your workspace
  </Card>
  <Card
    title="Data Analysis"
    icon="chart-line"
  >
    Process and analyze data, create visualizations and reports
  </Card>
  <Card
    title="Content Creation"
    icon="pen-tool"
  >
    Generate documents, code, presentations, and structured content
  </Card>
</CardGroup>

## Your First Interaction

The PandaAGI SDK connects you to a pre-configured autonomous agent that already has access to web browsing and file system tools. You simply submit tasks and receive results:

<CodeGroup>

```python Deep Research
import asyncio
from panda_agi.client import Agent
from panda_agi.envs import DockerEnv

async def main():
    # Create environment for the agent to work in
    agent_env = DockerEnv("./workspace")
    agent = Agent(environment=agent_env)
    
    # Submit a task and stream results
    async for event in agent.run(
        "Research the latest AI developments and create a summary report",
    ):
        # The agent will:
        # 1. Search multiple sources for recent AI news and developments
        # 2. Analyze and synthesize information from various websites
        # 3. Create a structured report with key findings
        # 4. Save the report as a markdown file in your workspace
        # 5. Include citations and sources for all information

        print(f"[{event.timestamp}] {event.type}: {event.data}")

    
    await agent.disconnect()

if __name__ == "__main__":
    asyncio.run(main())
```

```python Data Analysis
import asyncio
from panda_agi.client import Agent
from panda_agi.envs import LocalEnv

async def main():
    # Use local environment for file operations
    agent_env = LocalEnv("./my_workspace")
    agent = Agent(environment=agent_env)
    
    # Agent can read, write, and analyze files
    async for event in agent.run(
        "Analyze the data in sales.csv and create a visualization report"
    ):
        # The agent will:
        # 1. Read and parse the sales.csv file
        # 2. Perform statistical analysis on the data
        # 3. Identify trends, patterns, and insights
        # 4. Generate charts and visualizations
        # 5. Create an HTML report with interactive graphs
        # 6. Provide actionable recommendations based on findings

        print(f"[{event.timestamp}] {event.type}: {event.data}")

    await agent.disconnect()

asyncio.run(main())
```

</CodeGroup>

## Example Tasks

Here are some tasks you can submit to the agent:

### Research & Analysis
```python
# Market research
"Research the electric vehicle market and create a comprehensive report"
# → 50-page report with market size, key players, trends, forecasts, and investment opportunities

# Competitive analysis  
"Analyze the top 3 project management tools and compare their features"
# → Feature comparison matrix, pricing analysis, user reviews summary, and recommendations

# Technical research
"Research best practices for API security and create implementation guidelines"
# → Technical documentation with code examples, security checklist, and implementation roadmap
```

### Content & Documentation
```python
# Documentation
"Create user documentation for our REST API with examples"
# → Complete API docs with endpoint descriptions, request/response examples, and SDKs

# Business content
"Draft a business proposal for implementing AI in customer service"
# → Professional proposal with ROI analysis, implementation timeline, and budget breakdown

# Technical content
"Write a technical blog post about microservices architecture"
# → 3000-word article with diagrams, code examples, and best practices
```

### Data & Development
```python
# Data analysis
"Analyze our sales data and identify trends and opportunities"
# → Interactive dashboard, trend analysis, forecasting models, and actionable insights

# Code generation
"Create a Python script to automate our daily reporting process"
# → Complete Python application with error handling, logging, and documentation

# System design
"Design a database schema for an e-commerce platform"
# → ER diagrams, SQL scripts, data flow documentation, and scalability considerations
```

## Real-time Event Streaming

Monitor your agent's progress in real-time as it works through complex tasks. Events are streamed asynchronously from the remote agent as they occur, providing detailed insight into the agent's workflow:

```python
import asyncio
from panda_agi.client import Agent
from panda_agi.envs import DockerEnv

async def main():
    agent_env = DockerEnv("./workspace")
    agent = Agent(environment=agent_env)
    
    # Stream events to see what the agent is doing in real-time
    async for event in agent.run(
        "Research the latest AI developments and create a summary report"
    ):
        # Events are generated asynchronously by the remote agent
        # You'll see the actual workflow unfold step by step:
        print(f"[{event.timestamp}] {event.type}: {event.data}")
    
    await agent.disconnect()

asyncio.run(main())
```

### Real Event Stream Example

Here's what you'll actually see when running the above code - events stream live as the agent works:

```bash
# Agent connects and initializes workspace
[2025-05-29T00:20:46.066499] EventType.AGENT_CONNECTION_SUCCESS: {
    'file_system': {
        'directory': '/workspace/my_agent_workspace', 
        'structure': {'my_agent_workspace/': {}}
    }
}

# Agent begins web research
[2025-05-29T00:20:55.196858] EventType.WEB_SEARCH: {
    'query': 'latest developments in artificial intelligence 2024', 
    'max_results': 8
}

# Search results come back
[2025-05-29T00:20:58.018191] EventType.WEB_SEARCH_RESULT: [
    {
        'url': 'https://www.analyticsinsight.net/artificial-intelligence/top-ai-developments-we-saw-in-2024', 
        'title': 'Top AI developments We Saw in 2024 - Analytics Insight'
    },
    {'url': 'https://blog.google/technology/ai/2024-ai-extraordinary-progress-advancement/', 
     'title': "Year in review: Google's biggest AI advancements of 2024"
    }
    # ... more results
]

# Agent navigates to specific pages
[2025-05-29T00:21:06.297879] EventType.WEB_NAVIGATION: {
    'url': 'https://www.analyticsinsight.net/artificial-intelligence/top-ai-developments-we-saw-in-2024'
}

[2025-05-29T00:21:06.874471] EventType.WEB_NAVIGATION_RESULT: {
    'url': 'https://www.analyticsinsight.net/artificial-intelligence/top-ai-developments-we-saw-in-2024', 
    'content': 'Top AI developments We Saw in 2024...', 
    'status_code': 200
}

# Agent creates files with research findings
[2025-05-29T00:21:46.050300] EventType.FILE_WRITE: {
    'file': 'ai_developments_2024_report_todo.md', 
    'content': '# AI Developments 2024 Report: To-Do List\n\n## 1. Introduction...',
    'append': False
}

# Agent generates data and visualizations
[2025-05-29T00:24:12.290811] EventType.SHELL_EXEC: {
    'id': 'ai_chart', 
    'exec_dir': './', 
    'command': 'python3 generate_ai_adoption_chart.py', 
    'blocking': 'true'
}

# Agent provides updates to user
[2025-05-29T00:25:09.611663] EventType.USER_NOTIFICATION: {
    'text': 'The AI Developments 2024 summary report is complete...',
    'attachments': [
        'ai_developments_2024_report.md', 
        'ai_adoption_by_industry_2024.png',
        'ai_investment_by_sector_2024.png'
    ]
}

# Task completion
[2025-05-29T00:27:10.305395] EventType.COMPLETED_TASK: {}
```

### Key Event Streaming Features

<CardGroup cols={2}>
  <Card
    title="Live Progress Tracking"
    icon="activity"
  >
    Watch each step as the agent searches, analyzes, creates files, and runs commands
  </Card>
  <Card
    title="Asynchronous Generation"
    icon="clock"
  >
    Events stream in real-time from the remote agent - no polling needed
  </Card>
  <Card
    title="Detailed Workflow Insight"
    icon="eye"
  >
    See exactly what tools the agent uses and how it approaches complex tasks
  </Card>
  <Card
    title="Rich Event Data"
    icon="database"
  >
    Each event contains structured data about the agent's actions and results
  </Card>
</CardGroup>

### Event-Driven UI Updates

Build responsive interfaces that update as the agent works:

```python
import asyncio
from panda_agi.client import Agent
from panda_agi.envs import DockerEnv

class AgentMonitor:
    def __init__(self):
        self.status = "Idle"
        self.current_task = None
        self.files_created = []
        self.search_queries = []
    
    async def run_with_monitoring(self, query):
        agent_env = DockerEnv("./workspace")
        agent = Agent(environment=agent_env)
        
        try:
            async for event in agent.run(query):
                await self.handle_event(event)
        finally:
            await agent.disconnect()
    
    async def handle_event(self, event):
        """Process events as they stream from the remote agent"""
        
        if event.type == "AGENT_CONNECTION_SUCCESS":
            self.status = "Connected - Workspace initialized"
            print(f"🔗 {self.status}")
        
        elif event.type == "WEB_SEARCH":
            query = event.data.get('query', '')
            self.search_queries.append(query)
            self.status = f"🔍 Searching: {query}"
            print(f"🔍 Web search: {query}")
        
        elif event.type == "WEB_NAVIGATION":
            url = event.data.get('url', '')
            self.status = f"🌐 Reading: {url}"
            print(f"🌐 Navigating to: {url}")
        
        elif event.type == "FILE_WRITE":
            filename = event.data.get('file', '')
            self.files_created.append(filename)
            self.status = f"📝 Created: {filename}"
            print(f"📝 File created: {filename}")
        
        elif event.type == "SHELL_EXEC":
            command = event.data.get('command', '')
            self.status = f"⚙️ Running: {command}"
            print(f"⚙️ Executing: {command}")
        
        elif event.type == "USER_NOTIFICATION":
            message = event.data.get('text', '')
            attachments = event.data.get('attachments', [])
            self.status = "✅ Task update available"
            print(f"📢 Update: {message}")
            if attachments:
                print(f"📎 Files: {', '.join(attachments)}")
        
        elif event.type == "COMPLETED_TASK":
            self.status = "✅ Task completed"
            print(f"🎉 Task completed!")
            print(f"📊 Summary:")
            print(f"  - Files created: {len(self.files_created)}")
            print(f"  - Web searches: {len(self.search_queries)}")

# Usage
async def main():
    monitor = AgentMonitor()
    await monitor.run_with_monitoring(
        "Research quantum computing trends and create a technical report"
    )

asyncio.run(main())
```

The event streaming system provides complete transparency into the agent's autonomous workflow, allowing you to build sophisticated monitoring, progress tracking, and user interface systems around the agent's real-time activity.

## Environment Options

Choose where the agent operates based on your security and isolation needs:

```python
import asyncio
from panda_agi.client import Agent
from panda_agi.envs import DockerEnv, LocalEnv

async def main():
    # Option 1: Isolated Docker environment (recommended)
    docker_env = DockerEnv("./secure_workspace")
    
    # Option 2: Local environment (direct file system access)
    local_env = LocalEnv("./local_workspace")
    
    # Choose your environment
    agent = Agent(environment=docker_env)
    
    async for event in agent.run(
        "Build a website prototype with HTML, CSS, and JavaScript"
    ):
        print(f"[EVENT]: {event}")
    
    await agent.disconnect()

asyncio.run(main())
```



## Next Steps

<CardGroup cols={2}>
  <Card
    title="Core Concepts"
    icon="lightbulb"
    href="/concepts/agents"
  >
    Understand how the autonomous agent works
  </Card>
  <Card
    title="Environment Setup"
    icon="server"
    href="/concepts/environments"
  >
    Learn about Docker vs Local environments
  </Card>
  <Card
    title="API Reference"
    icon="code"
    href="/api-reference/introduction"
  >
    Detailed API documentation and examples
  </Card>
  <Card
    title="Examples"
    icon="play"
    href="/examples/research-tasks"
  >
    See complete examples and use cases
  </Card>
</CardGroup>

That's it! You're now ready to submit tasks to the autonomous agent and receive professional-grade results. The agent handles all the complexity of web research, file operations, and task execution automatically. 