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
“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”
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:
Copy
import os, asynciofrom panda_agi import Agentfrom panda_agi.envs import DockerEnvfrom panda_agi.handlers import LogsHandlerasync def main(): os.environ['PANDA_AGI_KEY'] = 'your-api-key-here' os.environ['TAVILY_API_KEY'] = 'your-tavily-api-key-here' # Create environment for the general AI agent to work in agent_env = DockerEnv("./workspace") agent = Agent(environment=agent_env) # Create a handler for logging events handlers = [LogsHandler(use_colors=True, show_timestamps=True)] # Submit a task with event handlers response = await agent.run( "Research the latest AI developments and create a summary report", event_handlers=handlers ) # The general AI 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"Task completed: {response.output}") await agent.disconnect()if __name__ == "__main__": asyncio.run(main())
# 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
# 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 agent with conversation ID for persistenceagent = Agent( environment=DockerEnv("./workspace"), conversation_id="unique-conversation-id")# Create event handlerhandlers = [LogsHandler(use_colors=True, show_timestamps=True)]# First interactionresponse1 = await agent.run( "Find information about electric vehicles", event_handlers=handlers)print(f"First task completed: {response1.output}")# Later interaction (continues the same conversation)response2 = await agent.run( "Now compare the top 3 models", event_handlers=handlers)print(f"Second task completed: {response2.output}")