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:Cogwit (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
- Cogwit 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
Cogwit provides enterprise-grade infrastructure with automatic scaling, managed databases, and 24/7 monitoring.
API Base URLs
Production (Cogwit)
Production (Cogwit)
Local Development
Local Development
Authentication
- Cogwit Cloud
- Local Docker
API Key AuthenticationAll requests require an API key in the header:Get your API key from the Cogwit dashboard.
Core API Endpoints
The Cognee API provides endpoints for the complete knowledge graph lifecycle:Data Ingestion
POST /api/add
Add text, documents, or structured data to your knowledge base.Knowledge Processing
POST /api/cognify
Transform raw data into structured knowledge graphs with entities and relationships.Semantic Search
POST /api/search
Query your knowledge graph using natural language or structured queries.Data Management
DELETE /api/delete
Remove 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
: LLM-powered responses with graph contextCHUNKS
: Raw text segments matching your querySUMMARIES
: Pre-generated hierarchical summariesINSIGHTS
: Structured entity relationshipsCODE
: Code-specific search with syntax understanding
Flexible Data Formats
Flexible Data Formats
Support for various input formats locally and strings on cogwit:
- Text: Raw text strings, documents, articles
- Structured: JSON, CSV, XML data
- Code: Source code files and repositories
- URLs: Web pages and online content
Quick Example
Here’s a complete example using the API:Interactive API Explorer
OpenAPI Specification
Try the API interactivelyAll endpoints below are automatically generated from our OpenAPI specification, providing interactive examples and real-time testing capabilities.
Error Handling
All API endpoints return standard HTTP status codes:- 200: Success
- 400: Bad Request - Invalid parameters
- 401: Unauthorized - Invalid or missing API key
- 404: Not Found - Resource doesn’t exist
- 429: Too Many Requests - Rate limit exceeded
- 500: Internal Server Error - Server-side error
Always implement proper error handling in your applications to gracefully handle API failures and rate limits.
Next Steps
Explore Endpoints
API DocumentationBrowse all available endpoints with interactive examples below.
Community Support
Get HelpJoin our Discord community for support and discussions.