OC-301c · Module 1

Memory Indexing & Retrieval

3 min read

A memory store without effective indexing is a library without a catalog — the information exists but is inaccessible at the speed the agent needs it. Memory indexing determines how quickly and accurately the agent can find the right memory for the current task. Three indexing strategies, used in combination, provide comprehensive coverage.

Temporal indexing: memories indexed by timestamp. Useful for queries like "what happened in the last interaction with Client X?" Semantic indexing: memories indexed by embedding similarity. Useful for queries like "what do I know about pricing strategies?" Categorical indexing: memories tagged with explicit categories — client name, project name, topic, outcome type. Useful for queries like "show me all memories tagged 'negotiation' with 'Acme Corp'." No single indexing strategy handles all retrieval patterns. The combination of all three provides temporal, conceptual, and categorical access paths.

interface MemoryEntry {
  id: string;
  tier: 'episodic' | 'semantic';
  timestamp: string;           // temporal index
  embedding: number[];         // semantic index (vector)
  tags: string[];              // categorical index
  content: string;             // the actual memory
  source: string;              // which session/task produced this
  confidence: number;          // 0-1: how reliable is this memory
  lastAccessed: string;        // for decay/pruning decisions
  accessCount: number;         // frequently accessed = high value
}