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:
-
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 toAPI_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pooolify-0.3.0.tar.gz.
File metadata
- Download URL: pooolify-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
216cf9eebd1ea91b58f96a06ffd44fd1c6575826fce6b5227892746d36d76589
|
|
| MD5 |
626024c7227fc31bee5a991be1dc9a50
|
|
| BLAKE2b-256 |
1aad396e7d411f3a4eb7fb2800ed5253e9dc9fd99ff5597f0afb5ec002c07a79
|
File details
Details for the file pooolify-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pooolify-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94c2e5a1074ff5b1e9d1b3364581f32259a6e620c6b304393b3970a8221b2d60
|
|
| MD5 |
b827334743b0c7785ed095d75a424898
|
|
| BLAKE2b-256 |
f4e2b954e496ca24211b350ed283126f93b7b5e6621e72d430add7c38a525526
|