Skip to content
Back to search

cognee

Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory with small models for free

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/topoteretes/cognee with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/topoteretes/cognee'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/topoteretes-cognee/badge.svg)](/listings/topoteretes-cognee)

HTML

<a href="/listings/topoteretes-cognee"><img src="/api/listings/topoteretes-cognee/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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]"

Run locally without an LLM

**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](mailto:social@cognee.ai).

Optional: Configure the LLM

**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](https://github.com/topoteretes/cognee/blob/main/.env.template).

Once a key is set, Cognee uses OpenAI for language models and embeddings, and processing and generated answers make provider calls. See [installation](https://docs.cognee.ai/getting-started/installation), [other providers](https://docs.cognee.ai/setup-configuration/llm-providers), or [local Ollama models](https://docs.cognee.ai/guides/local-ollama) for other setups.

Explore the bundled demo

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.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 331 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <a href="https://github.com/topoteretes/cognee">
  3. <img src="assets/cognee-logo.svg" alt="Cognee Logo" width="260">
  4. </a>
  5. <br />
  6. <p>Cognee - The Free Open-Source AI Memory Platform for Agents</p>
  7. <p align="center">
  8. <a href="https://www.youtube.com/watch?v=8hmqS2Y5RVQ&t=13s">Demo</a>
  9. .
  10. <a href="https://docs.cognee.ai/">Docs</a>
  11. .
  12. <a href="https://cognee.ai">Learn More</a>
  13. ·
  14. <a href="https://discord.gg/NQPKmU5CCg">Join Discord</a>
  15. ·
  16. <a href="https://www.reddit.com/r/AIMemory/">Join r/AIMemory</a>
  17. .
  18. <a href="https://github.com/topoteretes/cognee-community">Community Plugins & Add-ons</a>
  19. </p>
  20. <p>
  21. <a href="https://GitHub.com/topoteretes/cognee/network/"><img src="https://img.shields.io/github/forks/topoteretes/cognee.svg?style=social&amp;label=Fork&amp;maxAge=2592000" alt="GitHub forks"></a>
  22. <a href="https://github.com/topoteretes/cognee"><img src="https://img.shields.io/github/stars/topoteretes/cognee.svg?style=social&amp;label=Star&amp;maxAge=2592000" alt="GitHub stars"></a>
  23. <a href="https://GitHub.com/topoteretes/cognee/commit/"><img src="https://badgen.net/github/commits/topoteretes/cognee" alt="GitHub commits"></a>
  24. <a href="https://github.com/topoteretes/cognee/tags/"><img src="https://badgen.net/github/tag/topoteretes/cognee" alt="GitHub tag"></a>
  25. <a href="https://pepy.tech/project/cognee"><img src="https://static.pepy.tech/badge/cognee" alt="Downloads"></a>
  26. <a href="https://github.com/topoteretes/cognee/blob/main/LICENSE"><img src="https://img.shields.io/github/license/topoteretes/cognee?colorA=00C586&amp;colorB=000000" alt="License"></a>
  27. <a href="https://github.com/topoteretes/cognee/graphs/contributors"><img src="https://img.shields.io/github/contributors/topoteretes/cognee?colorA=00C586&amp;colorB=000000" alt="Contributors"></a>
  28. <a href="https://github.com/sponsors/topoteretes"><img src="https://img.shields.io/badge/Sponsor-❤️-ff69b4.svg" alt="Sponsor"></a>
  29. </p>
  30. <p>
  31. <a href="https://trendshift.io/repositories/13955" target="_blank" style="display:inline-block;">
  32. <img src="https://trendshift.io/api/badge/repositories/13955" alt="topoteretes%2Fcognee | Trendshift" width="250" height="55" />
  33. </a>
  34. </p>
  35. <p>Cognee is a free open-source AI memory platform that gives AI agents persistent long-term memory across sessions. Turn documents, code, and conversations into a self-hosted knowledge graph your agents can search and reuse.</p>
  36. <p><strong>Runs locally for free — no API key required.</strong><br />
  37. We rely on free small models that use your CPU.</p>
  38. <p align="center">
  39. 🌐 This README is also available in:<br />
  40. <!-- Keep these links. Translations will automatically update with the README. -->
  41. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=de">Deutsch</a> |
  42. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=es">Español</a> |
  43. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=fr">Français</a> |
  44. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=ja">日本語</a> |
  45. <a href="README_ko.md">한국어</a> |
  46. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=pt">Português</a> |
  47. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=ru">Русский</a> |
  48. <a href="https://www.readme-i18n.com/topoteretes/cognee?lang=zh">中文</a>
  49. </p>
  50. <p align="center">
  51. <img src="assets/cognee-demo.gif" alt="Cognee Demo" width="80%" />
  52. </p>
  53. </div>
  54. 📄 Read the research paper: [Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning](https://arxiv.org/abs/2505.24478) — Markovic et al., 2025
  55. ## When to use Cognee
  56. - **Build a Company Brain.** Bring documentation, conversations, tickets, code, and agent work into shared memory. Help your team and agents connect a decision to the discussion and implementation behind it. [Explore Company Brain](https://www.cognee.ai/company-brain).
  57. - **Give agents memory across runs.** Retain project context, past decisions, fixes, and learned rules. Distill useful session lessons into durable knowledge that another session can retrieve. [Connect your agent](#connect-your-agent).
  58. - **Ground agents in your domain.** Structure memory around the entities and relationships your application needs, with custom data models and ontologies. [Explore ontologies](https://docs.cognee.ai/guides/ontology-support).
  59. ## Choose your starting point
  60. | I want to… | Start here |
  61. | --- | --- |
  62. | Build memory without an LLM | [Local Python quickstart](#run-locally-without-an-llm) |
  63. | Explore a prebuilt graph without downloading models | [Bundled demo](#explore-the-bundled-demo) |
  64. | Generate answers with a local or hosted LLM | [Optional LLM setup](#optional-configure-the-llm) |
  65. | Give an existing agent memory | [Plugins and MCP](#connect-your-agent) |
  66. | Run Cognee on my infrastructure | [Deployment options](#deploy-cognee) |
  67. | Use a managed service | [Cognee Cloud](https://docs.cognee.ai/cognee-cloud/overview) |
  68. ## Quickstart
  69. Requires **Python 3.10–3.14**.
  70. **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:
  71. ```bash
  72. uv pip install "cognee[gliner]"
  73. ```
  74. ### Run locally without an LLM
  75. **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.
  76. Save this as `quickstart.py` and run `python quickstart.py` if you are feeling old school, or tell your LLM to do it:
  77. ```python
  78. import asyncio
  79. import cognee
  80. async def main():
  81. # Extract a knowledge graph and embed the text with local models.
  82. await cognee.remember(
  83. "Marie Curie was born in Warsaw and worked at the University of Paris.",
  84. dataset_name="local_quickstart",
  85. )
  86. # Retrieve the matching source text; no LLM generates an answer.
  87. results = await cognee.recall(
  88. "Where was Marie Curie born?",
  89. datasets=["local_quickstart"],
  90. )
  91. for result in results:
  92. print(result)
  93. if __name__ == "__main__":
  94. asyncio.run(main())
  95. ```
  96. The same workflow is available from the CLI:
  97. ```bash
  98. cognee-cli remember "Marie Curie was born in Warsaw." -d local_quickstart
  99. cognee-cli recall "Where was Marie Curie born?" -d local_quickstart
  100. ```
  101. Text ingestion, retrieval, and session storage work without an LLM. LLM-dependent improvement stages skip automatically.
  102. Generated answers and media processing that requires a vision or transcription model need additional LLM configuration.
  103. 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](mailto:social@cognee.ai).
  104. ### Optional: Configure the LLM
  105. **3. Add an LLM** to get generated answers instead of retrieved passages:
  106. ```python
  107. import os
  108. os.environ["LLM_API_KEY"] = "YOUR_OPENAI_API_KEY"
  109. ```
  110. Alternatively, create a `.env` file using our [template](https://github.com/topoteretes/cognee/blob/main/.env.template).
  111. Once a key is set, Cognee uses OpenAI for language models and embeddings, and processing and generated answers make provider calls. See [installation](https://docs.cognee.ai/getting-started/installation), [other providers](https://docs.cognee.ai/setup-configuration/llm-providers), or [local Ollama models](https://docs.cognee.ai/guides/local-ollama) for other setups.
  112. ### Explore the bundled demo
  113. To explore a prebuilt graph without downloading extraction or embedding models:
  114. ```bash
  115. cognee-cli demo
  116. ```
  117. 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.
  118. ## How Cognee works
  119. 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.
  120. <p align="center">
  121. <img src="assets/remember.svg" alt="Text, code, and session guidance follow their ingestion paths into persistent Cognee memory" width="100%">
  122. </p>
  123. 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.
  124. <p align="center">
  125. <img src="assets/recall.svg" alt="Recall retrieves a document fact, a code symbol, and a learned release rule for an agent's next task" width="100%">
  126. </p>
  127. | Operation | What it does | Learn more |
  128. | --- | --- | --- |
  129. | `remember` | Store content or code in permanent memory, or in a session when a session ID is supplied. | [Store memory](https://docs.cognee.ai/core-concepts/main-operations/remember) |
  130. | `recall` | Retrieve context and answers, using automatic routing or a chosen search strategy. | [Query memory](https://docs.cognee.ai/core-concepts/main-operations/recall) |
  131. | `improve` | Enrich memory, apply feedback, and bridge session knowledge into the graph. | [Improve memory](https://docs.cognee.ai/core-concepts/main-operations/improve) |
  132. | `forget` | Remove a specific item or dataset. | [Delete memory](https://docs.cognee.ai/core-concepts/main-operations/forget) |
  133. Explore the [architecture](https://docs.cognee.ai/core-concepts/architecture) and [session lifecycle](https://docs.cognee.ai/core-concepts/sessions-and-caching).
  134. ## Connect your agent
  135. Install the Claude Code plugin:
  136. ```bash
  137. claude plugin marketplace add topoteretes/cognee-integrations
  138. claude plugin install cognee-memory@cognee
  139. ```
  140. Or install the Codex plugin. Enable hooks first, either with the CLI:
  141. ```bash
  142. codex features enable hooks
  143. ```
  144. or in `~/.codex/config.toml`:
  145. ```toml
  146. [features]
  147. hooks = true
  148. ```
  149. Then add the marketplace and the plugin:
  150. ```bash
  151. codex plugin marketplace add topoteretes/cognee-integrations --ref main
  152. codex plugin add cognee@cognee
  153. ```
  154. Follow the setup guide for [Claude Code](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/claude-code) or [Codex](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/codex) to configure local or remote memory.
  155. | Interface | Start here |
  156. | --- | --- |
  157. | Claude Code memory plugin | [Install and configure the plugin](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/claude-code) |
  158. | Codex memory plugin | [Install and configure the plugin](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/codex) |
  159. | OpenClaw memory plugin | [Install `@cognee/cognee-openclaw`](https://www.npmjs.com/package/@cognee/cognee-openclaw) |
  160. | Cursor, Cline, and other MCP clients | [Cognee MCP guide](https://docs.cognee.ai/cognee-mcp/mcp-overview) and [server README](cognee-mcp/README.md) |
  161. | Python applications | [Python API reference](https://docs.cognee.ai/python-api) |
  162. | TypeScript applications | [TypeScript SDK](https://docs.cognee.ai/typescript/getting-started) |
  163. | Rust applications | [Cognee-RS](https://github.com/topoteretes/cognee-rs) |
  164. | Applications using HTTP | [REST API reference](https://docs.cognee.ai/api-reference/introduction) |
  165. Browse the [integrations repository](https://github.com/topoteretes/cognee-integrations) for agent frameworks, plugins, and source connectors. Each guide describes its setup and memory capture behavior.
  166. To inspect a local installation in the UI:
  167. ```bash
  168. cognee-cli -ui
  169. ```
  170. The UI launcher requires Node.js/npm; Docker is needed for its MCP service. See [local UI setup](https://docs.cognee.ai/cognee-cli/overview).
  171. ## Explore examples
  172. - [Build a small Company Brain from text, code, and session lessons](examples/cookbooks/company_brain/docs_code_conversations/company_brain_demo.py).
  173. - [Build a Company Brain from your database, ticket export, and docs](examples/cookbooks/company_brain/company_qa/) (or a sample company), then browse it in the UI and query it from Claude Code or Codex.
  174. - [Import memory from Mem0, Letta, Zep, or Graphiti](https://docs.cognee.ai/examples/migrate-memory-systems) using the COGX exchange format.
  175. - [Run with local Ollama models](https://docs.cognee.ai/guides/local-ollama), including a local embedding model.
  176. - [Visualize your knowledge graph](https://docs.cognee.ai/guides/graph-visualization) and inspect its connections.
  177. - [Browse runnable examples](examples/README.md) for ingestion, sessions, feedback, and custom pipelines.
  178. - [Run the prebuilt API with Docker Compose](docs/minimal-docker-compose.md) or use the [deployment templates](distributed/deploy/README.md).
  179. - [Explore community adapters and add-ons](https://github.com/topoteretes/cognee-community).
  180. <a id="run-with-docker"></a>
  181. ## Deploy Cognee
  182. For a local API demo using a prebuilt image, follow the [minimal Docker Compose guide](docs/minimal-docker-compose.md). It includes a persistent-volume configuration and explains the single-user demo settings. Or run the image directly:
  183. ```bash
  184. docker run --rm -it -p 8000:8000 \
  185. -e LLM_API_KEY="sk-..." \
  186. -e ENABLE_BACKEND_ACCESS_CONTROL=false \
  187. -v cognee_storage:/cognee-storage \
  188. cognee/cognee:main
  189. ```
  190. `ENABLE_BACKEND_ACCESS_CONTROL=false` is the single-user/local posture — without it the API defaults to multi-tenant mode and every `/api/v1` call requires an authenticated user. To keep authentication on instead, set `DEFAULT_USER_PASSWORD` to make the default account loginable (see the [compose guide](docs/minimal-docker-compose.md)). Note that `--rm` discards container-local data on exit; the `-v cognee_storage:/cognee-storage` named volume keeps your memory across runs.
  191. To run the API, UI, and MCP server from a source checkout, clone this repository, enter its directory, copy [`.env.template`](.env.template) to `.env`, and configure your providers. Then run:
  192. ```bash
  193. docker compose --profile ui --profile mcp up
  194. ```
  195. The default ports are API **8000**, UI **3000**, and MCP **8001**. For deployment beyond a local demo, configure authentication, persistent storage, and compatible backends using the [permissions guide](https://docs.cognee.ai/setup-configuration/permissions) and [deployment templates](distributed/deploy/README.md). [Cognee Cloud](https://docs.cognee.ai/cognee-cloud/overview) provides the managed option.
  196. The `cognee/cognee` image ships with the GLiNER runtime baked in, so text ingestion and retrieval work in Docker without an LLM key; the local extraction and embedding models download on first use. Set `LLM_API_KEY` (as above) when you want generated answers.
  197. ## Run the Whole Memory Layer on Postgres
  198. Graph memory traditionally means operating a stack — a graph database for relationships, a vector database for embeddings, Redis for sessions, and a relational database for metadata — all deployed, secured, and paid for before an agent remembers anything. Since cognee 1.0 you can run the entire memory layer on a single Postgres instance.
  199. > **⚠️ Warning:** Using Postgres as a graph store is currently released as a demo feature. The production-ready version is available as a licensed product. Use the demo to keep relational metadata, PGVector, and graph state working together in one Postgres service.
  200. <a id="benchmarks"></a>
  201. ## Benchmarks and research
  202. The [BEAM evaluation](cognee/eval_framework/beam/REPORT.md) measures conversational memory using synthetic long-context conversations and an LLM judge. The reported runs use Cognee's memory components with benchmark-specific data formatting, prompts, and retrieval configuration.
  203. | BEAM context | Reported score (0–1) | Scope |
  204. | --- | --- | --- |
  205. | 100K tokens | **0.79** | Fixed hybrid retrieval; four evaluation rounds over 20 questions from one held-out conversation. |
  206. | 10M tokens | **0.67** | Exploratory result; question-type routing selected and scored on the same question set, averaged over five rounds. |
  207. The two settings use different conversations, ingestion models, and retrieval-selection procedures. Read the [methodology, models, limitations, and reproduction instructions](cognee/eval_framework/beam/REPORT.md) before comparing these scores with other systems. The report also documents the remaining reproduction gap for the distributed 10M ingestion.
  208. For the research behind Cognee's graph/LLM interface, see [Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning](https://arxiv.org/abs/2505.24478) (Markovic et al., 2025).
  209. ## Latest News
  210. [![Watch Demo](https://img.youtube.com/vi/8hmqS2Y5RVQ/maxresdefault.jpg)](https://www.youtube.com/watch?v=8hmqS2Y5RVQ&t=13s)
  211. - **[v1.6.1 — Google Sync & Visualization](https://github.com/topoteretes/cognee/releases/tag/v1.6.1)** (September 24, 2026): Google Drive and Gmail OAuth connectors bundled in the SDK, `/visualize/json` streamed in chunks for large graphs, and the GLiNER installer moved off the event loop with CPU torch installed on first use.
  212. - Document `external_metadata` is stamped on every chunk and surfaced in hybrid retrieval. **Breaking:** `dlt` is now a core dependency — make sure it is installed if you manage dependencies by hand.
  213. - **[v1.6.0 — Keyless workflows & pipeline reliability](https://github.com/topoteretes/cognee/releases/tag/v1.6.0)** (September 18, 2026): build and search text memory with local models and no cloud LLM key; LLM-dependent improvement stages skip when no LLM is configured, and pipeline recovery preserves completed documents after crashes.
  214. ## Community & Support
  215. ### Contributing
  216. We welcome contributions from the community! Your input helps make Cognee better for everyone. See [`CONTRIBUTING.md`](CONTRIBUTING.md) to get started.
  217. ### Code of Conduct
  218. We're committed to fostering an inclusive and respectful community. Read our [Code of Conduct](https://github.com/topoteretes/cognee/blob/main/CODE_OF_CONDUCT.md) for guidelines.
  219. ## Research & Citation
  220. We recently published a research paper on optimizing knowledge graphs for LLM reasoning:
  221. ```bibtex
  222. @misc{markovic2025optimizinginterfaceknowledgegraphs,
  223. title={Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning},
  224. author={Vasilije Markovic and Lazar Obradovic and Laszlo Hajdu and Jovan Pavlovic},
  225. year={2025},
  226. eprint={2505.24478},
  227. archivePrefix={arXiv},
  228. primaryClass={cs.AI},
  229. url={https://arxiv.org/abs/2505.24478},
  230. }
  231. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.