Why it matters

Advisors modularize concerns. Understanding shapes Spring AI design.

Advertisement

The architecture

Interface: aroundCall (request, chain).

Chain of advisors.

QuestionAnswerAdvisor, MessageChatMemoryAdvisor, etc.

Advisor patternRequestuser promptAdvisor chainRAG / memory / safetyLLM call + responsepost-processSimilar to Spring MVC interceptors or servlet filters; composable + testable
Advisors.
Advertisement

How it works end to end

QuestionAnswerAdvisor: RAG.

MessageChatMemoryAdvisor: memory.

SafeGuardAdvisor: safety.

Custom advisors possible.