liveBook · Manning

RetrievalAugmentationAdvisor

As explained in Spring AI in Action

RetrievalAugmentationAdvisor is a Spring AI advisor that assembles retrieved document context into a language-model interaction through configurable retrieval and processing components.

RetrievalAugmentationAdvisor is a modular Spring AI RAG advisor that retrieves document context and assembles it into a language-model interaction. Unlike a vector-store-specific advisor, it accepts a configurable DocumentRetriever, allowing retrieval from a vector store or another knowledge-base service. section 4.6

Configure the advisor by composing retrieval and query-processing components:

  • Add the Spring AI RAG dependency, then create the advisor with its builder. section 4.6
  • Provide a DocumentRetriever; VectorStoreDocumentRetriever supplies the vector-store implementation. section 4.6
  • Attach query transformers such as TranslationQueryTransformer and RewriteQueryTransformer to translate and focus searches. section 4.6.2
  • Attach MultiQueryExpander to generate alternative searches, controlling query count and whether the original query remains. section 4.6.3
  • Register the advisor as a ChatClient default advisor or apply it while building an individual prompt. section 4.6

Multilingual, expanded retrieval

A vector store containing English board-game rules can receive an English translation of a German question, followed by a focused rewrite. MultiQueryExpander can additionally produce differently worded searches so similarity retrieval may find documents missed by the original wording. section 4.6.2 section 4.6.3

How Spring AI in Action covers it

How deep it goes
Explains dependency setup, builder composition, retriever choice, transformers, expansion, and ChatClient registration without detailing advisor internals.
Examples
Uses English board-game rules, German questions, query rewriting, translation, and alternative Burger Force Field searches.
What it assumes
Assumes familiarity with ChatClient and vector stores while introducing DocumentRetriever and modular RAG configuration.
What you can do after
Build configurable RAG interactions with Spring AI by selecting retrievers and composing query-processing components.
How it connects
Connects retrieval-augmented generation with ChatClient, DocumentRetriever, vector stores, query transformation, query expansion, and advisors.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.