Coco
Get started

Install

Install coco-framework with the extras your agent needs, see every package and its import, and set your model provider's keys.

Install coco-framework with the extras your agent needs.

Prerequisites: Python 3.10 or later, below 4.0.


Install the framework

coco-framework holds every runtime library: the core, the graph engine, the checkpointers, and both model providers.

pip install "coco-framework[all]"     # or: uv pip install "coco-framework[all]"

Add only the extras your agent uses:

ExtraInstall commandAdds
openaipip install "coco-framework[openai]"OpenAI and OpenAI-compatible chat models and embeddings (openai, tiktoken)
anthropicpip install "coco-framework[anthropic]"Anthropic Claude chat models (anthropic)
sqlitepip install "coco-framework[sqlite]"The SQLite checkpointers (aiosqlite, sqlite-vec)
postgrespip install "coco-framework[postgres]"The PostgreSQL checkpointers (psycopg, psycopg-pool, ormsgpack)
mcppip install "coco-framework[mcp]"Model Context Protocol integration (fastmcp)
azure-identitypip install "coco-framework[azure-identity]"Azure Active Directory authentication (azure-identity)
allpip install "coco-framework[all]"Every extra above

Good to know: PostgresSaver uses psycopg, which needs the libpq client library. If import psycopg fails, install psycopg[binary], which bundles it.

Packages

coco-framework is also built as nine separate trustcoco-* distributions, for environments that need only part of the runtime. They're served from Coco's package index, not PyPI.

DistributionVersionImportHolds
trustcoco1.4.2cococreate_agent, init_chat_model, AgentMiddleware, the built-in middleware, and structured output
trustcoco-core1.6.5coco_coreMessages, @tool, runnables, prompt templates, and CocoTracer
trustcoco-graph1.2.12coco_graphStateGraph, the execution engine, interrupt(), Command, Send, and streaming
trustcoco-graph-prebuilt1.1.0coco_graph.prebuiltToolNode, ValidationNode, tools_condition, InjectedState, InjectedStore, ToolRuntime
trustcoco-graph-checkpoint4.2.0coco_graph.checkpointBaseCheckpointSaver, InMemorySaver, and the serializers
trustcoco-graph-checkpoint-sqlite3.1.1coco_graph.checkpoint.sqliteSqliteSaver and AsyncSqliteSaver
trustcoco-graph-checkpoint-postgres3.1.2coco_graph.checkpoint.postgresPostgresSaver and AsyncPostgresSaver
trustcoco-openai1.6.6coco_openaiChatOpenAI, AzureChatOpenAI, OpenAIEmbeddings, AzureOpenAIEmbeddings
trustcoco-anthropic1.7.4coco_anthropicChatAnthropic, AnthropicLLM, convert_to_anthropic_tool

Keep in mind: Install either coco-framework or the trustcoco-* distributions, not both. They hold the same modules.

Set model keys

VariableRead byUsed for
OPENAI_API_KEYcoco_openaiThe OpenAI API key.
OPENAI_BASE_URLcoco_openaiAn OpenAI-compatible endpoint, such as vLLM, Ollama, LiteLLM, or an internal gateway.
ANTHROPIC_API_KEYcoco_anthropicThe Anthropic API key.

See Model providers for Azure OpenAI and the other settings.


On this page