Skip to main content
PromptQuorum
Home/Power Local LLM/cognee Review: Open-Source Knowledge-Graph Memory for AI Agents
RAG & Document Chat

cognee Review: Open-Source Knowledge-Graph Memory for AI Agents

·11 min read·By Hans Kuepper · Founder of PromptQuorum, multi-model AI dispatch tool · PromptQuorum

cognee is a free, open-source (Apache-2.0) Python library that gives AI agents persistent memory by building a self-hosted knowledge graph out of your documents, code, and conversations, instead of relying on flat vector similarity alone. It is installed with pip install cognee, its engine and graph run entirely on your own infrastructure, and by default it sends text to a configured external LLM/embedding provider for processing — though it also supports routing those calls to a local Ollama model. Cognee Cloud is a separate, optional managed offering for teams that do not want to self-host.

cognee (cognee.ai, source at github.com/topoteretes/cognee) is a free, open-source (Apache-2.0) Python library that gives AI agents persistent, structured memory by turning documents, code, and conversations into a queryable knowledge graph instead of just a flat vector index. It is built by Topoteretes UG, a Berlin-based company, and has over 30,700 GitHub stars. This review covers what cognee actually does, how it differs from a plain vector-database RAG setup, how to install and use it, and who it fits.

Key Takeaways

  • cognee (cognee.ai) is a free, open-source Python library for AI agent memory built around a self-hosted knowledge graph, not a hosted app
  • Apache-2.0 licensed, confirmed via the GitHub repository
  • Built by Topoteretes UG, a Berlin-based company led by managing director Vasilije Markovic
  • Over 30,700 GitHub stars as of this review (verified 2026-09-18)
  • Locality is hybrid: the knowledge-graph engine and vector store run self-hosted, but default LLM/embedding processing calls go to a configured external provider — local Ollama models are also supported
  • Core operations are cognee.add() (ingest), cognee.cognify() (build the graph), and cognee.search() (query it), with newer high-level remember()/recall() convenience functions built on top of that same pipeline
  • Integrates with Claude Code, Cursor, LangGraph, CrewAI, OpenClaw, and Model Context Protocol (MCP) tooling

📍 In One Sentence

cognee is a free, open-source (Apache-2.0) Python library from the Berlin-based company Topoteretes that gives AI agents persistent memory by building a self-hosted knowledge graph out of documents, code, and conversations, rather than relying only on vector similarity search.

💬 In Plain Terms

Instead of just chopping your documents into chunks and matching them by similarity like a typical RAG setup, cognee reads your data and builds a map of the entities and relationships in it — a knowledge graph — that an agent can query for more structured, connected answers. It runs on your own machine or server via pip install cognee, and it is free.

📌Note: This review is the deep-dive companion to cognee's entry in the Local LLM Software Directory — see that page for how cognee compares at a glance to dozens of other local and self-hosted AI tools.

What Is cognee?

cognee is a Python library that gives AI agents and applications persistent, structured memory by transforming raw text, code, and conversation history into a queryable knowledge graph. Its own GitHub description positions it as an open-source AI memory platform for enabling persistent memory across agent sessions, built by ingesting data through a pipeline that extracts entities and relationships rather than only embedding flat chunks of text.

  • Product type: a self-hosted Python library and pipeline framework, not a standalone downloadable app or a fully managed SaaS by default
  • Creator: Topoteretes UG (haftungsbeschränkt), a Berlin-registered company; managing director Vasilije Markovic
  • Repository: github.com/topoteretes/cognee
  • License: Apache-2.0, confirmed via the repository's license file
  • Locality: hybrid — the knowledge-graph engine, vector store, and any local databases run on your own infrastructure, but text sent for entity extraction, enrichment, and embedding is by default routed to whichever external LLM/embedding provider you configure; cognee also documents support for routing that processing through a local Ollama model instead
  • Scale: over 30,700 GitHub stars, and cognee's own site cites more than 5 million SDK runs per month as of this review

cognee's Project History

cognee is developed and maintained by Topoteretes, a Berlin-based company, with the project publicly positioned as an "AI memory platform for agents." This review verified the company name, headquarters city, and current scale (star count, monthly SDK run volume) directly from cognee's own site and GitHub repository, but did not find a specific, dated public announcement of the project's initial launch date to cite here — check the GitHub repository's commit history directly if you need that level of detail.

  • cognee positions itself around an Extract-Cognify-Load–style pipeline: ingest data, build a knowledge graph and enrichment layer from it ("cognify"), then make that graph queryable — the current SDK exposes this as add(), cognify(), and search(), with newer remember()/recall() wrapper functions layered on top for simpler use
  • cognee reports over 5 million SDK runs per month and named production users including Bayer (research memory), Knowunity, SlideSpeak, and the University of Wyoming, per cognee's own site
  • Cognee Cloud, a separate managed offering, was introduced as an optional path for teams that want the same memory layer without self-hosting the engine

What Can You Do With cognee?

cognee's feature set centers on turning unstructured data into a structured, queryable memory layer for agents and applications, per cognee's own GitHub README and documentation.

  • Knowledge graph construction — cognee extracts entities, relationships, and structure from text and code and builds a graph out of it, rather than only storing flat embedding vectors
  • Multi-format ingestion — documents, source code, and conversation history can all be fed into the same pipeline
  • Automatic retrieval routing — cognee's search layer selects a retrieval strategy (graph traversal, vector similarity, or a hybrid) based on the query, instead of requiring you to hand-pick one
  • Session memory with background sync — conversational context can be held in session memory and synchronized into the permanent graph in the background
  • Graph visualization and custom ontologies — you can inspect the built graph visually and define your own ontology so extraction follows your domain's specific entity and relationship types
  • Hybrid locality with local-model support — cognee's own default flow sends data to a configured external LLM/embedding provider for processing, but it documents support for pointing that processing at a local Ollama instance instead, keeping the whole pipeline on your own hardware
  • Agent and IDE integrations — documented integrations include Claude Code (as a memory plugin), Cursor, Cline, LangGraph, CrewAI, OpenClaw, and Model Context Protocol (MCP) support for connecting cognee as a tool to MCP-compatible clients

Usage Examples: Three Ways to Use cognee

These are concrete workflows built from cognee's documented Python API, run after pip install cognee.

  • Build memory from a piece of text and query it: run pip install cognee, then call cognee.remember(text) to ingest and cognee.recall(query_text=...) to query — cognee's own documentation describes remember() as running ingestion, chunking, entity extraction, and graph building in one step, and recall() as auto-routing the query to the best retrieval strategy
  • Use the lower-level ECL-style pipeline directly for more control: call cognee.add(data) to ingest raw text or files, cognee.cognify() to run entity/relationship extraction and build the knowledge graph, then cognee.search(query_text=...) to query it — useful when you want to inspect or customize what happens at each pipeline stage rather than using the single-call remember()/recall() wrappers
  • Point cognee at a local Ollama model instead of a cloud LLM/embedding provider: cognee's configuration supports setting the LLM and embedding provider to a local Ollama endpoint, so the entity-extraction and embedding steps run on your own hardware instead of calling out to an external API — check cognee's own configuration documentation for the current environment-variable names before wiring this into a project, since provider configuration details can change between releases
python
import asyncio
import cognee

async def main():
    text = "cognee turns documents into AI memory."
    await cognee.remember(text)
    results = await cognee.recall(query_text="What does cognee do?")
    for result in results:
        print(result.text)

asyncio.run(main())

cognee Pricing: Is cognee Really Free?

The open-source cognee engine is free and Apache-2.0 licensed — there is no paid tier gating any feature of the library itself. Cognee Cloud is a separate, optional managed offering for teams that want the same memory layer without self-hosting the engine; cognee's own site does not publish detailed Cognee Cloud pricing on its homepage, so check cognee.ai directly for current managed-tier pricing before assuming a specific figure.

  • Open-source engine: free, Apache-2.0, no usage limits imposed by cognee itself
  • Your own costs still include whatever your configured external LLM/embedding provider charges for the API calls cognee makes during cognify()/remember() — or nothing extra beyond your own hardware if you route that processing through a local Ollama model
  • Cognee Cloud: a separate, optional managed offering; cognee's own site directs interested teams to "move to Cognee Cloud when you need managed scale" without listing exact tier pricing on the main page
  • No account or sign-up is required to install and use the open-source library

cognee vs. Langchain-Chatchat

cognee and Langchain-Chatchat both help you build retrieval-augmented applications on your own data, but they solve different layers of the problem. Langchain-Chatchat is a ready-to-run, self-hosted RAG chat application built on LangChain, aimed at getting a working document-chat UI running quickly. cognee is a lower-level memory library you integrate into your own agent or application code, and its core differentiator is building a knowledge graph — entities and their relationships — rather than only chunking documents into a flat vector index.

What it is

cognee:
A memory library (knowledge graph + retrieval) you integrate into your own code
Langchain-Chatchat:
A ready-to-run, self-hosted RAG chat application

Retrieval approach

cognee:
Knowledge graph plus automatic retrieval-strategy routing (graph, vector, or hybrid)
Langchain-Chatchat:
Primarily vector-similarity retrieval over chunked documents

Interface

cognee:
Python API and MCP server — no built-in chat UI
Langchain-Chatchat:
Built-in web chat UI

Best fit

cognee:
Developers building agent memory or a custom knowledge-graph-backed retrieval layer
Langchain-Chatchat:
Teams that want a working document-chat app without building one from scratch

License

cognee:
Apache-2.0
Langchain-Chatchat:
Apache-2.0

These tools are not mutually exclusive — a Langchain-Chatchat-style application could, in principle, use cognee as its underlying memory/retrieval layer instead of a flat vector store. Verify current feature sets on each project's own repository before choosing, since both ship updates frequently.

Who Should Use cognee?

Whether cognee fits depends on whether you are writing code that needs structured, connected memory, rather than looking for a ready-made chat application.

Competitors and Alternatives

cognee sits in the RAG-and-agent-memory layer, alongside orchestration frameworks and other retrieval frameworks that developers commonly evaluate together. These are not identical products — some are broader orchestration frameworks, others are narrower retrieval libraries — but they compete for the same "how do I give my LLM app structured access to my data" decision.

LangChain

Best known for:
General-purpose LLM application framework with a large ecosystem of retrieval and agent integrations
Articles about LangChain (10)

+29 more not shown

Haystack (deepset)

Best known for:
Open-source RAG and search pipeline framework from deepset

txtai

Best known for:
Lightweight embedded vector database and semantic search library
Articles about txtai (1)

Also mentioned in:

This is not an exhaustive list of memory and retrieval tools — see the Local LLM Software Directory for the full, regularly updated catalog, including cognee's own directory entry.

Common Mistakes When Evaluating cognee

Most confusion about cognee comes from assuming it is a fully local tool by default, confusing it with a plain vector database, or assuming a specific API function is stable long-term.

Frequently Asked Questions

What is cognee?

cognee (cognee.ai, source at github.com/topoteretes/cognee) is a free, open-source (Apache-2.0) Python library that gives AI agents persistent memory by building a self-hosted knowledge graph out of documents, code, and conversations.

Is cognee free?

Yes, the open-source cognee engine is free and Apache-2.0 licensed, with no paid tier gating any library feature. Cognee Cloud is a separate, optional managed offering with its own, separately priced tier — check cognee.ai for current pricing.

How do I install cognee?

Run pip install cognee (or uv pip install cognee if you use uv). It requires a Python environment and, for the default flow, an API key for your configured LLM/embedding provider, or a running local Ollama instance if configured for local processing.

Does cognee run fully offline?

Not by default. cognee's locality is hybrid — the knowledge-graph engine and storage are self-hosted, but default LLM/embedding calls go to an external provider you configure. cognee documents support for routing that processing through a local Ollama model instead, for a fully local setup.

How is cognee different from a plain RAG/vector-database setup?

A plain RAG setup typically chunks documents and retrieves them by vector similarity alone. cognee additionally extracts entities and relationships from your data into a knowledge graph, then automatically routes queries to graph traversal, vector similarity, or a hybrid strategy, aiming for more structured, connected retrieval.

What is the cognee API for ingesting and querying data?

The current quickstart shows cognee.remember(text) to ingest and cognee.recall(query_text=...) to query. The lower-level pipeline underneath is cognee.add() (ingest), cognee.cognify() (build the graph), and cognee.search() (query), for more granular control.

Who builds cognee?

cognee is built by Topoteretes UG (haftungsbeschränkt), a Berlin-based company led by managing director Vasilije Markovic.

What license does cognee use?

Apache-2.0, confirmed via the GitHub repository.

Can cognee use local models via Ollama?

Yes. While cognee's default flow routes LLM and embedding calls to a configured external provider, it also documents support for pointing that processing at a local Ollama instance instead.

What agent tools and IDEs does cognee integrate with?

Documented integrations include Claude Code (as a memory plugin), Cursor, Cline, LangGraph, CrewAI, OpenClaw, and Model Context Protocol (MCP) support for connecting cognee as a tool to MCP-compatible clients.

How does cognee compare to LangChain or LlamaIndex?

LangChain and LlamaIndex are broader LLM-application and data-indexing frameworks that can incorporate many retrieval backends. cognee is narrower and more specific: a memory library centered on building and querying a knowledge graph, which can be used alongside frameworks like LangChain rather than strictly instead of them.

Sources

← Back to Power Local LLM