Cognee is an open-source memory engine for AI applications and agents that organizes data into interconnected, topological knowledge graphs and vector embeddings. It bridges the gap between unstructured data ingestion and high-precision retrieval by transforming documents, conversations, and code into structured relational graphs enriched with semantic vectors.
graph LR
Input[Unstructured Data / Transcripts / Docs] --> Add["cognee.add()"]
Add --> Cognify["cognee.cognify()<br/>(LLM Extraction & Graph Construction)"]
Cognify --> GraphStore[(Graph DB: Neo4j / NetworkX / Kùzu)]
Cognify --> VectorStore[(Vector DB: Qdrant / LanceDB / PGVector)]
GraphStore & VectorStore --> Search["cognee.search()<br/>(Hybrid / Multi-hop Recall)"]
Search --> Agent[AI Agent / LLM]
pgvector).add), graph cognition (cognify), and semantic/graph querying (search).Cognee exposes a Python API structured around three main operations:
import asyncio
import cognee
async def main():
# 1. Add raw text, files, or datasets to the memory pipeline
await cognee.add("Alice is the lead architect for the Orion project based in Zurich.")
await cognee.add("The Orion project uses Rust and Apache Arrow for memory efficiency.")
# 2. Cognify: Extract entities, resolve relationships, and construct graph embeddings
await cognee.cognify()
# 3. Search: Retrieve structured memory context
results = await cognee.search("What technologies does Alice's project rely on?")
for result in results:
print(result)
if __name__ == "__main__":
asyncio.run(main())
| Component | Embedded / Local | Production / Distributed |
|---|---|---|
| Relational DB | SQLite | PostgreSQL |
| Graph DB | NetworkX, Kùzu | Neo4j, FalkorDB |
| Vector DB | LanceDB, ChromaDB | Qdrant, Milvus, pgvector |