Favicon of LongMemory

LongMemory

A self-hosted AI memory engine stores persistent, time-aware context in SQLite and connects to agents through MCP, with optional local Ollama embeddings.

LongMemory gives LLM applications and AI agents persistent memory across sessions. Developers can use it to retain project decisions and conversation context while distinguishing current facts from information that was true earlier.

  • Time-aware recall: Separate recorded time from valid time, retrieve historical facts and track when newer information supersedes older claims.
  • Evidence and permissions: Inspect why a memory was selected, limit context by token budget and enforce access scopes for projects, users, teams and agents.
  • Project and session memory: Retain architecture, tasks, conventions and code context, and import sessions from Claude Code, Codex, Gemini CLI and other supported agents.
  • Agent integrations: Connect through MCP, use integrations for tools such as Claude Code and n8n, or access the self-hosted service from Python.
  • Memory browsing: Search and ingest content through a dashboard, or use the VS Code extension to recall context, view explanations and reinforce memories.

LongMemory is open source under Apache 2.0. Its TypeScript engine supports local SQLite storage and self-hosted deployment, including Docker and a Windows background service. It's available through a package, CLI, HTTP API and MCP.

Embeddings can run locally through Ollama or local HTTP models. Optional providers include OpenAI-compatible APIs, Gemini and AWS Bedrock, which receive embedding input when selected. Connectors can ingest local files, repositories, web content and cloud documents; world-grounded recall requires current external evidence.

Similar to LongMemory