Stop Using RAG as Memory — Daniel Chalef, Zep

The Problem with Current Memory Approaches 00:00

  • There is no universal, one-size-fits-all memory solution for AI agents.
  • Current systems often generate and store arbitrary facts that may not be relevant to the business domain, leading to polluted memory and hallucinations.
  • Examples include chatbots or agents that remember irrelevant details, such as a user's waking time or pet's name, which aren't pertinent to the intended domain.

Limitations of Vector Databases and Semantic Similarity 02:24

  • Many frameworks simply extract and store facts in a vector database or similar storage, relying on semantic similarity for retrieval.
  • This approach returns information that is semantically similar but not necessarily relevant or domain-specific.
  • Semantic similarity retrieval can unintentionally include irrelevant facts because it lacks understanding of business context.

Necessity for Domain-Aware, Structured Memory 03:42

  • Vectors lack causal or relational structures; they are just projections in an embedding space.
  • A better solution is to build memory structures that reflect the business domain, not just improve semantic search.
  • Domain-aware memory allows for differentiation between relevant and irrelevant information based on business context.

Demonstration: Zep's Domain-Aware Memory Implementation 04:13

  • A demo application (finance coach) is shown where the agent asks for domain-relevant information like annual income, student loan debt, and financial goals.
  • Zep stores this information as explicit business objects: financial goals, debts, income sources, etc.
  • Developers can define these objects and their rules using tools and languages like Pydantic, Zod, or Go structs.
  • Business rules for each field in these objects can be enforced, ensuring only domain-relevant data is stored.
  • Retrieval tools enable the agent to fetch specific business entities or snapshots, supporting concurrent filtered searches.

Setting Up and Using Zep's Knowledge Graph 05:46

  • Developers register their defined business objects with Zep, which builds and maintains a domain-specific ontology in a graph structure.
  • Data updates (like reporting $5,000 monthly rent) quickly enter the knowledge graph, which can be visualized in Zep's frontend.
  • The knowledge graph supports fine-grained filtering for precise, relevant memory retrieval.

Additional Resources and Conclusion 06:40

  • A paper explaining the technical details of this memory approach is available for further reading.
  • Attendees are encouraged to follow up for more information through the provided link or by contacting the presenter.