LM-Pocket
Enables Ollama-based local model clients to access the user's memory through local MCP, fully offline end to end.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LM-Pocket what do you remember about my Q3 planning decisions?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LM-Pocket — Longitudinal Memory Pocket
Your AI memory, physically yours.
Your model can change. Your history doesn't have to.
LM-Pocket is a personal, portable, local-first, model-agnostic memory layer that you own. It lives in a folder — on a USB stick, an external SSD, or your laptop — and keeps your context, preferences, decisions and learnings across time, regardless of which LLM, app, company or device you use.
It is not an assistant and not a model. It is a continuity layer: storage, provenance, governance and access control for your long-term memory, exposed to any LLM through MCP or through copy/paste prompt bridges.
Status: v0.1 prototype. The first demo works end to end on a real USB-style volume: encrypted pocket, passphrase unlock, MCP reads limited by profile, proposals approved in a localhost UI, prompt-bridge import/export, and MCP access cut off when the pocket is locked or unplugged. Not audited, not for real secrets yet. Spec frozen at tag
spec-v0.2-frozen.
Quick start
Needs uv. Offline machines: see docs/offline.md.
git clone https://github.com/jmfraga/lm-pocket && cd lm-pocket
uv sync
uv run lm-pocket init /Volumes/MyUSB/LM-Pocket --sample # prints your recovery key once
uv run lm-pocket open /Volumes/MyUSB/LM-Pocket # opens the localhost UI; unlock thereThe home page shows the exact MCP config for each permission profile. For Claude Code:
claude mcp add pocket-work -- "$(uv run which python)" -m lm_pocket mcp --profile workThen ask Claude something that depends on your memory. Lock the pocket (or unplug the USB) and ask again.
See the first demo — including a real Claude session — or run it yourself on macOS with a throwaway exFAT disk image:
uv run python scripts/demo_usb_macos.pyRelated MCP server: mymemory-mcp
Why
Every AI provider is building memory, and every one of them keeps it on their servers, in their format, under their rules. Switch providers and you start from zero. Lose your account and your history goes with it.
LM-Pocket bets on the opposite: the canonical copy of your memory belongs to you, in an open format, and the model is a replaceable processor that reads only what you allow.
What makes it different
Pieces of this exist elsewhere (memory engines, MCP memory servers, portable agent memory formats). What LM-Pocket combines:
Physically yours — the canonical copy is a folder you can unplug.
Spaces —
personal,portable_professional,work:<id>… isolated by default. Your employer's LLM never sees your personal life or your previous employer's secrets.Proposal → review → durable — no LLM ever writes directly to your canonical memory.
Provenance on everything — every memory answers "where did this come from?" and inferences are distinguished from facts you stated.
Portable experience — keep the lesson ("validate small hypotheses before scaling") without carrying the proprietary data it came from.
Open export format — nothing should stop another program from reading your memory.
How models connect
Client | Path | Notes |
Claude Desktop / Claude Code / Cursor | Local MCP (stdio) | Native, nothing leaves your machine except what the model reads. |
Gemini CLI | Local MCP (stdio) | Native MCP support. |
Local models (LM Studio, Open WebUI, Ollama-based clients) | Local MCP (stdio or HTTP) | Fully offline end to end. |
ChatGPT | Remote MCP bridge (Cloudflare Tunnel or similar) or prompt bridge | ChatGPT only accepts remote HTTPS MCP. Optional, off by default. See docs/bridge.md. |
Gemini app and other closed chats | Prompt bridge | Copy a context package in; paste the model's memory export back. |
Client support changes fast — see docs/mcp.md for details and please send corrections.
Documents
SPEC.md — the MVP specification (v0.2, frozen for v0.1)
docs/demo.md — the first demo, step by step, with real output
docs/spec-conflicts.md — what implementation found that the spec must decide
docs/threat-model.md — what LM-Pocket protects against, and what it cannot
docs/mcp.md — MCP tools, permission profiles, client setup
docs/bridge.md — exposing a read-only bridge for ChatGPT and other remote clients
docs/memory-format.md — the open export format
schemas/ — JSON Schemas for the format
examples/ — a fictional sample memory export
ROADMAP.md — what gets built, in what order
CONTRIBUTING.md — how to join
Spanish versions live in docs/es/.
Principles that must not break
The memory belongs to the user.
The system works offline.
An LLM never writes directly to canonical memory.
Spaces are isolated by default.
Every memory has provenance.
The format is exportable.
MCP is an interface, not the memory.
The model is replaceable.
The user can physically disconnect their memory.
The developer disappearing must not destroy the user's history.
License
Code: Apache-2.0
Specification, documentation and schemas: CC-BY-4.0
The business, if there ever is one, can live in hardware, UX, support, enterprise administration, optional sync or managed services. Never in charging rent to access your own memory.
Available Tools
8 toolsget_contextBRead-only
A compact, budgeted context package about a topic, grouped by preferences, history, goals and inferences. Prefer this at the start of a task.
Inputs: topic, purpose, max_tokens. Returns: object
get_memoryCRead-only
One memory by id.
Inputs: id (required). Returns: object
get_policiesBRead-only
Read-only view of this profile's rules.
Inputs: no named parameters. Returns: object
get_profileCRead-only
What this connection may do: readable spaces and where proposals go.
Inputs: no named parameters. Returns: object
get_recent_contextCRead-only
The most recently updated durable memories this profile can read.
Inputs: limit. Returns: result
list_spacesBRead-only
Spaces of the user's memory that this profile can read.
Inputs: no named parameters. Returns: result
propose_memoryAIdempotent
Propose a new memory about the user. It is saved as a CANDIDATE that the user must approve. type: fact | preference | event | interpretation | skill | decision | relationship | goal. Use 'interpretation' for anything inferred. provider/model: identify yourself for provenance.
Inputs: content (required), tags, type, model, +2 more. Returns: object
search_memoriesBRead-only
Full-text search over the user's durable memories (accent-insensitive). Empty query = most recent. Each result includes provenance: who stated it, how and when.
Inputs: query (required), limit, space. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct targets (memory by id, spaces, policies, profile, search), but get_recent_context overlaps with search_memories (whose empty query returns most recent), and get_profile vs get_policies have a subtle boundary (permissions vs rules) that could cause misselection.
All tools follow a clean snake_case verb_noun pattern (get_context, get_recent_context, get_policies, propose_memory, get_profile, list_spaces, search_memories, get_memory) with no deviation.
Eight tools sit comfortably in the ideal 3-15 range and each maps to a distinct facet of the memory domain (retrieve, search, propose, inspect spaces/policies/profile).
Read coverage is strong (context, recent, search, get by id, spaces, policies), but the proposal lifecycle is a dead end: propose_memory creates a candidate yet there is no tool to list, review, revise, withdraw, or delete memories or pending candidates.
Maintenance
Related MCP Connectors
Governed personal world model and memory for your AI agent. Pair once, connect over MCP.
Portable memory vault for every AI: save once, recall anywhere, with provenance and owner control.
Person-owned AI memory: portable context for any MCP client.
Private, portable memory and reusable skills for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLocal-first, file-based memory layer for AI agents — one shared Markdown vault across Claude, Codex, Gemini, Cursor and any MCP client. Provides read/write memory tools with an audit trail, per-agent trust levels, and Git sync; no cloud and no lock-in.2MIT
- AlicenseAqualityCmaintenanceUser-owned portable memory vault as an MCP server: agents can fetch context, search entries, and propose new memories, while humans curate the vault via a web app.3MIT

fimemoryofficial
FlicenseNot gradedqualityCmaintenanceEnables AI assistants to read and write a local, encrypted-by-default memory store, so they can share persistent notes and context across sessions and models on your machine.61 npm-- AlicenseAqualityBmaintenanceEnables multiple AI agents on one machine to write, search, fetch, link, and give feedback on a shared local store of Markdown-backed facts, preferences, and conventions that persists across sessions. Memories gain confidence as different hosts confirm their use and can be distilled into denser ones, so agents stop re-discovering the same context.5108 PyPI1MIT