Skip to main content

Extracted Facts Memory

Uses an LLM to extract discrete facts, preferences, and entity information from conversations and stores them as structured, deduplicated records. Unlike vector store memory (which stores chunks of raw text), this pattern stores clean, human-readable facts that are injected into future sessions as explicit context.

This is how ChatGPT's memory feature works.


Structure

During a conversation, an extraction step identifies facts worth remembering. These are stored as structured records. On future sessions, relevant facts are loaded into the system prompt so the agent has context it wouldn't otherwise have.


Mechanism

  • An LLM analyzes conversation turns for extractable facts
  • Facts are stored as structured records: "User prefers TypeScript over JavaScript"
  • Deduplication and conflict resolution on write (newer facts override older)
  • Storage: key-value store, JSON documents, or database rows
  • User can also explicitly say "remember that I prefer dark mode"

Key Characteristics

  • Clean and structured — stores discrete facts, not raw text chunks
  • Human-readable — users can see, edit, and delete individual memories
  • Cross-session personalization — agent knows your preferences without being told
  • Extraction quality varies — LLM may extract wrong or irrelevant facts
  • Privacy sensitive — stores personal information that requires careful handling

When to Use

  • Users interact with the agent repeatedly and expect it to remember preferences
  • You need personalization across sessions (language, tools, coding style, name)
  • Facts are more useful than raw conversation history
  • Users want transparency and control over what the agent remembers
  • You're building a personal assistant or ongoing relationship with the agent