Repolode
CaviraOSS

CaviraOSS/LongMemory

Local-first, self-hosted persistent memory engine for LLM apps and agents, with SQLite storage, temporal recall, and MCP integration.

Stars
4,567
Forks
513
Open issues
5
Last commit
19 days ago

What is it?

LongMemory is a memory layer for LLM applications and autonomous agents. It stores facts from conversations, documents, and project events in a local SQLite database, so an application can recall what was true at a given time instead of relying only on nearest-vector search. Recall supports strict, historical, associative, and world-grounded modes, and results are bounded by a token budget with explanations of why each item was selected.

The engine is written in TypeScript and can be used as an npm library, a CLI, an HTTP API, or a Streamable HTTP MCP server. A Python SDK provides a zero-dependency HTTP client for a self-hosted server. Embeddings can come from OpenAI-compatible APIs, Gemini, AWS Bedrock, Ollama, or local HTTP models.

Beyond general memory, it includes project memory for decisions, tasks, and failures, plus session import from coding agents such as Claude Code, Codex, and Gemini CLI. It ships a Next.js dashboard, a VS Code extension, and integration packs for hosts like Claude Code, Cline, Dify, and LangGraph. Docker, Docker Compose, and several PaaS deployment configs are included.

Key features

  • 01Local SQLite persistence that restores nodes, entities, edges, and temporal history on reopen.
  • 02Recall modes for strict, historical, associative, and world-grounded queries.
  • 03Project memory covering decisions, tasks, failures, and code impact.
  • 04Token-bounded context assembly with explanations for selected evidence.
  • 05MCP server over stdio or authenticated Streamable HTTP, plus CLI, HTTP, and Python SDK access.
  • 06Session import from coding agents including Claude Code, Codex, and Gemini CLI.

Use cases

  • Giving a chatbot or coding agent memory of user preferences across sessions.
  • Tracking project decisions and changes so an agent can answer what was true at a past date.
  • Adding long-term memory to agents built with LangGraph, CrewAI, or AutoGen via MCP.
  • Running a private, self-hosted memory service on a personal machine or small server.

Quick start

  1. 1

    Install the library from npm

    npm install longmemory
  2. 2

    Install the CLI globally

    npm install --global longmemory
  3. 3

    Initialize LongMemory in your project

    longmemory init

Things to know

  • The Python SDK is only an HTTP client and needs a separately running self-hosted TypeScript service.
  • Hosted deployments require you to set an API key, provide persistent storage, and handle TLS at the platform edge.

In collections

Topics

FAQ

What is LongMemory?
Local-first, self-hosted persistent memory engine for LLM apps and agents, with SQLite storage, temporal recall, and MCP integration. LongMemory is a memory layer for LLM applications and autonomous agents. It stores facts from conversations, documents, and project events in a local SQLite database, so an application can recall what was true at a given time instead of relying only on nearest-vector search. Recall supports strict, historical, associative, and world-grounded modes, and results are bounded by a token budget with explanations of why each item was selected.
Is LongMemory free to use? What license does it have?
LongMemory is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is LongMemory still maintained?
Actively maintained. The last commit to LongMemory was on Oct 18, 2026.
What can I use LongMemory for?
Giving a chatbot or coding agent memory of user preferences across sessions. Tracking project decisions and changes so an agent can answer what was true at a past date. Adding long-term memory to agents built with LangGraph, CrewAI, or AutoGen via MCP. Running a private, self-hosted memory service on a personal machine or small server.
How do I install LongMemory?
Install the library from npm: npm install longmemory Install the CLI globally: npm install --global longmemory Initialize LongMemory in your project: longmemory init
Where can I get LongMemory?
The source code and installation instructions are on GitHub: https://github.com/CaviraOSS/LongMemory

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects