by topoteretes
Provides dynamic memory for AI agents through modular ECL (Extract, Cognify, Load) pipelines, enabling seamless integration with graph and vector stores using minimal code.
Cognee enables AI agents to store, retrieve, and reason over past interactions, documents, images, and audio transcriptions. It replaces traditional Retrieval‑Augmented Generation (RAG) workflows with a unified, low‑code solution that builds and queries knowledge graphs and vector databases.
pip install cognee
.env file:import os
os.environ["LLM_API_KEY"] = "YOUR_OPENAI_API_KEY"
import cognee, asyncio
async def main():
await cognee.add("Natural language processing (NLP) is ...")
await cognee.cognify()
results = await cognee.search("Tell me about NLP")
for r in results:
print(r)
asyncio.run(main())
Q: Which LLM providers are supported? A: Any provider that offers an API key compatible with the OpenAI request schema; local models via Ollama are also supported.
Q: Do I need a vector database separate from the graph store? A: Cognee can sync embeddings to both a graph database (e.g., Neo4j) and a vector store; you can choose one or both.
Q: How do I set environment variables without editing code?
A: Use a .env file based on the provided .env.template or export variables in your shell.
Q: Is there a hosted version?
A: Yes, the Cogwit beta offers a fully‑hosted AI memory service at https://platform.cognee.ai/.
Q: Can I extend the ingestion pipeline? A: The ECL architecture is modular; you can add custom extractors, transformers, or loaders via Python plugins.
Cognee - Accurate and Persistent AI Memory
Use your data to build personalized and dynamic memory for AI Agents. Cognee lets you replace RAG with scalable and modular ECL (Extract, Cognify, Load) pipelines.
Cognee is an open-source tool and platform that transforms your raw data into persistent and dynamic AI memory for Agents. It combines vector search with graph databases to make your documents both searchable by meaning and connected by relationships.
You can use Cognee in two ways:
To learn more, check out this short, end-to-end Colab walkthrough of Cognee's core features.
Let’s try Cognee in just a few lines of code. For detailed setup and configuration, see the Cognee Docs.
You can install Cognee with pip, poetry, uv, or your preferred Python package manager.
uv pip install cognee
import os
os.environ["LLM_API_KEY"] = "YOUR OPENAI_API_KEY"
Alternatively, create a .env file using our template.
To integrate other LLM providers, see our LLM Provider Documentation.
Cognee will take your documents, generate a knowledge graph from them and then query the graph based on combined relationships.
Now, run a minimal pipeline:
import cognee
import asyncio
async def main():
# Add text to cognee
await cognee.add("Cognee turns documents into AI memory.")
# Generate the knowledge graph
await cognee.cognify()
# Add memory algorithms to the graph
await cognee.memify()
# Query the knowledge graph
results = await cognee.search("What does Cognee do?")
# Display the results
for result in results:
print(result)
if __name__ == '__main__':
asyncio.run(main())
As you can see, the output is generated from the document we previously stored in Cognee:
Cognee turns documents into AI memory.
As an alternative, you can get started with these essential commands:
cognee-cli add "Cognee turns documents into AI memory."
cognee-cli cognify
cognee-cli search "What does Cognee do?"
cognee-cli delete --all
To open the local UI, run:
cognee-cli -ui
See Cognee in action:
Cognee Memory for LangGraph Agents
We welcome contributions from the community! Your input helps make Cognee better for everyone. See CONTRIBUTING.md to get started.
We're committed to fostering an inclusive and respectful community. Read our Code of Conduct for guidelines.
We recently published a research paper on optimizing knowledge graphs for LLM reasoning:
@misc{markovic2025optimizinginterfaceknowledgegraphs,
title={Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning},
author={Vasilije Markovic and Lazar Obradovic and Laszlo Hajdu and Jovan Pavlovic},
year={2025},
eprint={2505.24478},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2505.24478},
}
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
by basicmachines-co
Enables persistent, local‑first knowledge management by allowing LLMs to read and write Markdown files during natural conversations, building a traversable knowledge graph that stays under the user’s control.
by smithery-ai
Provides read and search capabilities for Markdown notes in an Obsidian vault for Claude Desktop and other MCP clients.
by chatmcp
Summarize chat messages by querying a local chat database and returning concise overviews.
by dmayboroda
Provides on‑premises conversational retrieval‑augmented generation (RAG) with configurable Docker containers, supporting fully local execution, ChatGPT‑based custom GPTs, and Anthropic Claude integration.
by qdrant
Provides a Model Context Protocol server that stores and retrieves semantic memories using Qdrant vector search, acting as a semantic memory layer.
by doobidoo
Provides a universal memory service with semantic search, intelligent memory triggers, OAuth‑enabled team collaboration, and multi‑client support for Claude Desktop, Claude Code, VS Code, Cursor and over a dozen AI applications.
by GreatScottyMac
Provides a project‑specific memory bank that stores decisions, progress, architecture, and custom data, exposing a structured knowledge graph via MCP for AI assistants and IDE tools.
by andrea9293
Provides document management and AI-powered semantic search for storing, retrieving, and querying text, markdown, and PDF files locally without external databases.