cognee
Cognee - is a library for enriching LLM context with a semantic layer for better understanding and reasoning.
What it is and what it does
Cognee is an open-source AI memory platform that ingests data in any format and builds a self-hosted knowledge graph to give AI agents persistent long-term memory across sessions. It combines vector embeddings, graph reasoning, and cognitive-science-grounded ontology generation so documents are searchable by meaning and connected by relationships that evolve over time. The platform exposes four core operations—remember (store in graph), recall (query with auto-routing), forget (delete), and improve (refine)—plus a CLI and Docker deployment option. It integrates with LLM providers via LiteLLM and supports multimodal ingestion, session-scoped memory caching, and cross-agent knowledge sharing.
The package is designed for building company knowledge bases, enabling agents with domain expertise, and supporting reliable, trustworthy agent deployments with user/tenant isolation and audit trails. It runs locally by default but can be deployed as a containerized API server. The 44 runtime dependencies include FastAPI for the server, LanceDB for vector storage, Pydantic for configuration, and instructor for LLM-guided parsing; the dependency footprint is substantial but reflects a full-stack knowledge infrastructure rather than a lightweight library.
Use it for:
- Build a persistent knowledge base for a multi-turn chatbot or agent that recalls context across separate conversations.
- Ingest company documents (PDFs, emails, wikis) into a unified graph and let agents query domain knowledge with semantic search.
- Integrate Cognee memory into Claude Code or other AI coding assistants to preserve coding context and decisions across sessions.
- Deploy a self-hosted knowledge graph API for multiple agents or tenants with isolated memory and audit trails.
- Prototype agentic workflows that learn from feedback and improve reasoning by connecting new insights to existing knowledge.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cognee builds a self-hosted knowledge graph from ingested data, giving AI agents persistent long-term memory across sessions with vector search, graph reasoning, and ontology grounding.
Yes. Cognee is actively maintained (30023 stars, last commit 2026-08-14), has low install friction, carries no known vulnerabilities, and offers a permissive Apache-2.0 license. It solves a real problem—persistent, searchable memory for AI agents—with a mature feature set (graph + vector search, multimodal ingestion, session memory, CLI, Docker support). The 44 dependencies are substantial but justified by the full-stack nature of the platform. Install if you need agent memory infrastructure; skip if you only need lightweight semantic search or simple vector storage.
Install
cognee on PyPI
pip
pip install cogneeuv
uv add cogneepoetry
poetry add cogneeInstalling cognee
Before you install
Low friction install with a pure-Python wheel. Active maintenance (last commit 2026-08-14) and strong community signal (30023 stars). Requires Python 3.10–3.14 and 44 runtime dependencies including FastAPI, LanceDB, LiteLLM, and OpenAI; no compiled dependencies block installation.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for proprietary projects and commercial deployments.
Quickstart
import cognee
import asyncio
async def main():
await cognee.remember("Cognee turns documents into AI memory.")
results = await cognee.recall("What does Cognee do?")
for result in results:
print(result)
asyncio.run(main())
Requires Python 3.10–3.14 and LLM_API_KEY environment variable (e.g., OpenAI API key) to function; Docker optional but recommended for the CLI UI.
Verify before relying
- Whether the 44 runtime dependencies can be selectively installed or if all are required for basic usage.
- Performance characteristics and scalability limits for knowledge graph size and query latency.
- Whether session memory and permanent graph storage can use different backends (e.g., local cache vs. remote database).
- Exact ontology generation mechanism and how it evolves as knowledge changes.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 44 — aiofiles, aiohttp, aiolimiter, aiosqlite, alembic, cbor2, cryptography, datamodel-code-generator, diskcache, fakeredis, fastapi-users, fastapi, filelock, filetype, gunicorn, instructor, jinja2, ladybug, lancedb, langdetect, limits, litellm, nbformat, networkx, numpy, openai, pydantic-settings, pydantic, pylance, pympler |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 195,178/month — #9,820 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cognee-1.4.2-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
reme-aiReMe is a local-first knowledge base that…
permissive · top 15,000 on PyPI
stashaiStash is a CLI and MCP server that creates a…
permissive · top 15,000 on PyPI
graphiti-coreGraphiti builds and queries temporal context…
permissive · top 5,000 on PyPI
hindsight-api-slimHindsight-api-slim provides a persistent memory…
permissive · top 15,000 on PyPI
agent-utilitiesA batteries-included harness for building…
permissive · top 15,000 on PyPI
lance-contextProvides Python bindings for multimodal,…
permissive · top 15,000 on PyPI
mempalaceMemPalace stores conversation history and…
permissive · top 15,000 on PyPI
zep-pythonZep is a long-term memory service for AI…
unclear · top 15,000 on PyPI
gpt-researcherGPT Researcher is an autonomous agent that…
permissive · top 15,000 on PyPI
mindroomMindRoom is a multi-agent runtime that deploys…
permissive · top 15,000 on PyPI