/cognee

Memory management for the AI Applications and AI Agents

Primary LanguagePythonApache License 2.0Apache-2.0

cognee

AI Applications and RAGs - Cognitive Architecture, Testability, Production Ready Apps

Cognee logo

Open-source framework for building and testing RAGs and Cognitive Architectures, designed for accuracy, transparency, and control.

cognee forks cognee stars cognee pull-requests cognee releases>
  </a>
</p>
<p>
  <b>Share cognee Repository</b>
</p>
<p>
  <a href= Follow Cognee Share on Telegram Share on Reddit Buy Me A Coffee


Star us on Github!

Jump into the world of RAG architecture, inspired by human cognitive processes, using Python. Cognee runs in iterations, from POC towards production ready code.

To read more about the approach and details on cognitive architecture, see the blog post: AI Applications and RAGs - Cognitive Architecture, Testability, Production Ready Apps

Try it yourself on Whatsapp with one of our partners by typing /save {content you want to save} followed by /query {knowledge you saved previously}

Getting started

In order to run cognee you need to have Docker installed on your machine.

Run Cognee in a couple of steps:

  • Run cp .env.template .env in your terminal and set all the environment variables
  • Run docker compose up in order to start graph and relational databases
  • Run docker compose up cognee in order start Cognee

Debugging

In order to run Cognee with debugger attached you need to build the Cognee image with the DEBUG flag set to true.

  • docker compose build cognee --no-cache --build-arg DEBUG=true
  • docker compose up cognee

Visual Studio Code debugger

Add the following configuration to VSCode Run and Debug configurations array:

  {
      "name": "Attach (remote debug)",
      "type": "python",
      "request": "attach",
      "port": 5678,
      "host": "127.0.0.1",
      "pathMappings": [{
          "localRoot": "${workspaceFolder}",
          "remoteRoot": "."
      }]
  }

It should look like this:

Current Focus

Integration with keepi.ai and other apps

  • Cognee uses Neo4j graph database to map user data into a graph structure consisting of semantic, episodic, and procedural memory.
  • Stores data and files through the WhatsApp chatbot keepi.ai
  • Uses the graph to answer user queries and store new information in the graph.

Architecture

How Cognee Enhances Your Contextual Memory

Our framework for the OpenAI, Graph (Neo4j) and Vector (Weaviate) databases introduces three key enhancements:

  • Query Classifiers: Navigate information graph using Pydantic OpenAI classifiers.
  • Document Topology: Structure and store documents in public and private domains.
  • Personalized Context: Provide a context object to the LLM for a better response.

Image