> ## Documentation Index
> Fetch the complete documentation index at: https://agi-docs.pandas-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get up and running with PandaAGI SDK in under 5 minutes

<Note>
  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.
</Note>

<Tabs>
  <Tab title="Quick start (UI)">
    <Steps>
      <Step title="Get API Key">
        <Card>1. Visit [https://agi.pandas-ai.com/](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</Card>
      </Step>

      <Step title="Launch Chat Interface">
        <Card>
          The fastest way to experience PandaAGI is through our ready-made chat interface:

          ```bash theme={null}
          # 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](http://localhost:3000)
        </Card>
      </Step>

      <Step title="Start Chatting">
        <Card>
          <img src="https://mintcdn.com/sinaptik-0f582301/txkqljXddBbQ6cuN/images/chat_interface.png?fit=max&auto=format&n=txkqljXddBbQ6cuN&q=85&s=d3979b9aded891e6e602ad4e33211448" alt="PandaAGI Chat Interface" className="rounded-lg shadow-md" width="2146" height="1540" data-path="images/chat_interface.png" />

          Try 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"
        </Card>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Developer Setup (SDK)">
    <Steps>
      <Step title="Installation">
        <Card>
          Install the PandaAGI using your preferred package manager:

          <CodeGroup>
            ```bash pip theme={null}
            pip install panda-agi
            ```

            ```bash poetry theme={null}
            poetry add panda-agi
            ```

            ```bash uv theme={null}
            uv pip install panda-agi
            ```

            ```bash conda theme={null}
            conda install -c conda-forge panda-agi
            ```
          </CodeGroup>
        </Card>
      </Step>

      <Step title="API Key Setup">
        <Card>
          <Warning>
            **Required**: You must obtain an API key from [https://agi.pandas-ai.com/](https://agi.pandas-ai.com/) to use the PandaAGI SDK.
          </Warning>

          Set the `PANDA_AGI_KEY` and `TAVILY_API_KEY` environment variables in your .env file or directly in your code:

          ```python theme={null}
          import os
          os.environ['PANDA_AGI_KEY'] = 'your-api-key-here'
          os.environ['TAVILY_API_KEY'] = 'your-tavily-api-key-here'
          ```
        </Card>
      </Step>
    </Steps>
  </Tab>
</Tabs>

## 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

<iframe width="100%" height="400" src="https://www.youtube.com/embed/7c66qvJ7GCk" title="PandaAGI Demo - Autonomous AI Agent in Action" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen className="rounded-lg shadow-md mb-6" />

<div className="mb-6">
  <p className="mb-3 inline pr-2">Try it out yourself!</p>

  <a href="https://colab.research.google.com/drive/1XEbeTeOgqUKKWsujgkDLKz23FPTPEmjM?usp=sharing" target="_blank" rel="noopener noreferrer" className="inline">
    <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab" className="inline-block" />
  </a>
</div>

## Working with the Chat Interface (UI)

<Frame caption="PandaAGI Chat Interface">
  <img src="https://mintcdn.com/sinaptik-0f582301/txkqljXddBbQ6cuN/images/chat_interface.png?fit=max&auto=format&n=txkqljXddBbQ6cuN&q=85&s=d3979b9aded891e6e602ad4e33211448" alt="PandaAGI Chat Interface" className="rounded-lg shadow-md" width="2146" height="1540" data-path="images/chat_interface.png" />
</Frame>

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

<CardGroup cols={2}>
  <Card title="Real-time Streaming" icon="bolt" color="#0285c7">
    See agent responses, thinking, and actions as they happen
  </Card>

  <Card title="File Upload" icon="file-arrow-up" color="#16a34a">
    Upload files for the agent to analyze or process
  </Card>

  <Card title="Conversation History" icon="clock-rotate-left" color="#dc2626">
    Maintain context across multiple interactions
  </Card>

  <Card title="Mobile Responsive" icon="mobile" color="#8b5cf6">
    Works seamlessly on desktop and mobile devices
  </Card>
</CardGroup>

### Running the Chat Interface

<Tabs>
  <Tab title="Docker Setup (Recommended)">
    ```bash theme={null}
    # Navigate to the UI example directory
    cd examples/ui

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

    # Start with Docker Compose
    ./start.sh
    ```

    This launches:

    * Frontend: [http://localhost:3000](http://localhost:3000)
    * Backend API: [http://localhost:8001](http://localhost:8001)
  </Tab>

  <Tab title="Manual Setup">
    ```bash theme={null}
    # Backend
    cd examples/ui/backend
    pip install -r requirements.txt
    python main.py

    # Frontend (in new terminal)
    cd examples/ui/frontend
    yarn install
    yarn start
    ```
  </Tab>
</Tabs>

<Tip>
  Want to customize the chat interface? Check out the [Chat Interface Guide](/chat-interface) for detailed documentation on how to extend and modify the UI.
</Tip>

## Advanced Configuration

### Custom Environment

You can configure your AI agent with different execution environments:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
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:

```python theme={null}
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:

<CardGroup cols={3}>
  <Card title="Chat Interface" icon="comments" href="/chat-interface" color="#16a34a">
    Build your own agentic chat application
  </Card>

  <Card title="Skills" icon="wrench" href="/concepts/skills" color="#f59e0b">
    Extend your agent's capabilities with custom functions
  </Card>

  <Card title="Knowledge" icon="brain" href="/concepts/knowledge" color="#ef4444">
    Guide your agent's behavior with contextual information
  </Card>
</CardGroup>
