Three Context Mechanisms That Solve Different Production Problems

Graph RAG vs. Agent Memory vs. World State

Contents

Graph RAG, agent memory and world state are often grouped under “giving the model more context.” That description is too broad for architecture. They solve different problems and carry different levels of authority.

The shortest distinction is:

Graph RAG retrieves connected knowledge.
Agent memory reuses prior experience.
World state records what is true now.

Graph RAG: Retrieve Relations and Global Structure

Conventional RAG usually finds text chunks similar to a query. Graph RAG adds an explicit graph derived from or linked to the source material. Microsoft’s GraphRAG approach extracts entities and relations, detects communities and creates summaries that can support global questions about a corpus.

Its core job remains retrieval and synthesis. It helps answer questions such as:

  • Which entities connect these documents?
  • What themes span the collection?
  • Which relationships would chunk similarity miss?
  • What evidence is relevant to this query?

Graph RAG can provide strong context, but retrieved or generated graph content is not automatically current operational truth. An extracted claim may be uncertain. A community summary is a derived representation. Both need provenance and refresh rules.

Agent Memory: Reuse Experience Across Turns or Runs

Memory helps an agent avoid beginning from zero. Short-term memory can preserve a thread’s messages and intermediate checkpoints. Long-term memory can store preferences, successful procedures, summaries or learned facts across threads.

Memory answers questions such as:

  • What did this user prefer previously?
  • Which approach worked on a similar task?
  • Where did this interrupted run stop?
  • What should the agent recall before planning?

Memory is selected and retrieved. That makes it useful but fallible. A relevant memory may not be returned; an old preference may no longer apply; a summarized episode may omit the detail that matters now.

The implementation is developed in Agent Memory Architecture , including typed records, consolidation, scoped retrieval and forgetting.

World State: Represent Current Authoritative Truth

World state describes the current accepted condition of a system or domain. “World” can mean a business process, software environment, game, story universe or production pipeline.

Examples include:

  • an invoice is paid;
  • an asset version is approved;
  • a character currently possesses an object;
  • a task is blocked by another task;
  • a tool call has already changed an external record; or
  • a human has denied a proposed action.

World state requires controlled writes, identities, timestamps or versions, and conflict semantics. It cannot depend on whether a retrieval query happens to return the right paragraph.

Comparison

DimensionGraph RAGAgent memoryWorld state
Primary purposeConnected retrievalReuse prior experienceRecord accepted truth
Typical scopeCorpus or knowledge domainThread, user or agentSystem or universe
Read patternQuery and traversalRecall and similarityDirect lookup and constraints
Write sourceIngestion/extractionRun observations or summariesAuthorized transition
AuthorityEvidence/contextAdvisoryAuthoritative within defined scope
Common failureWrong or incomplete retrievalStale or missing recallConflicting or invalid transition
Provenance needSource document and extractionOriginating episode/runActor, event and acceptance decision

Why One Store Cannot Simply Play All Three Roles

A vector store can retain memories and document chunks, but similarity does not enforce a state transition. A knowledge graph can represent world state, yet an automatically extracted graph may contain probabilistic claims that should not be promoted to truth. A checkpoint can resume a run, but it does not necessarily describe the latest external world after another process made changes.

The important distinction is not the database technology. It is the contract around each record:

evidence: something a source says
memory: something useful to recall
state: something the system currently accepts as true

Those categories can live in one platform if their labels, provenance and update policies remain distinct.

A Combined Architecture

user request
→ load current world state
→ retrieve connected evidence with Graph RAG
→ recall relevant agent memory
→ assemble context with authority labels
→ agent proposes action
→ policy and validation approve or reject
→ tool executes
→ accepted event updates world state
→ useful experience may become memory

The ordering prevents a common error: allowing retrieved text or remembered behavior to overwrite the system’s current truth.

Example: A Story Production Agent

Suppose an agent must plan the next scene of a long narrative.

Graph RAG retrieves relationships and themes from the lore corpus. Memory recalls that a previous editing pass favored restrained dialogue. World state records that the protagonist has lost the key, has not learned the antagonist’s identity and is currently in the station.

The first two mechanisms guide the plan. The third constrains it. If the generated scene lets the protagonist open the locked room or recognize the antagonist without a causal event, it violates state even if the prose is convincing.

That is why a world model is not a model of your world . General plausibility and retrieved knowledge do not replace explicit, versioned facts about this particular production.

The Decision Rule

Use Graph RAG when the problem is connected evidence. Use memory when the problem is continuity of experience. Use world state when the answer must remain true regardless of what the model remembers or retrieves.

In many production systems, the correct architecture uses all three—and makes their authority visible to the agent.

Sources: