Cognee
raw JSON → 1.0.3 verified Fri May 01 auth: no python
Cognee is a Python library for enriching LLM context with a semantic layer, enabling better understanding and reasoning. It provides memory management, knowledge graph construction, and ontology support. Current version is 1.0.3, with active development on 1.0.4.dev0. Release cadence is rapid, with multiple minor/patch releases per month.
pip install cognee Common errors
error ImportError: cannot import name 'CogneeClient' from 'cognee' ↓
cause Incorrect import path; the module may not be exposed at the top level in earlier versions.
fix
Use 'from cognee import CogneeClient' or check the exact export in your version. For v1.0.0+, this import should work.
error cognee.exceptions.AuthenticationError: No API key provided. ↓
cause The client requires an API key but none was set.
fix
Set the COGNEE_API_KEY environment variable or pass api_key='your_key' to CogneeClient().
Warnings
gotcha CogneeClient requires an API key by default. Without it, operations may fail silently. Always set the COGNEE_API_KEY environment variable or pass api_key explicitly. ↓
fix Set environment variable: export COGNEE_API_KEY='your_key' or pass api_key='your_key' to CogneeClient.
breaking In v1.0.0, caching was enabled by default. If you rely on immediate data freshness, you may need to disable caching or clear cache explicitly. ↓
fix To disable caching, set cache_enabled=False in the client constructor.
gotcha Memory synchronization across devices may be unreliable in v1.0.2 and earlier. Upgrading to v1.0.3+ is recommended for production use. ↓
fix Upgrade to v1.0.3 or later: pip install --upgrade cognee
Imports
- CogneeClient
from cognee import CogneeClient - Memory
from cognee import Memory
Quickstart
import os
from cognee import CogneeClient
api_key = os.environ.get('COGNEE_API_KEY', '')
client = CogneeClient(api_key=api_key)
# Add a memory
memory = client.add_memory("The Eiffel Tower is in Paris.")
print(memory)
# Search memories
results = client.search("Where is the Eiffel Tower?")
print(results)