Skip to main content

PandaAGI SDK

Project description

🐼 PandaAGI SDK - An SDK for AGI (Agentic General Intelligence)

Release Discord Downloads License: MIT

The PandaAGI SDK provides a simple, intuitive API for building general AI agents in just a few lines of code. It abstracts away the complexity of Agentic Loops and provides a powerful interface for you to build autonomous agents. Each agent can be configured to run in a custom environment, interacting with the web, your file system, writing code, and running shell commands.

Installation

pip install panda-agi

Or with uv:

uv add panda-agi

🔧 Getting started

First of all, make sure you have a API key. You can get one for free here. Make sure to set it as an environment variable:

export PANDA_AGI_KEY=your_api_key

or set it in the .env file:

PANDA_AGI_KEY=your_api_key

Once you have the API key, you can start using the SDK:

import asyncio
from panda_agi import Agent
from panda_agi.envs import LocalEnv

async def main():
    # Create a custom environment for the agent
    agent_env = LocalEnv("./my_agent_workspace")
    
    # Create the agent
    agent = Agent(environment=agent_env)
    
    # Run the agent with a task
    response = agent.run("Tell me a joke about pandas")
    print(response.output)

    # Other possible tasks
    response = agent.run("Make a report of the real estate market in Germany")
    # -> will generate a reporrt in the provided workspace folder

    response = agent.run("Can you analyze our sales and create a dashboard?")
    # -> will generate a dashboard in the provided workspace folder starting from a csv file in the workspace folder

    response = agent.run("Can you create a website for our company?")
    # -> will generate a website in the provided workspace folder

    # Disconnect when done
    await agent.disconnect()

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

In case you want to enable te web search, you will also need a Tavily API key. You can get one for free here. Then set it as an environment variable or set it in the .env file:

TAVILY_API_KEY=your_api_key

📱 Running with the UI

In case you don't want to build an app from scratch, we provide a UI that you can use to run your agents.

Running it is as simple as:

# Run the UI
cd examples/ui
./start.sh

This will start a docker container with the UI running. You can access it at http://localhost:3000 and start using it.

Demo

🛠️ Features

  • Simple, intuitive API for interacting with PandaAGI agents
  • Support for local and Docker environments
  • Asynchronous event-based communication
  • Pydantic models for type safety

📚 Documentation

For complete documentation, visit our documentation site.

🛠️ Development

Prerequisites

  • Python 3.8+
  • uv

Setup

  1. Clone the repository
  2. Install dependencies:
uv pip install -e ".[dev]"

Testing

Run tests with pytest:

uv run pytest

📝 License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panda_agi-0.2.1.tar.gz (71.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panda_agi-0.2.1-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file panda_agi-0.2.1.tar.gz.

File metadata

  • Download URL: panda_agi-0.2.1.tar.gz
  • Upload date:
  • Size: 71.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for panda_agi-0.2.1.tar.gz
Algorithm Hash digest
SHA256 536ee304b460b8788a525f55b443fccc504c6036f4d3a140d2c68ee696a9f7f8
MD5 55f3eb34f2d355eb69fb11ee8476a4c7
BLAKE2b-256 1a0dc9f13462dd6ec06bd6b28c75d185fa645016713251fd21eb26b709c5626e

See more details on using hashes here.

File details

Details for the file panda_agi-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: panda_agi-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for panda_agi-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4f9424525da537cad5c05ad2cf15e296ce4dba9827417e4aa947e6d75ef4bef
MD5 d9b2169473e94bbfdd6e4a836b933f13
BLAKE2b-256 573a41208ee66df6d3e005547694c268361e0f1c44e5bafb5ba6c1282c55de93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page