Rag vs. Memory
Learn why agent memory and RAG are fundamentally different, and when to use each approach.
Most developers confuse RAG (Retrieval-Augmented Generation) with agent memory. They're not the same thing and using RAG as a substitute for memory is exactly why your agents keep forgetting important context.
The Core Problem
When building AI agents, developers often treat memory as just another retrieval problem. They store conversations in a vector database, embed queries, and hope semantic search will surface the right context.
This approach fails because memory isn't about finding similar text. It's about understanding relationships, temporal context, and user state over time.
Documents vs. Memories
There is a clear distinction between these two concepts.
Documents: Raw Knowledge
Documents are the raw content you send to Tropicalia, like PDFs, web pages, text files. They represent static knowledge that doesn't change based on who's accessing it.
Characteristics:
Stateless — A document about Python programming is the same for everyone
Unversioned — Content doesn't track changes over time
Universal — Not linked to specific users or entities
Searchable — Ideal for semantic similarity search
Best for: Company knowledge bases, technical documentation, research papers, general reference material
Memories: Contextual Understanding
Memories are the insights, preferences, and relationships extracted from documents and conversations. They're tied to specific users or entities and evolve over time.
Characteristics:
Stateful — "User prefers dark mode" is specific to that user
Temporal — Tracks when facts became true or invalid
Personal — Linked to users, sessions, or entities
Relational — Understands connections between facts
The core tension:
RAG finds the most semantically similar text, but misses temporal progression and causal relationships
Memory systems track when facts become invalid and understand causal chains
The Technical Difference
RAG: Semantic Similarity
Query → Embedding → Vector Search → Top-K Results → LLM
RAG excels at finding information semantically similar to your query. It's stateless — each query is independent.
Memory: Contextual Graph
Query → Entity Recognition → Graph Traversal → Temporal Filtering → Context Assembly → LLM
Memory systems build a knowledge graph that understands:
Entities — Users, products, concepts
Relationships — Preferences, ownership, causality
Temporal Context — When facts were true
Invalidation — When facts became outdated
