The Cognee Python SDK connects to Cognee Cloud viaDocumentation Index
Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
There are two ways to connect to Cognee Cloud: OAuth / device-auth (default) — Opens a browser window for login. Best for interactive development.~/.cognee/cloud_credentials.json — subsequent calls reconnect without re-authenticating until the token expires.
Direct mode — Pass the tenant URL and API key explicitly. Best for CI, scripts, or self-hosted/staging environments.
COGNEE_SERVICE_URL and COGNEE_API_KEY) instead of passing them inline. Create an API key from the API Keys page in the Cognee Cloud console.
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
Next steps
Cloud functionality
Explore the full API surface available in Cognee Cloud.
Connect an agent
Give any agent framework persistent memory through Cognee.