Practical overview
When it fits
Use Longmemory when an LLM application needs more than basic vector retrieval: for example, when facts can change over time, superseded information matters, access scope must be enforced, or recall needs explainable evidence and token limits.
Who it is for
- Developers building AI agents that must retain information across sessions
- Teams creating self-hosted LLM workflows with governed project or user memory
- TypeScript applications that need SQLite-backed memory
- Python applications that need to access a self-hosted memory service
Documented uses
- Store durable agent and application memory locally
- Recall current, historical, associative or externally grounded information
- Preserve provenance, temporal history and immutable content
- Apply scope, permission and lifecycle controls to project memory
- Expose memory through npm, CLI, HTTP, MCP, dashboard, VS Code or Python
Requirements & limits
The repository is public and uses the Apache-2.0 license. The evidence documents npm and PyPI packages, self-hosted deployment, Docker and Docker Compose options, and a CLI.
- Choose the npm library for direct TypeScript integration and SQLite-backed local persistence.
- Choose the self-hosted service when applications need HTTP access or Python SDK integration.
- Use historical recall when superseded facts must remain available for point-in-time questions.
- Consider the governance and evidence model when permissions, provenance, contradictions and token-bounded context affect agent behaviour.
- The documented design is local-first and self-hosted rather than presented as a hosted memory service.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Use LongMemory as an in-memory TypeScript memory store
Install LongMemory, ingest a fact, recall it with strict mode, and close the memory instance.
Before you start
- A TypeScript application with npm available.
- The
longmemorynpm package.
Steps
Install the package with the command below.
npm install longmemoryImport
createMemoryfromlongmemoryand create a memory instance.Ingest a record containing
user_id: 'alice'and the textI prefer TypeScript for backend services.Call
memory.recallwith the queryWhat language does Alice prefer?andmode: 'strict', then close the instance withmemory.close().],outcome comment? no
Expected outcome
The application receives a strict recall result for the ingested preference without requiring a service or external database for in-memory use.
Guide limitations
- This recipe documents in-memory use only; persistence requires the SQLite configuration described separately.
- The source does not document a specific returned result format or a successful test run.
Run LongMemory from source as a local service
Clone, install, build, and start the LongMemory service from its repository source.
Before you start
- Git, Corepack, pnpm, and the project source repository.
- The repository’s documented build environment.
Steps
Clone
https://github.com/CaviraOSS/LongMemory.gitand change into the repository directory.Enable Corepack with
corepack enable.Install dependencies with
pnpm install --frozen-lockfile.Build the project with
pnpm build.Start the service with
pnpm start; the documented default API address ishttp://127.0.0.1:7331.
Expected outcome
A locally running LongMemory service is started from source and listens on the documented default address.
Guide limitations
- The source does not document authentication setup for this from-source recipe.
- The source does not document a client request or a successful health-check result for this sequence.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 30 September 2026
- Original website title
- CaviraOSS/LongMemory · Official homepage title · retained in its source language

