MCP ExplorerExplorer

Cognee

@topotereteson 17 days ago
5133 Apache-2.0
FreeCommunity
AI Systems
#ai#cognitive-architecture#vector-database#openai#rag#ai-agents#graph-database#ai-memory#cognitive-memory#neo4j#knowledge#knowledge-graph#graph-rag#graphrag#contributions-welcome#good-first-issue#good-first-pr#help-wanted#open-source
Memory for AI Agents in 5 lines of code

Overview

What is Cognee

Cognee is a tool designed to provide memory capabilities for AI agents, allowing them to retain and recall information efficiently with just five lines of code.

Use cases

Use cases for Cognee include enhancing chatbot interactions by remembering user preferences, improving virtual assistants’ contextual understanding, and enabling AI agents to learn from past interactions.

How to use

To use Cognee, you simply need to integrate it into your AI agent’s codebase. Follow the documentation on the GitHub repository to set it up and start utilizing its memory features.

Key features

Key features of Cognee include ease of integration, minimal code requirement (only five lines), dynamic memory management for agents, and support for various AI applications.

Where to use

Cognee can be used in various fields such as AI development, machine learning projects, chatbots, virtual assistants, and any application requiring memory for intelligent agents.

Content

Cognee Logo

cognee - Memory for AI Agents in 5 lines of code

Demo . Learn more · Join Discord · Join r/AIMemory

GitHub forks
GitHub stars
GitHub commits
Github tag
Downloads
License
Contributors
Sponsor

cognee - Memory for AI Agents  in 5 lines of code | Product Hunt

topoteretes%2Fcognee | Trendshift

Build dynamic memory for Agents and replace RAG using scalable, modular ECL (Extract, Cognify, Load) pipelines.

More on use-cases and evals

🌐 Available Languages : Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文

Why cognee?

Features

  • Interconnect and retrieve your past conversations, documents, images and audio transcriptions
  • Replaces RAG systems and reduces 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 , Deepnote 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.
Cognee supports Python 3.8 to 3.12

With pip

pip install cognee

Local Cognee installation

You can install the local Cognee repo using pip, poetry and uv.
For local pip installation please make sure your pip version is above version 21.3.

with UV with all optional dependencies

uv sync --all-extras

💻 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.

Our paper is out! Read here

cognee paper

Cognee UI

You can also cognify your files and query using cognee UI.

Cognee UI 2

Try cognee UI out locally here.

Understand our architecture

cognee concept diagram

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

contributors

Star History

Star History Chart

Tools

No tools

Comments