Skip to main content

pooolify: Code-centric Python framework for multi-agent LLM orchestration with FastAPI + SSE and PostgreSQL persistence

Project description

pooolify — Code‑Centric Multi‑Agent AI Framework (Python)

Overview

  • Purpose: Orchestrate multiple LLM‑powered agents to collaboratively solve complex tasks.
  • Focus: Developer Experience (DX), extensibility, and installable Python package.
  • Core: FastAPI + SSE, PostgreSQL persistence, code‑declared agents and tools, provider‑agnostic LLM layer with cost tracking.

Key Features

  • Manager‑Agent driven orchestration with DAG planning and parallel execution (asyncio).
  • Code‑declared Agents (pydantic) and Tools (Python classes) with a simple runtime.
  • FastAPI endpoints with Server‑Sent Events for plan/route/thought summaries/tool traces.
  • PostgreSQL persistence for sessions, messages, costs, plans, tool calls, and feedback.
  • Limits per request (steps, depth, duration) configured in code.

Repository Layout

pooolify-project/ ├─ pyproject.toml ├─ README.md ├─ pooolify/ # Framework core │ ├─ init.py │ ├─ config.py │ ├─ api/ │ ├─ core/ │ ├─ agents/ │ ├─ tools/ │ ├─ llm/ │ └─ persistence/ ├─ examples/ │ └─ 01_basic_chatbot/ │ ├─ main.py │ ├─ my_agents.py │ ├─ my_tools.py │ ├─ .env │ └─ prompts/ │ └─ my_agent.prompt │ └─ 02_multi_agent/ │ ├─ main.py │ ├─ agents.py │ ├─ tools.py │ ├─ data/kb.json │ └─ prompts/ │ ├─ researcher.prompt │ ├─ calculator.prompt │ └─ writer.prompt └─ tests/

Install (dev)

  • Editable install to dogfood the framework while building examples.

    pip install -e .

Env setup

  • Copy and adjust the environment file:

    cp .env.example .env

    then edit .env as needed (API_TOKEN, DATABASE_URL, etc.)

Environment

  • Use uv (recommended) or regular venv. Configure env via .env or real env vars:
    • APP_ENV=dev|staging|prod
    • DATABASE_URL=postgresql+psycopg://user:pass@host:5432/db
    • API_TOKEN=your_api_token
    • LLM_OPENAI_API_KEY=sk-...

Run the example

  • Start example 01 (basic):

    uvicorn examples.01_basic_chatbot.main:app --reload

  • Test health:

    curl http://localhost:8000/v1/healthz

  • Stream chat (SSE):

    curl -H "Accept: text/event-stream" -H "Authorization: Bearer $API_TOKEN"
    -N http://localhost:8000/v1/chat/stream -d '{"session_id":"demo","query":"안녕?"}'

  • Start example 02 (multi-agent):

    uvicorn examples.02_multi_agent.main:app --reload

  • Stream multi-agent (SSE):

    curl -H "Accept: text/event-stream"
    -N http://localhost:8000/v1/chat/stream -d '{"session_id":"demo2","query":"SSE가 뭐야? 2+2는?"}'

Manager limits in code

  • Set request limits when instantiating the core app:

    from pooolify.core import PooolifyApp from pooolify.core import ManagerLimits

    core = PooolifyApp(limits=ManagerLimits(max_steps=20, max_depth=4, max_duration_s=120))

    register agents ...

FastAPI Endpoints

  • POST /v1/chat/stream (SSE): main streaming interface.
  • POST /v1/chat: non‑streaming response.
  • POST /v1/sessions: create a session id.
  • GET /v1/sessions/{id}/messages: public conversation messages.
  • GET /v1/healthz, GET /v1/readyz: health endpoints.

Security

  • Simple bearer token via Authorization: Bearer <token>; wire to API_TOKEN.

Persistence

  • Tables are created on startup if missing (see pooolify/persistence/schema.py for DDL).

Notes

  • Supported models are 'gpt-5' and 'gpt-5-high'. Gemini is temporarily unsupported.
  • SSE Thought summaries are structured; raw chain‑of‑thought is never emitted.

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

pooolify-0.2.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

pooolify-0.2.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file pooolify-0.2.0.tar.gz.

File metadata

  • Download URL: pooolify-0.2.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pooolify-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aa6ccf975185c424921bcc32462196e42606ecd0accac4569d3639d77209d745
MD5 4eb386da51ec13c72835ff97296739f1
BLAKE2b-256 2f4dc20c4d20e81d944de326c87582b3ec2691df2a84fbda545fc2b4062ce68a

See more details on using hashes here.

File details

Details for the file pooolify-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pooolify-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for pooolify-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89f34b7630abf05f57061add5c9c790846233ee87ddef82b7b58c0931789de75
MD5 55e9ee8aeb6f1020bb19e8bf8fcd213f
BLAKE2b-256 c0c42554a64db6a5a16075d8433110ebf29c0a4e91ed1c107f33689b548a19b7

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