Direct answer

RAG retrieves relevant external knowledge for a current question. Agent memory stores or reconstructs state that persists across steps, sessions or interactions. Use RAG for governed sources, short-term state for the active thread and durable memory only for information worth retaining with consent and lifecycle controls.

Three context stores

LayerContentLifecycle
Working contextPrompt, messages, tool resultsOne run
Durable memoryPreferences, summaries, task stateAcross sessions
RAG corpusDocuments, records, policiesSource controlled

MemGPT frames finite context as a memory hierarchy problem. Context-engineering guidance recommends loading high-signal material just in time.

Why the distinction matters

A policy document should keep source identity, permissions and update lifecycle; it belongs in the knowledge layer. A preferred report format may belong in long-term memory. Today’s intermediate results may need only checkpointed task state.

Mixing these creates stale “memories” of source facts, weak deletion controls and claims that cannot show provenance.

Write memory selectively

  • Define events eligible for memory.
  • Require consent for sensitive persistence.
  • Store source and timestamp with learned facts.
  • Provide review, correction and deletion.
  • Expire volatile information.
  • Do not let untrusted text write durable memory without validation.

Combine safely

Retrieve the minimum relevant memory, source evidence and task state. Label each class so a model can distinguish preference from authoritative document. Resolve conflicts by policy, not recency alone.

SPYN3 keeps the two apart. Connected systems are reached live through one MCP endpoint and are not indexed; memory is a separate, opt-in layer of small files under spyn3://me/… and spyn3://workspace/…, labelled as recorded data when recalled. See how SPYN3 memory works.

Built for the next step

Live access and memory, kept apart

SPYN3 reaches your systems live and keeps agent memory as a separate, opt-in layer behind the same endpoint.

How memory works
About SPYN3

SPYN3 is a consolidated MCP layer: one hosted endpoint in front of every system you connect — MCP servers, Postgres, REST APIs, Google Drive — with tools foldered by source and read/write permissions per key. Switching agents means moving one URL. Free plan available; current capabilities are documented on the product facts page.

Sources

  1. Packer et al.: MemGPT — hierarchical context and memory tiers. Verified 13 Sep 2026
  2. Anthropic: effective context engineering — high-signal context and progressive disclosure. Verified 13 Sep 2026
  3. Anthropic: contextual retrieval — adding chunk-specific context before indexing. Verified 13 Sep 2026