chapter fourteen

14 Advanced components for LLM applications

 

This chapter covers

  • RAG on a knowledge graph
  • Combining RAG and agentic AI using only SLMs
  • Managing short- and long-term memory for chatbots and AI agents

In chapter 13, you learned about two key paradigms for language models: retrieval­-augmented generation (RAG) and agentic AI. We built a RAG system from scratch, introduced vector databases for these applications, and implemented an AI agent using the open source smolagents framework. In this chapter, we’ll cover some new concepts and tools that can make RAG systems and agents more robust, and you’ll learn how to combine them.

14.1 GraphRAG

14.1.1 Microsoft’s open source GraphRAG capabilities

14.1.2 Evaluation metrics

14.2 RAG + Agentic AI

14.3 Long- and short-term memory management

Summary