Local persistent memory store for LLM applications including claude desktop, github copilot, codex, antigravity, etc.
$git clone https://github.com/caviraoss/openmemoryInstalls into the current project.
Install openmemory by running `git clone https://github.com/caviraoss/openmemory`, then use it for the current task and follow its documentation at https://github.com/caviraoss/openmemory.
| 1 | # 🚧 This project is currently being rewritten. |
| 2 | |
| 3 | Expect breaking changes and potential bugs. |
| 4 | ### Contributers needed |
| 5 | To contribute, visit https://github.com/CaviraOSS/OpenMemory/tree/rewrite branch. |
| 6 | If you find an issue, please open a GitHub issue with details so it can be tracked and resolved. |
| 7 | ## OpenMemory |
| 8 | |
| 9 | > **Real long-term memory for AI agents. Not RAG. Not a vector DB. Self-hosted, Python + Node.** |
| 10 | |
| 11 | [](https://marketplace.visualstudio.com/items?itemName=Nullure.openmemory-vscode) |
| 12 | [](https://discord.gg/93M9XSuEj6) |
| 13 | [](https://pypi.org/project/openmemory-py/) |
| 14 | [](https://www.npmjs.com/package/openmemory-js) |
| 15 | [](LICENSE) |
| 16 | |
| 17 |  |
| 18 | |
| 19 | OpenMemory is a **cognitive memory engine** for LLMs and agents. |
| 20 | |
| 21 | - 🧠 Real long-term memory (not just embeddings in a table) |
| 22 | - 💾 Self-hosted, local-first (SQLite / Postgres) |
| 23 | - 🐍 Python + 🟦 Node SDKs |
| 24 | - 🧩 Integrations: LangChain, CrewAI, AutoGen, Streamlit, MCP, VS Code |
| 25 | - 📥 Sources: GitHub, Notion, Google Drive, OneDrive, Web Crawler |
| 26 | - 🔍 Explainable traces (see *why* something was recalled) |
| 27 | |
| 28 | Your model stays stateless. **Your app stops being amnesiac.** |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ## 1. TL;DR – Use It in 10 Seconds |
| 33 | |
| 34 | ### 🐍 Python (local-first) |
| 35 | |
| 36 | Install: |
| 37 | |
| 38 | ```bash |
| 39 | pip install openmemory-py |
| 40 | ``` |
| 41 | |
| 42 | Use: |
| 43 | |
| 44 | ```python |
| 45 | from openmemory.client import Memory |
| 46 | |
| 47 | mem = Memory() |
| 48 | mem.add("user prefers dark mode", user_id="u1") |
| 49 | results = mem.search("preferences", user_id="u1") |
| 50 | await mem.delete("memory_id") |
| 51 | ``` |
| 52 | |
| 53 | > Note: `add`, `search`, `get`, `delete` are async. Use `await` in async contexts. |
| 54 | |
| 55 | #### 🔗 OpenAI |
| 56 | |
| 57 | ```python |
| 58 | mem = Memory() |
| 59 | client = mem.openai.register(OpenAI(), user_id="u1") |
| 60 | resp = client.chat.completions.create(...) |
| 61 | ``` |
| 62 | |
| 63 | #### 🧱 LangChain |
| 64 | |
| 65 | ```python |
| 66 | from openmemory.integrations.langchain import OpenMemoryChatMessageHistory |
| 67 | |
| 68 | history = OpenMemoryChatMessageHistory(memory=mem, user_id="u1") |
| 69 | ``` |
| 70 | |
| 71 | #### 🤝 CrewAI / AutoGen / Streamlit |
| 72 | |
| 73 | OpenMemory is designed to sit behind **agent frameworks and UIs**: |
| 74 | |
| 75 | - Crew-style agents: use `Memory` as a shared long-term store |
| 76 | - AutoGen-style orchestrations: store dialog + tool calls as episodic memory |
| 77 | - Streamlit apps: give each user a persistent memory by `user_id` |
| 78 | |
| 79 | See the integrations section in the docs for concrete patterns. |
| 80 | |
| 81 | --- |
| 82 | |
| 83 | ### 🟦 Node / JavaScript (local-first) |
| 84 | |
| 85 | Install: |
| 86 | |
| 87 | ```bash |
| 88 | npm install openmemory-js |
| 89 | ``` |
| 90 | |
| 91 | Use: |
| 92 | |
| 93 | ```ts |
| 94 | import { Memory } from "openmemory-js" |
| 95 | |
| 96 | const mem = new Memory() |
| 97 | await mem.add("user likes spicy food", { user_id: "u1" }) |
| 98 | const results = await mem.search("food?", { user_id: "u1" }) |
| 99 | await mem.delete("memory_id") |
| 100 | ``` |
| 101 | |
| 102 | Drop this into: |
| 103 | |
| 104 | - Node backends |
| 105 | - CLIs |
| 106 | - local tools |
| 107 | - anything that needs durable memory without running a separate service. |
| 108 | |
| 109 | --- |
| 110 | |
| 111 | ### 📥 Connectors |
| 112 | |
| 113 | Ingest data from external sources directly into memory: |
| 114 | |
| 115 | ```python |
| 116 | # python |
| 117 | github = mem.source("github") |
| 118 | await github.connect(token="ghp_...") |
| 119 | await github.ingest_all(repo="owner/repo") |
| 120 | ``` |
| 121 | |
| 122 | ```ts |
| 123 | // javascript |
| 124 | const github = await mem.source("github") |
| 125 | await github.connect({ token: "ghp_..." }) |
| 126 | await github.ingest_all({ repo: "owner/repo" }) |
| 127 | ``` |
| 128 | |
| 129 | Available connectors: `github`, `notion`, `google_drive`, `google_sheets`, `google_slides`, `onedrive`, `web_crawler` |
| 130 | |
| 131 | --- |
| 132 | |
| 133 | ## 2. Modes: SDKs, Server, MCP |
| 134 | |
| 135 | OpenMemory can run **inside your app** or as a **central service**. |
| 136 | |
| 137 | ### 2.1 Python SDK |
| 138 | |
| 139 | - ✅ Local SQLite by default |
| 140 | - ✅ Supports external DBs (via config) |
| 141 | - ✅ Great fit for LangChain / LangGraph / CrewAI / notebooks |
| 142 | |
| 143 | Docs: https://openmemory.cavira.app/docs/sdks/python |
| 144 | |
| 145 | --- |
| 146 | |
| 147 | ### 2.2 Node SDK |
| 148 | |
| 149 | - Same cognitive model as Python |
| 150 | - Ideal for JS/TS applications |
| 151 | - Can either run fully local or talk to a central backend |
| 152 | |
| 153 | Docs: h |