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.1.0.tar.gz (974.6 kB view details)

Uploaded Source

Built Distribution

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

pooolify-0.1.0-py3-none-any.whl (991.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pooolify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 afb674438758c75f090eeb8957dec9839b70dde46be95364e0a109bebe1a993a
MD5 7408500c625007539f5368231151f0de
BLAKE2b-256 517af25794928e1bfe12df5933e09c76a9790fabc660a4bafbd816f28bb7e430

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pooolify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01b57faeda760ac0c99daa09fdec65dc6fbe856d208baf2b633ce67f47024c36
MD5 3985789785857f9258036f11f354f4c6
BLAKE2b-256 41d62e4664e087a4302ff1ba7c10cd9047d2daecffdf871d52347c089cf212d1

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