liveBook · Manning

Agentic RAG

As explained in Domain-Specific Small Language Models

A retrieval-augmented generation setup that uses an AI agent to plan, select, and combine retrieval actions across one or more sources before generation.

Agentic RAG combines retrieval-augmented generation with an AI agent that plans retrieval, revises queries, and uses multiple tools before generating an answer. section 14.2

It keeps the basic RAG flow of retrieving external context and passing it to a language model, but adds autonomous control over how retrieval happens. section 14.2 section 14.4

Typical capabilities include:

  • planning multi-step retrieval and adapting queries from what is found. section 14.2
  • combining specialized tools or smaller agents to make retrieval more efficient and easier to maintain. section 14.2
  • choosing among local search, web search, and hybrid retrieval strategies. section 14.2 section 14.4

Basic agentic flow

A query can first search a vector database; if the result is not relevant, the agent can search the web for added context before answering. section 14.2

Figure 14.3 The logical schema of a basic agentic RAG system

Shows the logical schema of a basic agentic RAG system with retrieval followed by conditional fallback search. section 14.2

It is positioned for customer support, research assistance, knowledge management, and domain-specific problem solving. section 14.2

How Domain-Specific Small Language Models covers it

How deep it goes
Defines the pattern, contrasts it with traditional RAG, and sketches tool-driven workflows without detailing agent internals.
Examples
Uses a vector-database-first fallback to web search, plus CodeAgent examples with BM25 search, semantic search, and hybrid search.
What it assumes
Assumes familiarity with RAG and agentic AI, while introducing their combination from the ground up.
What you can do after
Apply it via an agent that can choose search strategies, combine tools, and improve retrieval quality before answering.
How it connects
Connects RAG, agentic AI, vector databases, web search, BM25, hybrid search, LangChain, and smolagents.

Also explained in

Compare how 4 books explain agentic RAG →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.