{"id":"20b23799-4090-4c8f-a4b7-6962cc54c11f","slug":"topoteretes-cognee","kind":"skill","name":"cognee","summary":"Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory with small models for free","owner":"topoteretes","repoUrl":"https://github.com/topoteretes/cognee","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":32232,"match":null,"fewStars":false,"format":"skill","createdAt":null,"addedAt":"2026-10-14T05:20:42.171Z","logoUrl":"https://avatars.githubusercontent.com/u/125468716?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["memory-knowledge","databases","search"],"tags":["ai","cognitive-architecture","vector-database","ai-agents","graph-database","ai-memory","cognitive-memory","knowledge"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-14T06:01:25.169Z","sample":false,"url":"https://conduits.dev/tools/topoteretes-cognee","language":"Python","transports":["stdio"],"install":{"pypi":"cognee"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<div align=\"center\">\n  <a href=\"https://github.com/topoteretes/cognee\">\n    <img src=\"assets/cognee-logo.svg\" alt=\"Cognee Logo\" width=\"260\">\n  </a>\n\n  <br />\n\n  <p>Cognee - The Free Open-Source AI Memory Platform for Agents</p>\n\n  <p align=\"center\">\n  <a href=\"https://www.youtube.com/watch?v=8hmqS2Y5RVQ&t=13s\">Demo</a>\n  .\n  <a href=\"https://docs.cognee.ai/\">Docs</a>\n  .\n  <a href=\"https://cognee.ai\">Learn More</a>\n  ·\n  <a href=\"https://discord.gg/NQPKmU5CCg\">Join Discord</a>\n  ·\n  <a href=\"https://www.reddit.com/r/AIMemory/\">Join r/AIMemory</a>\n  .\n  <a href=\"https://github.com/topoteretes/cognee-community\">Community Plugins & Add-ons</a>\n  </p>\n\n\n  <p>\n  <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>\n  <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>\n  <a href=\"https://GitHub.com/topoteretes/cognee/commit/\"><img src=\"https://badgen.net/github/commits/topoteretes/cognee\" alt=\"GitHub commits\"></a>\n  <a href=\"https://github.com/topoteretes/cognee/tags/\"><img src=\"https://badgen.net/github/tag/topoteretes/cognee\" alt=\"GitHub tag\"></a>\n  <a href=\"https://pepy.tech/project/cognee\"><img src=\"https://static.pepy.tech/badge/cognee\" alt=\"Downloads\"></a>\n  <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>\n  <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>\n  <a href=\"https://github.com/sponsors/topoteretes\"><img src=\"https://img.shields.io/badge/Sponsor-❤️-ff69b4.svg\" alt=\"Sponsor\"></a>\n  </p>\n\n<p>\n  <a href=\"https://trendshift.io/repositories/13955\" target=\"_blank\" style=\"display:inline-block;\">\n    <img src=\"https://trendshift.io/api/badge/repositories/13955\" alt=\"topoteretes%2Fcognee | Trendshift\" width=\"250\" height=\"55\" />\n  </a>\n</p>\n\n  <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>\n\n  <p><strong>Runs locally for free — no API key required.</strong><br />\n  We rely on free small models that use your CPU.</p>\n\n  <p align=\"center\">\n  🌐 This README is also available in:<br />\n  <!-- Keep these links. Translations will automatically update with the README. -->\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=de\">Deutsch</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=es\">Español</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=fr\">Français</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=ja\">日本語</a> |\n  <a href=\"README_ko.md\">한국어</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=pt\">Português</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=ru\">Русский</a> |\n  <a href=\"https://www.readme-i18n.com/topoteretes/cognee?lang=zh\">中文</a>\n  </p>\n\n<p align=\"center\">\n  <img src=\"assets/cognee-demo.gif\" alt=\"Cognee Demo\" width=\"80%\" />\n</p>\n</div>\n\n📄 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\n\n## When to use Cognee\n\n- **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).\n- **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).\n- **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).\n\n## Choose your starting point\n\n| I want to… | Start here |\n| --- | --- |\n| Build memory without an LLM | [Local Python quickstart](#run-locally-without-an-llm) |\n| Explore a prebuilt graph without downloading models | [Bundled demo](#explore-the-bundled-demo) |\n| Generate answers with a local or hosted LLM | [Optional LLM setup](#optional-configure-the-llm) |\n| Give an existing agent memory | [Plugins and MCP](#connect-your-agent) |\n| Run Cognee on my infrastructure | [Deployment options](#deploy-cognee) |\n| Use a managed service | [Cognee Cloud](https://docs.cognee.ai/cognee-cloud/overview) |\n\n## Quickstart\n\nRequires **Python 3.10–3.14**.\n\n**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:\n\n```bash\nuv pip install \"cognee[gliner]\"\n```\n\n### Run locally without an LLM\n\n**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.\n\nSave this as `quickstart.py` and run `python quickstart.py` if you are feeling old school, or tell your LLM to do it:\n\n```python\nimport asyncio\n\nimport cognee\n\n\nasync def main():\n    # Extract a knowledge graph and embed the text with local models.\n    await cognee.remember(\n        \"Marie Curie was born in Warsaw and worked at the University of Paris.\",\n        dataset_name=\"local_quickstart\",\n    )\n\n    # Retrieve the matching source text; no LLM generates an answer.\n    results = await cognee.recall(\n        \"Where was Marie Curie born?\",\n        datasets=[\"local_quickstart\"],\n    )\n    for result in results:\n        print(result)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\nThe same workflow is available from the CLI:\n\n```bash\ncognee-cli remember \"Marie Curie was born in Warsaw.\" -d local_quickstart\ncognee-cli recall \"Where was Marie Curie born?\" -d local_quickstart\n```\n\nText ingestion, retrieval, and session storage work without an LLM. LLM-dependent improvement stages skip automatically.\n\nGenerated answers and media processing that requires a vision or transcription model need additional LLM configuration.\n\nThe 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).\n\n### Optional: Configure the LLM\n\n**3. Add an LLM** to get generated answers instead of retrieved passages:\n\n```python\nimport os\n\nos.environ[\"LLM_API_KEY\"] = \"YOUR OPENAI_API_KEY\"\n```\nAlternatively, create a `.env` file using our [template](https://github.com/topoteretes/cognee/blob/main/.env.template).\n\nOnce 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.\n\n\n\n### Explore the bundled demo\n\nTo explore a prebuilt graph without downloading extraction or embedding models:\n\n```bash\ncognee-cli demo\n```\n\nThis 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.\n\n\n\n## How Cognee works\n\nCognee 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.\n\n<p align=\"center\">\n  <img src=\"assets/remember.svg\" alt=\"Text, code, and session guidance follow their ingestion paths into persistent Cognee memory\" width=\"100%\">\n</p>\n\nAt 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.\n\n<p align=\"center\">\n  <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%\">\n</p>\n\n| Operation | What it does | Learn more |\n| --- | --- | --- |\n| `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) |\n| `recall` | Retrieve context and answers, using automatic routing or a chosen search strategy. | [Query memory](https://docs.cognee.ai/core-concepts/main-operations/recall) |\n| `improve` | Enrich memory, apply feedback, and bridge session knowledge into the graph. | [Improve memory](https://docs.cognee.ai/core-concepts/main-operations/improve) |\n| `forget` | Remove a specific item or dataset. | [Delete memory](https://docs.cognee.ai/core-concepts/main-operations/forget) |\n\nExplore the [architecture](https://docs.cognee.ai/core-concepts/architecture) and [session lifecycle](https://docs.cognee.ai/core-concepts/sessions-and-caching).\n\n## Connect your agent\n\nInstall the Claude Code plugin:\n\n```bash\nclaude plugin marketplace add topoteretes/cognee-integrations\nclaude plugin install cognee-memory@cognee\n```\n\nOr install the Codex plugin. Enable hooks first, either with the CLI:\n\n```bash\ncodex features enable hooks\n```\n\nor in `~/.codex/config.toml`:\n\n```toml\n[features]\nhooks = true\n```\n\nThen add the marketplace and the plugin:\n\n```bash\ncodex plugin marketplace add topoteretes/cognee-integrations --ref main\ncodex plugin add cognee@cognee\n```\n\nFollow the [plugin setup guide](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/claude-code) to configure local or remote memory.\n\n| Interface | Start here |\n| --- | --- |\n| Claude Code memory plugin | [Install and configure the plugin](https://github.com/topoteretes/cognee-integrations/tree/main/integrations/claude-code) |\n| OpenClaw memory plugin | [Install `@cognee/cognee-openclaw`](https://www.npmjs.com/package/@cognee/cognee-openclaw) |\n| Cursor, Cline, and other MCP clients | [Cognee MCP guide](https://docs.cognee.ai/cognee-mcp/mcp-overview) and [server README](cognee-mcp/README.md) |\n| Python applications | [Python API reference](https://docs.cognee.ai/python-api) |\n| TypeScript applications | [TypeScript SDK](https://docs.cognee.ai/typescript/getting-started) |\n| Rust applications | [Cognee-RS](https://github.com/topoteretes/cognee-rs) |\n| Applications using HTTP | [REST API reference](https://docs.cognee.ai/api-reference/introduction) |\n\nBrowse 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.\n\nTo inspect a local installation in the UI:\n\n```bash\ncognee-cli -ui\n```\n\nThe UI launcher requires Node.js/npm; Docker is needed for its MCP service. See [local UI setup](https://docs.cognee.ai/cognee-cli/overview).\n\n## Explore examples\n\n- [Build a small Company Brain from text, code, and session lessons](examples/cookbooks/company_brain/docs_code_conversations/company_brain_demo.py).\n- [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.\n- [Import memory from Mem0, Letta, Zep, or Graphiti](https://docs.cognee.ai/examples/migrate-memory-systems) using the COGX exchange format.\n- [Run with local Ollama models](https://docs.cognee.ai/guides/local-ollama), including a local embedding model.\n- [Visualize your knowledge graph](https://docs.cognee.ai/guides/graph-visualization) and inspect its connections.\n- [Browse runnable examples](examples/README.md) for ingestion, sessions, feedback, and custom pipelines.\n- [Run the prebuilt API with Docker Compose](docs/minimal-docker-compose.md) or use the [deployment templates](distributed/deploy/README.md).\n- [Explore community adapters and add-ons](https://github.com/topoteretes/cognee-community).\n\n<a id=\"run-with-docker\"></a>\n\n## Deploy Cognee\n\nFor 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:\n\n```bash\ndocker run --rm -it -p 8000:8000 \\\n  -e LLM_API_KEY=\"sk-...\" \\\n  -e ENABLE_BACKEND_ACCESS_CONTROL=false \\\n  -v cognee_storage:/cognee-storage \\\n  cognee/cognee:main\n```\n\n`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.\n\nTo 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:\n\n```bash\ndocker compose --profile ui --profile mcp up\n```\n\nThe 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.\n\nThe `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.\n\n## Run the Whole Memory Layer on Postgres\n\nGraph 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.\n\n> **⚠️ 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.\n\n<a id=\"benchmarks\"></a>\n\n## Benchmarks and research\n\nThe [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.\n\n| BEAM context | Reported score (0–1) | Scope |\n| --- | --- | --- |\n| 100K tokens | **0.79** | Fixed hybrid retrieval; four evaluation rounds over 20 questions from one held-out conversation. |\n| 10M tokens | **0.67** | Exploratory result; question-type routing selected and scored on the same question set, averaged over five rounds. |\n\nThe 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.\n\nFor 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).\n\n## Latest News\n\n[![Watch Demo](https://img.youtube.com/vi/8hmqS2Y5RVQ/maxresdefault.jpg)](https://www.youtube.com/watch?v=8hmqS2Y5RVQ&t=13s)\n\n- **[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.\n- 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.\n- **[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.\n\n\n## Community & Support\n\n### Contributing\nWe welcome contributions from the community! Your input helps make Cognee better for everyone. See [`CONTRIBUTING.md`](CONTRIBUTING.md) to get started.\n\n### Code of Conduct\n\nWe'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.\n\n## Research & Citation\n\nWe recently published a research paper on optimizing knowledge graphs for LLM reasoning:\n\n```bibtex\n@misc{markovic2025optimizinginterfaceknowledgegraphs,\n      title={Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning},\n      author={Vasilije Markovic and Lazar Obradovic and Laszlo Hajdu and Jovan Pavlovic},\n      year={2025},\n      eprint={2505.24478},\n      archivePrefix={arXiv},\n      primaryClass={cs.AI},\n      url={https://arxiv.org/abs/2505.24478},\n}\n```\n"}