save_context, save_session, get_context,
list_context, resume_session, and forget_context — and every client you
connect shares the same store.
Where it lives
Each user gets their own private store (a per-user Durable Object). Your context is the source of truth; it isn’t pooled with anyone else’s, and it isn’t buried inside a single AI provider’s chat history. Every tool call is scoped to the signed-in user — the user identity is derived server-side from the OAuth token, never from client input.Saving — durable facts, not transcripts
save_context is for durable knowledge: a convention, a decision, a
preference, a fact that should outlive the current conversation. It is designed to
stay clean over time:
Idempotent
Saving the same content twice returns the same id with
deduped: true. A
repeated save is harmless.Topic supersession
Pass a stable
topic and a newer entry replaces the older one — so a changed
preference updates in place instead of piling up.Typed
Each entry has a
memory_type — fact, event, instruction, or task —
that drives retrieval, plus a display kind, tags, and a source_surface.Memory types — and ephemeral tasks
Every entry carries amemory_type: a fact (stable knowledge), an event
(something that happened), an instruction (a procedure or runbook), or a
task (what you’re working on right now). Tasks are ephemeral — they expire
after a short TTL and are swept automatically, so “what I’m doing now” never
calcifies into stale knowledge. While a task is live it’s embedded and
retrievable like anything else; get_context can also filter to specific types
(e.g. just your instructions).
You rarely set this by hand: save_session distills a transcript and classifies
each item’s type for you.
Retrieving — a ranked pack, never an answer
get_context is retrieval, not generation. It returns a ranked pack of
context chunks — your own source material — for the tool to reason over. It never
synthesizes an answer on the query path, so what comes back is always grounded in
what you actually saved.
Ranking fuses four signals with weighted Reciprocal Rank Fusion:
- Semantic — embedding similarity to your query. At save time OneLamp also generates a few likely questions and folds them into what’s embedded, so a fact stored declaratively (“prefers dark mode”) still matches an interrogative query (“what theme?”).
- Keyword — full-text search with stemming, so “deploying” matches a saved “deploy”.
- Fact-key — when your query names a known topic, that exact entry is a high-precision direct hit.
- Recency — newer entries break ties, so fresh context surfaces without burying older but relevant facts.
kind, memory_type, source_surface,
timestamp, and a relevance score, so the tool can weigh and cite what it uses.
Exporting — your data, always portable
From your Account in the OneLamp web app you can export your entire store as portable JSON. There’s no lock-in and no export queue: export from the dashboard and you get everything back, any time.In practice
For exact parameters and return shapes, see the
context tools reference.