Retained Memory
Retained memory is the part of Memory that carries learned context forward across work. Unlike short-lived thread history, retained memory is selective: a user preference the agent noticed, a Space decision made in an earlier thread, a fact the agent confirmed and needs again, or an authored Space document retained as a Brain Source.
Hosted ThinkWork now treats Hindsight as the canonical durable Brain substrate. Hindsight owns user memory, Space memory, retained documents, observations, recall, reflect, and redacted source evidence. The normalized ThinkWork APIs still protect callers from raw backend HTTP details, but Hindsight memory-domain concepts such as banks, document ids, timestamps, tags, observation scopes, recall, reflect, and evidence are first-class.
What long-term memory is for
Section titled “What long-term memory is for”Memory is the right place for things like:
- User or team preferences. “Marco prefers Slack over email.” “This team’s code reviews should cite the style guide.”
- Durable facts worth recalling across threads. “The Austin office moved to 2nd and Lavaca.” “Our incident post-mortems live in
/docs/incidents/.” - Ongoing project context. “The backend migration ships in Q3, not Q2.”
- Summaries of earlier work. “Last month we decided to make Hindsight the Brain foundation.”
- Space documents and Brain Sources. Uploaded or imported Space reference material retained with stable Hindsight document ids.
- Follow-up items. “The customer asked about billing reports; still pending response.”
It’s not the right place for:
- Verbatim thread transcripts. That’s what the thread record is for.
- Current-turn connector reads. Context Engine can lazy-load external SaaS, MCP, or workspace context without making it durable memory by default.
- The wiki. The wiki is derived from memory; it is a compiled projection above Hindsight, not a competing runtime Brain.
Hindsight as the Brain foundation
Section titled “Hindsight as the Brain foundation”Hindsight runs as an ECS Fargate service in the deployed stack and gives ThinkWork:
- Bank isolation for users and Spaces. User memory lives in
user_<userId>banks; Space memory lives inspace_<spaceId>banks. - Document retain with stable
document_idvalues for thread digests, requester memory documents, and Space Brain Sources. - Temporal extraction through first-class timestamps, including
timestamp: "unset"for timeless reference material. - Tags, document tags, and observation scopes that make retained memories filterable and consolidatable.
- Recall and reflect as the read path. Recall returns matching observations/facts; reflect synthesizes answer-like memory with evidence.
- Source evidence through redacted source-fact and
based_ondescriptors so operators can audit why a memory surfaced without exposing raw source text by default.
Brain vs. external context
Section titled “Brain vs. external context”The boundary is simple:
- Hindsight is Brain. Durable user memory, Space memory, retained documents, observations, recall, reflect, and evidence belong in Hindsight.
- Context Engine is external context orchestration. It can query workspace files, compiled pages, approved MCP tools, web/search providers, and other lazy-loaded sources for the current turn.
- Wiki is a projection. Compiled pages summarize and organize Hindsight memory; they do not replace Hindsight as the runtime memory substrate.
- Bedrock Knowledge Bases are compatibility/diagnostic paths. They are not default hosted Brain providers. Use them only when a deployment explicitly opts into a specialized external-context path.
Short-term vs. long-term
Section titled “Short-term vs. long-term”Short-term context comes from thread history and the current prompt. Long-term memory is the selective carry-forward. Memory should help the system avoid rereading everything; it should not pretend to be the thread record.
Agents should usually:
- Read the current prompt and mounted files such as
USER.md. - Use direct Hindsight recall/reflect when durable user or Space memory matters.
- Use Context Engine only for lazy-loaded external context or compiled/source lookup.
- Let post-turn retention write learnings back to Hindsight automatically.
Known limits
Section titled “Known limits”- Hindsight is deployment-wide for hosted memory. User and Space banks are isolated inside Hindsight rather than split across multiple memory products.
- AgentCore managed memory is compatibility. It remains an explicit low-cost/development mode, not the hosted default Brain substrate.
- Bedrock KBs are legacy external retrieval. New retained Space documents should flow into Hindsight Brain Sources.
- Raw evidence expansion is deliberate. Normal UIs show redacted evidence descriptors; raw source text expansion requires an operator/detail path.
- Backfills are separate work. Newly retained memory uses the Hindsight field taxonomy; existing untagged memories remain recallable.
Related pages
Section titled “Related pages”- Memory — the umbrella
- Sources and Knowledge Bases — authored document context and legacy Bedrock KB compatibility
- Compiled Memory Pages — what’s built on top of Hindsight memory
- Source Routing — where memory and external context sit in turn assembly
- Operating Compiled Memory Pages — recipes that depend on Hindsight memory
Under the hood
Section titled “Under the hood”- Hindsight adapter.
packages/api/src/lib/memory/adapters/hindsight-adapter.ts— HTTP client against the ECS service. - Hindsight retain options.
packages/api/src/lib/memory/hindsight-retain-params.ts— shared timestamp, tag, document-tag, and observation-scope builders. - Runtime memory provider.
packages/agentcore-pi/agent-container/src/runtime/providers/hindsight-memory-provider.ts— direct Pi recall/reflect access to Hindsight. - Space document ingest.
ingestSpaceMemoryDocument— GraphQL mutation that retains Space Brain Sources into the Space Hindsight bank. - Compile pipeline. Wiki compilers read Hindsight memory through cursor/export APIs and produce compiled pages as projections.