topoteretes

cognee

Community topoteretes
Updated

Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory across sessions with a self-hosted knowledge graph engine.

cognee - Memory for AI Agents in 5 lines of code

Demo . Learn more ยท Join Discord

GitHub forksGitHub starsGitHub commitsGithub tagDownloadsLicenseContributors

Build dynamic Agent memory using scalable, modular ECL (Extract, Cognify, Load) pipelines.

More on use-cases and evals

Features

  • Interconnect and retrieve your past conversations, documents, images and audio transcriptions
  • Reduce hallucinations, developer effort, and cost.
  • Load data to graph and vector databases using only Pydantic
  • Manipulate your data while ingesting from 30+ data sources

Get Started

Get started quickly with a Google Colab notebook or starter repo

Contributing

Your contributions are at the core of making this a true open source project. Any contributions you make are greatly appreciated. See CONTRIBUTING.md for more information.

๐Ÿ“ฆ Installation

You can install Cognee using either pip, poetry, uv or any other python package manager.

With pip

pip install cognee

๐Ÿ’ป Basic Usage

Setup

import os
os.environ["LLM_API_KEY"] = "YOUR OPENAI_API_KEY"

You can also set the variables by creating .env file, using our template.To use different LLM providers, for more info check out our documentation

Simple example

This script will run the default pipeline:

import cognee
import asyncio


async def main():
    # Add text to cognee
    await cognee.add("Natural language processing (NLP) is an interdisciplinary subfield of computer science and information retrieval.")

    # Generate the knowledge graph
    await cognee.cognify()

    # Query the knowledge graph
    results = await cognee.search("Tell me about NLP")

    # Display the results
    for result in results:
        print(result)


if __name__ == '__main__':
    asyncio.run(main())

Example output:

  Natural Language Processing (NLP) is a cross-disciplinary and interdisciplinary field that involves computer science and information retrieval. It focuses on the interaction between computers and human language, enabling machines to understand and process natural language.
  

Graph visualization:Open in browser.

For more advanced usage, have a look at our documentation.

Understand our architecture

Demos

  1. What is AI memory:

Learn about cognee

  1. Simple GraphRAG demo

Simple GraphRAG demo

  1. cognee with Ollama

cognee with local models

Code of Conduct

We are committed to making open source an enjoyable and respectful experience for our community. See CODE_OF_CONDUCT for more information.

๐Ÿ’ซ Contributors

Star History

Star History Chart

MCP Server ยท Populars

MCP Server ยท New

    jackccrawford

    Geniuz

    Your AI remembers now. Geniuz stores everything in a local database locally on Mac, Windows, Linux, Raspberry Pi. No cloud. No account. No API keys. Nothing leaves your machine. It's open source; you can read every line of code.

    Community jackccrawford
    ggui-ai

    ggui

    The universal interface layer between AI agents and humans. Generate rich UIs on demand via MCP.

    Community ggui-ai
    aanno

    CocoIndex Code MCP Server

    An RAG for code development, implemented as MCP server with cocoindex

    Community aanno
    timescale

    Tiger Linear MCP Server

    A wrapper around the Linear API for internal LLMs

    Community timescale
    choplin

    MCP Gemini CLI

    MCP Server

    Community choplin