cognee - Memory for AI Agents in 5 lines of code
Demo . Learn more · Join Discord
Build dynamic Agent memory using scalable, modular ECL (Extract, Cognify, Load) pipelines.
More on use-cases and evals

Features
- Interconnect and retrieve your past conversations, documents, images and audio transcriptions
- Reduce hallucinations, developer effort, and cost.
- Load data to graph and vector databases using only Pydantic
- Manipulate your data while ingesting from 30+ data sources
Get Started
Get started quickly with a Google Colab notebook or starter repo
Contributing
Your contributions are at the core of making this a true open source project. Any contributions you make are greatly appreciated. See CONTRIBUTING.md for more information.
📦 Installation
You can install Cognee using either pip, poetry, uv or any other python package manager.
With pip
pip install cognee
💻 Basic Usage
Setup
import os
os.environ["LLM_API_KEY"] = "YOUR OPENAI_API_KEY"
You can also set the variables by creating .env file, using our template. To use different LLM providers, for more info check out our documentation
Simple example
This script will run the default pipeline:
import cognee
import asyncio
async def main():
# Add text to cognee
await cognee.add("Natural language processing (NLP) is an interdisciplinary subfield of computer science and information retrieval.")
# Generate the knowledge graph
await cognee.cognify()
# Query the knowledge graph
results = await cognee.search("Tell me about NLP")
# Display the results
for result in results:
print(result)
if __name__ == '__main__':
asyncio.run(main())
Example output:
Natural Language Processing (NLP) is a cross-disciplinary and interdisciplinary field that involves computer science and information retrieval. It focuses on the interaction between computers and human language, enabling machines to understand and process natural language.
Graph visualization:
Open in browser.
For more advanced usage, have a look at our documentation.
Understand our architecture

Demos
- What is AI memory:
Learn about cognee
- Simple GraphRAG demo
Simple GraphRAG demo
- cognee with Ollama
cognee with local models
Code of Conduct
We are committed to making open source an enjoyable and respectful experience for our community. See CODE_OF_CONDUCT for more information.
💫 Contributors
Star History
Cognee
Project Details
- topoteretes/cognee
- Apache License 2.0
- Last Updated: 4/22/2025
Recomended MCP Servers
Model Context Protocol (MCP) server for @glideapps API
Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, using the browser, and more...
【Star-crossed coders unite!⭐️】Model Context Protocol (MCP) server implementation providing Google News search capabilities via SerpAPI, with automatic news...
MCP Server integrating MCP Clients with Stability AI-powered image manipulation functionalities: generate, edit, upscale, and more.
A powerful MCP (Model Context Protocol) server for Claude Desktop, integrating task management, SQLite, and Obsidian visualization.
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
AI-powered local MCP server for terminal commands, surgical file editing, process management, and intelligent codebase exploration. FastMCP-powered, file...
MCP server for Youtube
A Model Context Protocol (MCP) server that enables LLMs to interact directly with Couchbase databases. Query buckets, execute...
An MCP (Model Context Protocol) server for interacting with a Paperless-NGX API server. This server provides tools for...
Analyze user input to identify suitable design patterns and project templates. Orchestrate the project, creating initial files from...





