OpenMemory

CaviraOSS/OpenMemory

Local persistent memory store for LLM applications including claude desktop, github copilot, codex, antigravity, etc.

4.3k
Stars
488
Forks
13
Open issues
34
Watchers
TypeScript Apache-2.0Last pushed Jun 27, 2026

Local persistent memory store for LLM applications including claude desktop, github copilot, codex, antigravity, etc.

Categories

Tags

Similar tools

Install

npm install OpenMemory

README

🚧 This project is currently being rewritten.

Expect breaking changes and potential bugs.

Contributers needed

To contribute, visit https://github.com/CaviraOSS/OpenMemory/tree/rewrite branch. If you find an issue, please open a GitHub issue with details so it can be tracked and resolved.

OpenMemory

Real long-term memory for AI agents. Not RAG. Not a vector DB. Self-hosted, Python + Node.

OpenMemory is a cognitive memory engine for LLMs and agents.

  • 🧠 Real long-term memory (not just embeddings in a table)
  • πŸ’Ύ Self-hosted, local-first (SQLite / Postgres)
  • 🐍 Python + 🟦 Node SDKs
  • 🧩 Integrations: LangChain, CrewAI, AutoGen, Streamlit, MCP, VS Code
  • πŸ“₯ Sources: GitHub, Notion, Google Drive, OneDrive, Web Crawler
  • πŸ” Explainable traces (see why something was recalled)

Your model stays stateless. Your app stops being amnesiac.


1. TL;DR – Use It in 10 Seconds

🐍 Python (local-first)

Install:

pip install openmemory-py

Use:

from openmemory.client import Memory

mem = Memory()
mem.add("user prefers dark mode", user_id="u1")
results = mem.search("preferences", user_id="u1")
await mem.delete("memory_id")

Note: add, search, get, delete are async. Use await in async contexts.

πŸ”— OpenAI

mem = Memory()
client = mem.openai.register(OpenAI(), user_id="u1")
resp = client.chat.completions.create(...)

🧱 LangChain

from openmemory.integrations.langchain import OpenMemoryChatMessageHistory

history = OpenMemoryChatMessageHistory(memory=mem, user_id="u1")

🀝 CrewAI / AutoGen / Streamlit

OpenMemory is designed to sit behind agent frameworks and UIs:

  • Crew-style agents: use Memory as a shared long-term store
  • AutoGen-style orchestrations: store dialog + tool calls as episodic memory
  • Streamlit apps: give each user a persistent memory by user_id

See the integrations section in the docs for concrete patterns.


🟦 Node / JavaScript (local-first)

Install:

npm install openmemory-js

Use:

import { Memory } from "openmemory-js"

const mem = new Memory()
await mem.add("user likes spicy food", { user_id: "u1" })
const results = await mem.search("food?", { user_id: "u1" })
await mem.delete("memory_id")

Drop this into:

  • Node backends
  • CLIs
  • local tools
  • anything that needs durable memory without running a separate service.

πŸ“₯ Connectors

Ingest data from external sources directly into memory:

# python
github = mem.source("github")
await github.connect(token="ghp_...")
await github.ingest_all(repo="owner/repo")
// javascript
const github = await mem.source("github")
await github.connect({ token: "ghp_..." })
await github.ingest_all({ repo: "owner/repo" })

Available connectors: github, notion, google_drive, google_sheets, google_slides, onedrive, web_crawler


2. Modes: SDKs, Server, MCP

OpenMemory can run inside your app or as a central service.

2.1 Python SDK

  • βœ… Local SQLite by default
  • βœ… Supports external DBs (via config)
  • βœ… Great fit for LangChain / LangGraph / CrewAI / notebooks

Docs: https://openmemory.cavira.app/docs/sdks/python


2.2 Node SDK

  • Same cognitive model as Python
  • Ideal for JS/TS applications
  • Can either run fully local or talk to a central backend

Docs: https://openmemory.cavira.app/docs/sdks/javascript


2.3 Backend server (multi-user + dashboard + MCP)

Use when you want:

  • org‑wide memory
  • HTTP API
  • dashboard
  • MCP server for Claude / Cursor / Windsurf

Run from source:

git clone https://github.com/CaviraOSS/OpenMemory.git
cd OpenMemory
cp .env.example .env

cd packages/openmemory-js
npm install
npm run dev   # default :8080

Or with Docker (API + MCP):

docker compose up --build -d

Optional: include the dashboard service profile:

docker compose --profile ui up --build -d

Using Doppler-managed config (