androidengineers.Book a session

Context and memory architecture

Design memory with provenance and lifecycle

articleSelf-paced

What you will learn

Working memory, Persistent memory, Summaries, Retrieval scope, Retention.

Engineering the capability

Working state belongs to the current task. Long-term memory influences later tasks and therefore needs stronger ownership and correction rules. Decide what can be persisted, who can read it, when it expires, and how a user can remove it. Do not convert every model inference about a user into a stored fact.

Keep provenance with important facts: source, timestamp, scope, and whether the value was explicitly provided or inferred. Summarization saves context but can lose uncertainty. A summary that turns “possibly eligible” into “eligible” changes the decision. Retain source references and inspect summaries in evaluation.

Memory retrieval is still an authorization boundary. Scope lookup before results enter the model. A deleted preference must be removed from search indexes and caches as well as the primary record. Treat context construction as deterministic code you can inspect independently of generation.

Worked case

A user says they are temporarily traveling in Paris. Persisting “home city: Paris” would be an unsupported inference. Store temporary context with expiry only if it is useful and permitted. Do not let that fact silently influence unrelated future account decisions.

Put it into practice

Continue with the next lab: build a scoped memory store. Build the artifact, record the failure cases, and explain the tradeoff before moving on.

YOUR LEARNING JOURNEY

0 of 118 available lessons completed

Progress saved in this browser. No account needed.
Design memory with provenance and lifecycle | Agentic AI | Android Engineers