CaviraOSS/LongMemory
Local persistent memory store for LLM applications including claude desktop, github copilot, codex, antigravity, etc.
LongMemory – Durable, temporal, governed memory for AI agents
What it is
- A local‑first, SQLite‑backed memory engine designed for large‑language‑model (LLM) applications and autonomous agents.
- Stores immutable “nodes” and executable edges in a Hydrograph graph, preserving provenance, timestamps, and multilingual content.
- Provides several recall modes (strict, historical, associative, world‑grounded) that enforce temporal truth, contradiction handling, and access control.
Key capabilities
- Temporal truth – separate record and valid times, deterministic decay, reinforcement, and consolidation.
- Governance – project, tenant, user, role, and agent scopes with ACLs.
- Explainable recall – evidence‑bounded results with optional single‑model call via
answer_from_evidence. - Multilingual support – script detection, transliteration, cross‑language embeddings.
- Integrations – native connectors for repos, files, web feeds, cloud docs; embedding back‑ends (OpenAI‑compatible, Gemini, Bedrock, Ollama, etc.); agent frameworks (CrewAI, AutoGen, LangGraph/LangChain, OpenAI Agents SDK), IDE plugins (VS Code), automation tools (n8n, Dify, Flowise), and MCP toolset.
- Operational surfaces – TypeScript library, CLI, HTTP API, MCP (streamable), web dashboard, VS Code extension.
How to get started
- Library –
npm install longmemory(orpip install longmemory-sdkfor the HTTP client). Create a memory withcreateMemory(); ingest text and recall withmemory.ingest()/memory.recall(). - CLI –
npm install -g longmemory; runlongmemory init,longmemory ingest …,longmemory recall …. - Self‑hosted service – run from source (
pnpm install && pnpm build && pnpm start) or via Docker (docker run -p 7331:7331 -v longmemory-data:/data ghcr.io/caviraoss/longmemory). A dashboard is available on port 3000 via theuicompose profile.
Architecture at a glance
- Ingest pipeline → immutable nodes stored in SQLite → Hydrograph (graph of nodes, edges, worlds, entities).
- Graph feeds three recall engines (strict, associative, world‑grounded) which produce a bounded context for the LLM.
- The graph, API, MCP tools, and UI are all built on a single TypeScript codebase.
Typical use cases
- Persistent personal or team memory for chat assistants (Chat Memory, Skills, LLM‑Wiki).
- Project‑level knowledge bases that retain decisions, architecture notes, and code impact facts.
- Agent tooling where actions need evidence‑backed recall (e.g., autonomous DevOps bots).
Deployment options
- Docker / Docker‑Compose (API + optional UI).
- Cloud platforms (Heroku, Railway, Render, DigitalOcean App Platform, Vercel – UI only).
- Native Windows script for local background service.
Benchmarks & quality
- Comes with a benchmark harness (
pnpm bench*) that reports retrieval quality, temporal behavior, latency, and evidence metrics.
License
- Apache License 2.0 (core); the bundled n8n node uses MIT as required.
Where to learn more
- Docs:
docs/answering.md,docs/python-sdk.md,docs/mcp.md,ARCHITECTURE.md. - Dashboard demo GIF in the repo root.
- Contribution guidelines and governance docs are provided for community involvement.
Related
- Project
- Project
- Project
- Project
- Project