Skip to main content
Glama
LM-Pocket
by jmfraga

LM-Pocket — Longitudinal Memory Pocket

tests

Your AI memory, physically yours.

Español

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 there

The 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 work

Then 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.py

Related 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

Spanish versions live in docs/es/.

Principles that must not break

  1. The memory belongs to the user.

  2. The system works offline.

  3. An LLM never writes directly to canonical memory.

  4. Spaces are isolated by default.

  5. Every memory has provenance.

  6. The format is exportable.

  7. MCP is an interface, not the memory.

  8. The model is replaceable.

  9. The user can physically disconnect their memory.

  10. The developer disappearing must not destroy the user's history.

License

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 tools
get_contextB
Read-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_memoryC
Read-only

One memory by id.

Inputs: id (required). Returns: object

get_policiesB
Read-only

Read-only view of this profile's rules.

Inputs: no named parameters. Returns: object

get_profileC
Read-only

What this connection may do: readable spaces and where proposals go.

Inputs: no named parameters. Returns: object

get_recent_contextC
Read-only

The most recently updated durable memories this profile can read.

Inputs: limit. Returns: result

list_spacesB
Read-only

Spaces of the user's memory that this profile can read.

Inputs: no named parameters. Returns: result

propose_memoryA
Idempotent

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_memoriesB
Read-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

    B3.2/5.0

    Scored across 8 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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).

    Completeness3/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Local-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.
      2
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      User-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.
      3
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      5
      108 PyPI
      1
      MIT