Get up and running with PandaAGI SDK in under 5 minutes
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:
Copy
# Clone the repositorygit clone https://github.com/sinaptik-ai/panda-agi.gitcd panda-agi/examples/ui# Set your API keyecho "PANDA_AGI_KEY=your-api-key-here" > ./backend/.envecho "TAVILY_API_KEY=your-tavily-api-key-here" >> ./backend/.envecho "WORKSPACE_PATH=./workspace" >> ./backend/.env# Start the application./start.sh
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:
# Navigate to the UI example directorycd examples/ui# Set your API key in .env fileecho "PANDA_AGI_KEY=your-api-key-here" > .envecho "TAVILY_API_KEY=your-tavily-api-key-here" >> .envecho "WORKSPACE_PATH=./workspace" >> .env# Start with Docker Compose./start.sh
You can configure your AI agent with different execution environments:
Copy
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)
Manage conversation state for multi-turn interactions:
Copy
from panda_agi.handlers import LogsHandlerfrom panda_agi.envs import DockerEnv# Create event handlerhandlers = [LogsHandler(use_colors=True, show_timestamps=True)]# Create agent with conversation ID for persistenceagent = Agent( environment=DockerEnv("./workspace"), conversation_id="unique-conversation-id", event_handlers=handlers)# First interactionresponse1 = 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}")
The AgentResponse object provides access to files created or referenced by the agent:
Copy
from panda_agi import Agentfrom panda_agi.envs import DockerEnvasync 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()