by topoteretes
Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory with small models for free
# Add to your Claude Code skills
git clone https://github.com/topoteretes/cogneecognee is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by topoteretes. Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory with small models for free. It has 33,780 GitHub stars.
cognee's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/topoteretes/cognee" and add it to your Claude Code skills directory (see the Installation section above).
cognee is primarily written in Python. It is open-source under topoteretes on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh cognee against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
📄 Read the research paper: Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning — Markovic et al., 2025
| I want to… | Start here |
|---|---|
| Build memory without an LLM | Local Python quickstart |
| Explore a prebuilt graph without downloading models | Bundled demo |
| Generate answers with a local or hosted LLM | Optional LLM setup |
| Give an existing agent memory | Plugins and MCP |
| Run Cognee on my infrastructure | Deployment options |
| Use a managed service | Cognee Cloud |
Requires Python 3.10–3.14.
1. Install Cognee with pip, uv, or your preferred Python package manager. The gliner extra brings the local extraction model used when no LLM key is configured:
uv pip install "cognee[gliner]"
2. Build and query memory. With no LLM key configured, Cognee extracts the graph with the local GLiNER model and embeds with a local embedding model; both download on first use.
Save this as quickstart.py and run python quickstart.py if you are feeling old school, or tell your LLM to do it:
import asyncio
import cognee
async def main():
# Extract a knowledge graph and embed the text with local models.
await cognee.remember(
"Marie Curie was born in Warsaw and worked at the University of Paris.",
dataset_name="local_quickstart",
)
# Retrieve the matching source text; no LLM generates an answer.
results = await cognee.recall(
"Where was Marie Curie born?",
datasets=["local_quickstart"],
)
for result in results:
print(result)
if __name__ == "__main__":
asyncio.run(main())
The same workflow is available from the CLI:
cognee-cli remember "Marie Curie was born in Warsaw." -d local_quickstart
cognee-cli recall "Where was Marie Curie born?" -d local_quickstart
Text ingestion, retrieval, and session storage work without an LLM. LLM-dependent improvement stages skip automatically.
Generated answers and media processing that requires a vision or transcription model need additional LLM configuration.
The bundled GLiNER extractor is a demo of Cognee's small-model pipeline. For a production-ready version with higher accuracy and broader label coverage, reach out to us.
3. Add an LLM to get generated answers instead of retrieved passages:
import os
os.environ["LLM_API_KEY"] = "YOUR_OPENAI_API_KEY"
Alternatively, create a .env file using our template.
Once a key is set, Cognee uses OpenAI for language models and embeddings, and processing and generated answers make provider calls. See installation, other providers, or local Ollama models for other setups.
To explore a prebuilt graph without downloading extraction or embedding models:
cognee-cli demo
This command works with the base pip install cognee package. It loads bundled sample data and runs keyword search without an API key. Use the local quickstart above to build a graph from your own text.
Cognee builds connected memory from different sources. Text becomes entities, relationships, and searchable chunks; code becomes a graph of symbols and dependencies. Session distillation curates accepted lessons into permanent memory.
At query time, retrieval selects relevant graph, vector, or code context. Your application can inspect the retrieved evidence and use it to answer a question or continue an agent task.
| Operation | What it does | Learn more |
|---|---|---|
remember |
Store content or code in permanent memory, or in a session when a session ID is supplied. | Store memory |
recall |
Retrieve context and answers, using automatic routing or a chosen search strategy. | Query memory |
improve |
Enrich memory, apply feedback, and bridge session knowledge into the graph. | Improve memory |
forget |
Remove a specific item or dataset. | Delete memory |
Explore the architecture and session lifecycle.
Install the Claude Code plugin:
claude plugin marketplace add topoteretes/cognee-integrations
claude plugin install cognee-memory@cognee
Or install the Codex plugin. Enable hooks first, either with the CLI:
codex features enable hooks
or in ~/.codex/config.toml:
[features]
hooks = true
Then add the marketplace and the plugin:
codex plugin marketplace add topoteretes/cognee-integrations --ref main
codex plugin add co