8 Understanding agent memory and knowledge
This chapter covers
- How retrieval is used in knowledge and memory in AI applications functions
- Building retrieval-augmented generation workflows with LangChain
- Introducing RAG for agentic knowledge systems within Nexus
- Implementing the retrieval pattern for memory in agents that consume various forms of memory, from conversation, semantic, episodic, and procedural
- How memory and knowledge compression work and can improve augmented retrieval systems
Now that we have explored agent actions using external tools like plugins in the form of native or semantic functions, we can look at the role of memory and knowledge using retrieval in agents and chat interfaces. We will describe memory and knowledge and how they relate to prompt engineering strategies, and then, to understand memory knowledge, we will investigate document indexing, construct retrieval systems with LangChain, use memory with LangChain, and build semantic memory using Nexus.
8.1 Understanding retrieval in AI applications
Retrieval in agent and chat applications represents a storage mechanism that is typically external and long-lived. Unstructured retrieval can store conversation or task histories, facts, preferences, or other items necessary for contextualizing a prompt. Structured retrieval, typically stored in databases or files, is accessed through native functions or plugins.