Skip to content

Memory: a shared wiki about the user, and a switch for what each app may do with it - #1

Merged
sergiudm merged 1 commit into
mainfrom
feat/shared-memory
Nov 18, 2026
Merged

sergiudm merged 1 commit into
mainfrom
feat/shared-memory

Conversation

@sergiudm

Copy link
Copy Markdown
Contributor

What

LaunchX now keeps one shared memory for the user: a small wiki of Markdown pages (profile, preferences, schedule, resume, projects, people) that their apps and agents read and write together, so the person doesn't have to tell every app the same things.

The user decides, per app, whether it may read memory, read and write it, or neither: on the app's card, in the page's new Memory tab, or with lx memory access <id> none|read|write. Everything starts off, and the launcher checks the switch on every request. Agents get their own row, which controls whether a launchx-memory skill is published to them.

Design

Built from the components of agent memory:

Component Here
Transcript memory/log.jsonl: every write, by whom, why
Representation memory/pages/<page>.md, linked with [[page]]
Injected context GET /api/memory/index: one line per page, at most 200 lines / 25 KB
Consolidation an agent with write access, guided by lx memory lint, log and history
  • No lost writes. Every update names the revision it read (base); a stale write gets 409 with the current page to merge. The page's editor handles this too, showing the other writer's version.
  • Each app writes as itself. Managed services get LAUNCHX_MEMORY_URL and their own LAUNCHX_MEMORY_TOKEN. That token opens /api/memory and nothing else, and is never handed to dependents, so no service can write under another's name.
  • Nothing is lost. The version each write replaces is kept (last 20). The page can view and restore any of them.
  • Apps can ask. [service.<id>.memory] wants = "read"|"write" plus a reason, shown next to the switch. A manifest can't grant itself access.
  • Local-first. Pages are plain files under ~/.launchx/memory, and lx memory works with or without a running launcher (writes are serialised with flock).

The contract is in SPEC.md §12. §11 (security model) gains rows for memory access, impersonation and lost updates, plus notes on same-user processes and prompt injection.

CLI

lx memory ls | show | write | append | rm | history | log | search | lint | index | access | open

Testing

  • cargo test: 13 unit tests (5 new in memory.rs) and the end-to-end test, extended. A fixture service reads and writes memory with its own token at each access level. The test also covers: stale writes refused; an app's HTTP token rejected by memory; a memory token rejected everywhere else; the page's switch needing its own Origin; the memory skill appearing, following page changes, and being withdrawn; and lx memory working with the launcher stopped.
  • Checked by hand in a browser against a scratch launcher: the switches on the cards and in the Memory tab, page rendering and wiki links, editing with a concurrent CLI write (conflict shown, nothing overwritten), the unsaved-edit guard, and phone-width layout.

Companion

Schedule Everything is the first app to use it: AutoPhd-org/schedule-everything#21 (merged).

Not in this PR

  • Access per page (for example schedule but not resume).
  • A memory change stream for services (they poll GET /api/memory and compare its rev).
  • Memory controls in the macOS menu bar.

🤖 Generated with Claude Code

…may do with it

LaunchX now keeps one memory for the user: Markdown pages (profile,
preferences, schedule, resume, projects, people) that their apps and
agents read and write together. The user sets Off, Read or Read & write
for each app, on its card, in the page's new Memory view, or with
`lx memory access <id> <level>`. Everything starts off, and the launcher
checks the switch on every request.

It follows the components of agent memory: a log of every write
(memory/log.jsonl), linked pages (memory/pages/), and a short index of
one line per page for an app or agent to load at the start of a session.
Updates name the revision they read, so a stale write is refused with
the current page instead of silently undoing someone else's change. The
version each write replaces is kept, and the page can show and restore it.

Each managed service gets LAUNCHX_MEMORY_URL and its own
LAUNCHX_MEMORY_TOKEN, which opens /api/memory and nothing else and is
never handed to dependents, so writes are logged under the caller's id.
A manifest may ask for access with [service.<id>.memory] wants/reason.
Agents learn about memory from a generated launchx-memory skill, while
the user allows it. `lx memory` (ls, show, write, append, rm, history,
log, search, lint, index, access, open) works with or without a running
launcher. SPEC.md §12 is the contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergiudm
sergiudm merged commit d139b5a into main Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant