liveBook · Manning

Chapter 14: Advanced components for LLM applications

What you will learn in chapter 14 of Domain-Specific Small Language Models

This introduction previews chapter 14’s extensions to RAG and agents, building on the systems introduced in chapter 13.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction previews chapter 14’s extensions to RAG and agents, building on the systems introduced in chapter 13.

14.1 GraphRAG

This section explains how a local GraphRAG implementation turns source documents into a knowledge graph and community summaries, then uses those summaries to answer questions.

Key terms: baseline RAG, semantic similarity, knowledge graph, entities, relationships, GraphRAG, text chunks, structured outputs, JSON schema, Pydantic

14.1.1 Microsoft’s open source GraphRAG capabilities

This subsection explains Microsoft’s open source GraphRAG search options, supported models and storage, CLI workflow, and capabilities that require additional tools.

Key terms: global search, local search, community summaries, AI-extracted KG, embeddings, OpenAI, Azure OpenAI, open source SLMs, fork, Parquet

14.1.2 Evaluation metrics

This section explains why RAG and GraphRAG need evaluation metrics for both retrieval and answer generation, and how those metrics can be combined and implemented.

Key terms: BLEU, ROUGE, precision, recall, RAG metrics, context precision, context recall, retrieved documents, faithfulness, answer relevancy

14.2 RAG + Agentic AI

The section builds an agentic RAG example that lets an agent choose among local keyword search, semantic search, hybrid search, and web search for a user’s query.

Key terms: agentic RAG, traditional RAG, retrieval, AI agents, BM25, BM25Retriever, BM25SearchTool, document chunks, LanceDB, embeddings

14.3 Long- and short-term memory management

This section explains how short- and long-term memory can add relevant past interactions to LLM prompts and shows how Memoripy manages that memory.

Key terms: short-term memory, long-term memory, context, Memoripy, embeddings, concepts, cosine similarity, spreading activation, decay, MemoryManager

14.4 Summary

Concepts explained in this chapter

← Chapter 13: Creating end-to-end LLM applications Chapter 15: Test-time compute and small language models →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.