Documentation 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 API Reference
Welcome to the Cognee API documentation. This comprehensive reference covers all endpoints for building, managing, and querying your memory using Cognee’s powerful platform.Getting Started
Before using the API, you need to choose how to run Cognee. You have two main options:Cognee Cloud
Managed Cloud PlatformProduction-ready, fully managed service with automatic scaling and enterprise features.
Local Docker Setup
Self-Hosted DevelopmentRun Cognee locally using Docker for development, testing, and custom deployments.
Setup Options
- Cognee Cloud
- Local Docker
Managed Service - Recommended for Production
- Sign up at platform.cognee.ai
- Create API Key in your dashboard
- Start using the API immediately
Cognee Cloud provides enterprise-grade infrastructure with automatic scaling, managed databases, and 24/7 monitoring.
API Base URLs
Production (Cognee Cloud)
Production (Cognee Cloud)
Local Development
Local Development
Authentication
- Cognee Cloud
- Local Docker
API Key AuthenticationAll requests require an API key in the header:Get your API key from the Cognee Cloud dashboard.
Core API Endpoints
The Cognee API provides endpoints for the complete knowledge graph lifecycle:Data Ingestion
POST /api/v1/addAdd text, documents, or structured data to your knowledge base.Knowledge Processing
POST /api/v1/cognifyTransform raw data into structured knowledge graphs with entities and relationships.Semantic Search
POST /api/v1/searchQuery your knowledge graph using natural language or structured queries.Data Management
DELETE /api/v1/datasetsRemove specific data items or entire datasets from your knowledge base.API Features
Multiple Search Types
Multiple Search Types
Choose from different search modes based on your needs:
GRAPH_COMPLETION(default): LLM-powered responses with graph contextRAG_COMPLETION: LLM answer from retrieved chunksCHUNKS: Raw text segments matching your querySUMMARIES: Pre-generated hierarchical summariesTRIPLET_COMPLETION: Triple-based retrieval + LLM completionCHUNKS_LEXICAL: Lexical (e.g. Jaccard) chunk searchCODING_RULES: Code-focused retrieval (coding rules / codebase)TEMPORAL: Time-aware retrievalGRAPH_COMPLETION_COT,GRAPH_COMPLETION_CONTEXT_EXTENSION,GRAPH_SUMMARY_COMPLETION: Advanced graph modesCYPHER,NATURAL_LANGUAGE: Direct or inferred Cypher (disabled whenALLOW_CYPHER_QUERY=false)FEELING_LUCKY: Auto-select search type
wide_search_top_k, triplet_distance_penalty, retriever_specific_config, and verbose for advanced control in the Python API. The HTTP POST /api/v1/search endpoint does not currently accept these advanced parameters. See Search Basics and Search.Flexible Data Formats
Flexible Data Formats
Support for various input formats locally and strings on Cognee Cloud:
- Text: Raw text strings, documents, articles
- Structured: JSON, CSV, XML data
- Code: Source code files and repositories
- URLs: Web pages and online content
Data Deletion
Cognee provides granular control over data deletion through thedatasets endpoints.
Deletion requires the
delete permission on the target dataset. See Permissions for details.DELETE /api/v1/delete is deprecated. Use the datasets endpoints above instead.Quick Example
Here’s a complete example using the API:Interactive API Explorer
OpenAPI Specification
Try the API interactivelyAll endpoints on the left side of the page are automatically generated from our OpenAPI specification, providing interactive examples and real-time testing capabilities.
- Cognee Cloud
- Local Docker
Interactive Swagger Endpoint DocsOur endpoints are also documented in Swagger with live testing capabilities. You can access the Swagger docs for Cognee Cloud at:
Error Handling
All API endpoints return standard HTTP status codes. Use the troubleshooting notes below when a request does not behave as expected.400 Bad Request
400 Bad Request
A
400 Bad Request usually means the request shape is invalid.Check the following:- Malformed JSON: Make sure the request body is valid JSON and that quotes, commas, and braces are correct.
- Wrong content type: JSON requests should include
Content-Type: application/json. - Missing required fields: Compare your payload with the endpoint schema in the generated API reference below.
- Wrong parameter names: Confirm field names such as
query,datasets, orsearch_typeexactly match the documented request body.
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
A
404 Not Found usually means the route or resource does not exist.Check the following:- Wrong path prefix: Use
/api/v1/..., not/api/.... For example,/api/users/mereturns a 404, while/api/v1/users/meis the correct path. - Wrong HTTP method: Confirm you are using the method documented for the endpoint, such as
POSTfor/api/v1/search. - Missing resource: Dataset IDs, user IDs, or other resource identifiers may be validly formatted but not present in the current environment.
429 Too Many Requests
429 Too Many Requests
A
429 Too Many Requests response means you have hit a rate limit.Try the following:- Retry with backoff: Wait briefly before retrying, and increase the delay if the limit persists.
- Reduce burst traffic: Spread out large batches of requests instead of sending them all at once.
- Handle retries in code: Add retry logic so temporary throttling does not break your application flow.
500 Internal Server Error
500 Internal Server Error
A
500 Internal Server Error usually indicates a server-side failure.Check the following:- Server logs: Inspect the API server logs first to find the underlying exception.
- Provider configuration: Verify your LLM, graph database, and vector database settings are valid.
- Problem isolation: Retry with a smaller input or a simpler request to determine whether the issue is data-specific.
- Authentication and permissions side effects: If the error appears only in multi-user mode, verify your auth and permissions configuration.
Next Steps
Explore Endpoints
API DocumentationBrowse all available endpoints with interactive examples below.
Community Support
Get HelpJoin our Discord community for support and discussions.