topoteretes/cognee
🔗 https://github.com/topoteretes/cognee ↗Cognee - The Free Open-Source AI Memory Platform for Agents Demo . Docs . Learn More · Join Discord · Join r/AIMemory . Community Plugins & Add-ons 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. Runs locally for free — no API key required. We rely on free small models that use your CPU. 🌐 This README is also available in: Deutsch | Español | Français | 日本語 | 한국어 | Português | Русский | 中文 📄 Read the research paper: Optimizing the Interface Between Knowledge Graphs and LLMs for Complex Reasoning — Markovic et al., 2025 When to use Cognee 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 . 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 . Ground agents in your domain. Structure memory around the entities and relationships your application needs, with custom data models and ontologies. Explore ontologies . Choose your starting point 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 Quickstart 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 . 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 . 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. 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. How Cognee works 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 . Connect your agent 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 cognee@cognee Follow the plugin setup guide to configure local or remote memory. Interface Start here Claude Code memory plugin Install and configure the plugin OpenClaw memory plugin Install @cognee/cognee-openclaw Cursor, Cline, and other MCP clients Cognee MCP guide and server README Python applications Python API reference TypeScript applications TypeScript SDK Rust applications Cognee-RS Applications using HTTP REST API reference Browse the integrations repository for agent frameworks, plugins, and source connectors. Each guide describes its setup and memory capture behavior. To inspect a local installation in the UI: cognee-cli -ui The UI launcher requires Node.js/npm; Docker is needed for its MCP service. See local UI setup . Explore examples Build a small Company Brain from text, code, and session lessons . Build a Company Brain from a database, a ticket export, and meeting notes , then browse it in the UI and query it from Claude Code or Codex. Import memory from Mem0, Letta, Zep, or Graphiti using the COGX exchange format. Run with local Ollama models , including a local embedding model. Visualize your knowledge graph and inspect its connections. Browse runnable examples for ingestion, sessions, feedback, and custom pipelines. Run the prebuilt API with Docker Compose or use the deployment templates . Explore community adapters and add-ons . Deploy Cognee For a local API demo using a prebuilt image, follow the minimal Docker Compose guide . It includes a persistent-volume configuration and explains the single-user demo settings. Or run the image directly: docker run --rm -it -p 8000:8000 \ -e LLM_API_KEY= " sk-... " \ -e ENABLE_BACKEND_ACCESS_CONTROL=false \ -v cognee_storage:/cognee-storage \ cognee/cognee:main 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 ). Note that --rm discards container-local data on exit; the -v cognee_storage:/cognee-storage named volume keeps your memory across runs. To run the API, UI, and MCP server from a source checkout, clone this repository, enter its directory, copy .env.template to .env , and configure your providers. Then run: docker compose --profile ui --profile mcp up The default ports are API 8000 , UI 3000 , and MCP 8001 .
內容為收集當日抓取的 repo 描述原文,完整資訊請見 GitHub 原頁。