Skip to main content
The Cognee Python SDK connects to Cognee Cloud via cognee.serve(). Once connected, all operations (remember, recall, forget, improve) route to your cloud tenant.
The same cognee package is used for both local and cloud workflows. The only difference is calling cognee.serve() to connect to a remote instance.

Install

Complete example

What just happened

Connecting to cloud

Pass your tenant URL and API key to cognee.serve():
Create an API key from the API Keys page in the Cognee Cloud console. You can find your tenant URL there as well. To verify the remote connection, check the tenant health endpoint and then confirm authentication against the datasets API:
A 200 OK from /health confirms the service is up. For GET /api/v1/datasets/, a 200 means the URL and key are working, 401 means the key is wrong, and 404 or a 5xx usually means the URL or service is unavailable.

Storing data

remember ingests data and builds the knowledge graph in a single call. Data is organized by dataset for isolation and permissions. For more control, use the lower-level add and cognify operations separately.

Retrieving data

recall auto-routes the query to the best retrieval strategy. For direct control over search types, see Search Basics.

Disconnecting

Closes the connection to the cloud tenant. Credentials remain cached for the next session.

Next steps

Cloud functionality

Explore the full API surface available in Cognee Cloud.

Cloud MCP

Connect MCP-compatible clients to Cognee Cloud.