Skip to main content
Persist agent context as documents in a Moss index. On each turn the agent queries the index for relevant context, grounds its response in the results, then writes new context back with addDocs. The pattern is: store documents, query per turn, write new context back. Two kinds of context live in the same index and surface through the same semantic query:
  • Working context - unstructured insights drawn from conversations: preferences, tone, recurring topics, and decisions. Updated after each interaction.
  • Durable context - stable facts about the user: profile, account tier, identifiers, long-standing preferences. Changes rarely.

Capture and recall loop

An agent recalls relevant context for a user turn, grounds the LLM response, then captures the turn back into contextAn agent recalls relevant context for a user turn, grounds the LLM response, then captures the turn back into context
On each turn the agent queries the index for the most relevant context, grounds its response in it, then writes new context back with addDocs. Subsequent turns query the updated index.

Example (JavaScript)

Live-call context

Short-term + long-term context during a call.

Cross-agent handoff

Carry context across agents and channels.