About this project

LongMemory is a cognitive memory engine aimed at LLM applications and autonomous agents. Rather than a plain retrieval pipeline that chunks text, embeds it and returns nearest vectors, it models memory concerns directly: temporal truth (recorded time versus valid time), immutable content and provenance, typed executable relationships, governance scopes (project, tenant, user, team, role, agent, task, framework), lifecycle operations such as decay, reinforcement, consolidation and compression, and evidence selection bounded by relevance, contradictions, grounding, permissions and token cost. Storage is local-first using SQLite, and the project can also run as a self-hosted service. The README describes a single TypeScript engine exposed through several surfaces: an npm library, a CLI, an HTTP API, MCP (stdio and authenticated Streamable HTTP), a Next.js dashboard, and a VS Code extension. A zero-dependency Python HTTP client (longmemory-sdk) is provided for calling a self-hosted server. Recall modes include strict (applying temporal, contradiction, contract, confidence and grounding gates), historical (preserving superseded truth at a given valid time), associative (following semantic, lexical, entity, activation and graph signals) and world-grounded (requiring current external evidence). An optional answer_from_evidence adapter produces evidence-grounded answers with at most one model call. Feature areas listed include a "Hydrograph" memory substrate with immutable nodes, executable edges, worlds, entities, facets and traces; multilingual memory with script detection, code switching and transliteration; project memory for architecture, decisions, tasks, conventions, failures, handoffs and code impact; governed assets for Chat Memory, Skills, LLM-Wiki and CodeGraph; a session porter that reads stores from Claude Code, Codex, OpenCode, Gemini CLI, Copilot Chat and Cline; connectors for repositories, files, Markdown, web content, feeds and cloud documents; embeddings via OpenAI-compatible APIs, Gemini, AWS Bedrock, Ollama and local HTTP models; and benchmark harnesses for LongMemEval, LoCoMo and BEAM. Integrations cover Claude Code, Codex/ChatGPT desktop, Gemini CLI, Agent Plugins bundles, an n8n community node, Cline, Continue, LibreChat, Dify, Flowise, and framework examples for CrewAI, AutoGen, LangGraph/LangChain, OpenAI Agents SDK and PydanticAI. Deployment options documented include Docker, Docker Compose, Heroku, Railway, Render, DigitalOcean App Platform, Vercel (dashboard only) and a Windows PowerShell script. Security guidance emphasizes API key protection, origin restriction, TLS termination at the edge, keeping credentials out of repositories, treating recalled content as untrusted evidence, and preserving server-bound identity. The project is Apache-2.0 licensed, with the n8n node under MIT.