Installation
CubePi runs on Python 3.11+. The core has three runtime
dependencies: pydantic, anthropic, openai. Optional features
(SQLite, Postgres, MCP) are gated behind extras so you only install
what you use.
With pipâ
pip install cubepi
Optional extras:
pip install "cubepi[sqlite]" # adds aiosqlite for SQLiteCheckpointer
pip install "cubepi[postgres]" # adds asyncpg + sqlalchemy + msgpack
pip install "cubepi[mcp]" # adds the MCP SDK for tool loaders
pip install "cubepi[sqlite,mcp]" # combine
With uvâ
uv is significantly faster than
pip and is the recommended workflow:
uv add cubepi
uv add "cubepi[sqlite,postgres,mcp]"
In an existing uv project, uv sync re-locks the environment after
edits to pyproject.toml.
With Poetryâ
poetry add cubepi
poetry add "cubepi[sqlite,postgres,mcp]"
Verifying the installâ
python -c "import cubepi; print(cubepi.__doc__)"
# cubepi â Pythonic async-native agent framework.
If you see an ImportError, your interpreter is likely < 3.11 â check
python --version.
Configuring provider credentialsâ
CubePi providers read credentials from constructor arguments. Most deployments pull them from environment variables:
import os
from cubepi.providers.anthropic import AnthropicProvider
from cubepi.providers.openai import OpenAIProvider
anthropic = AnthropicProvider(api_key=os.environ["ANTHROPIC_API_KEY"])
openai = OpenAIProvider(api_key=os.environ["OPENAI_API_KEY"])
You can also pass base_url=... to either provider to point at a
self-hosted endpoint or compatible proxy (e.g. Anthropic Bedrock,
LiteLLM, vLLM).
For the FauxProvider (used in tests), no credentials are required.
Choosing extras: which to installâ
| Extra | Pulls in | Install when |
|---|---|---|
| (none) | core only | You only need in-memory state, no MCP |
[sqlite] | aiosqlite | Single-process app needs disk persistence |
[postgres] | asyncpg, sqlalchemy, msgpack | Multi-instance / production â see Postgres guide |
[mcp] | mcp | You want to mount MCP server tools into your agent |
[docs] | griffe | You're building the docs site (contributors only) |
Next stepsâ
- Quick Start â your first agent in five minutes.
- Core Concepts â what
Agent/Tool/Provider/Checkpointeractually mean before you start gluing them.