spring-projects/spring-aiGitHubLast refreshed Oct 3, 2026
This is a public, read-only report. Striff reads this repository's docs, turns each sentence that makes a claim about the code into a rule, and checks the rule against the code on the default branch. How this works
Names these docs write that the code no longer has2
Each sentence below names a type the default branch doesn't declare, or declares somewhere else. Edit the doc so it matches the code, or bring the type back.
* Per-request HTTP headers on AnthropicChatOptions#httpHeaders, distinct from client-level customHeaders on AbstractAnthropicOptions. customHeaders is set once on the client and applies to every request; httpHeaders is set per Prompt and merged in at request-build time. Useful for request tracing, beta-API toggles, and routing.
The repository once held models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/AbstractAnthropicOptions.java. It doesn't now. Closest names there: AnthropicCacheOptions, AnthropicChatOptions.
The main Advisor interfaces are located in the package org.springframework.ai.chat.client.advisor.api.
Advisor is in org.springframework.ai.chat.client.advisor.api
Holds
Read Oct 3
VectorStoreChatMemoryAdvisor + Retrieves memory from a VectorStore and adds it into the prompt's system text.
VectorStoreChatMemoryAdvisor depends on VectorStore
Holds
Read Oct 3
QuestionAnswerAdvisor + This advisor uses a vector store to provide question-answering capabilities, implementing the Naive RAG (Retrieval-Augmented Generation) pattern.
QuestionAnswerAdvisor depends on VectorStore
Holds
Read Oct 3
The OpenAiAudioSpeechOptions class implements the TextToSpeechOptions interface, providing both portable and OpenAI-specific configuration options.
TextToSpeechModel now extends StreamingTextToSpeechModel
TextToSpeechModel is in org.springframework.ai.audio.tts
Holds
Read Oct 3
TextToSpeechModel now extends StreamingTextToSpeechModel
StreamingTextToSpeechModel is in org.springframework.ai.audio.tts
Holds
Read Oct 3
The ChatMemory abstraction allows you to implement various types of memory to support different use cases.
ChatMemory is a contract
Holds
Read Oct 3
Spring AI auto-configures a ChatMemory bean that you can use directly in your application. By default, it uses an in-memory repository to store messages (InMemoryChatMemoryRepository) and a MessageWindowChatMemory implementation to manage the conversation history.
MessageWindowChatMemory implements ChatMemory
Holds
Read Oct 3
MessageWindowChatMemory maintains a sliding window of messages up to a specified maximum size. When the number of messages exceeds the maximum, older messages are evicted while always preserving SystemMessage instances.
MessageWindowChatMemory depends on SystemMessage
Holds
Read Oct 3
Spring AI offers the ChatMemoryRepository abstraction for storing chat memory.
ChatMemoryRepository is a contract
Holds
Read Oct 3
By default, if no other repository is already configured, Spring AI auto-configures a ChatMemoryRepository bean of type InMemoryChatMemoryRepository that you can use directly in your application.
Each message also stores a creation timestamp, exposed in the message metadata under the JdbcChatMemoryRepository.CONVERSATION_TS key as a java.time.Instant, so applications can display when a message was created.
JdbcChatMemoryRepository has CONVERSATION_TS
Holds
Read Oct 3
If you'd rather create the JdbcChatMemoryRepository manually, you can do so by providing a JdbcTemplate instance and a JdbcChatMemoryRepositoryDialect:
JdbcChatMemoryRepository depends on JdbcChatMemoryRepositoryDialect
Holds
Read Oct 3
You can extend support for other databases by implementing the JdbcChatMemoryRepositoryDialect interface.
JdbcChatMemoryRepositoryDialect is a contract
Holds
Read Oct 3
If you'd rather create the CassandraChatMemoryRepository manually, you can do so by providing a CassandraChatMemoryRepositoryConfig instance:
CassandraChatMemoryRepository depends on CassandraChatMemoryRepositoryConfig
Holds
Read Oct 3
The RedisChatMemoryRepository also implements AdvancedRedisChatMemoryRepository, which provides extended query capabilities:
MessageChatMemoryAdvisor. This advisor manages the conversation memory using the provided ChatMemory implementation.
MessageChatMemoryAdvisor depends on ChatMemory
Holds
Read Oct 3
VectorStoreChatMemoryAdvisor. This advisor manages the conversation memory using the provided VectorStore implementation.
VectorStoreChatMemoryAdvisor depends on VectorStore
Holds
Read Oct 3
The ChatMemory.CONVERSATION_ID parameter is *required* for all memory advisors.
ChatMemory has CONVERSATION_ID
Holds
Read Oct 3
Spring AI exposes this data through the standard ChatResponseMetadata#getRateLimit() accessor, which returns an AnthropicRateLimit populated from the response headers.
ChatResponseMetadata has a getRateLimit method
Holds
Read Oct 3
AnthropicChatOptions implements the StructuredOutputChatOptions interface, which provides portable getOutputSchema() method.
AnthropicChatOptions implements the StructuredOutputChatOptions interface, which provides portable getOutputSchema() method.
StructuredOutputChatOptions has a getOutputSchema method
Holds
Read Oct 3
Spring AI provides type-safe access to Anthropic's pre-built skills through the AnthropicSkill enum:
AnthropicSkill is an enumeration
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy is in org.springframework.ai.anthropic
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheTtl is in org.springframework.ai.anthropic
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy has NONE
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy has TOOLS_ONLY
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy has SYSTEM_ONLY
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy has SYSTEM_AND_TOOLS
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheStrategy has CONVERSATION_HISTORY
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheTtl has FIVE_MINUTES
Holds
Read Oct 3
Enum values of AnthropicCacheStrategy (NONE, TOOLS_ONLY, SYSTEM_ONLY, SYSTEM_AND_TOOLS, CONVERSATION_HISTORY) and AnthropicCacheTtl (FIVE_MINUTES, ONE_HOUR) are unchanged.
AnthropicCacheTtl has ONE_HOUR
Holds
Read Oct 3
The plainText(...), pdf(...), and customContent(...) factory methods still exist on the renamed AnthropicCitationDocument.
AnthropicCitationDocument is in org.springframework.ai.anthropic
Holds
Read Oct 3
Every streamed chunk now carries one MessagePart stamped with the index of the content block it belongs to (StreamingParts.partIndex) and, for deltas, StreamingParts.isPartial.
StreamingParts has partIndex
Holds
Read Oct 3
Every streamed chunk now carries one MessagePart stamped with the index of the content block it belongs to (StreamingParts.partIndex) and, for deltas, StreamingParts.isPartial.
StreamingParts has isPartial
Holds
Read Oct 3
AnthropicChatOptions.validateCitationConsistency() now enforces this and throws IllegalArgumentException before the request is sent.
AnthropicChatOptions has a validateCitationConsistency method
Holds
Read Oct 3
The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-deepseek/src/main/java/org/springframework/ai/deepseek/DeepSeekChatModel.java[DeepSeekChatModel] implements the ChatModel and StreamingChatModel and uses the <<low-level-api>> to connect to the DeepSeek service.
DeepSeekChatModel implements StreamingChatModel
Holds
Read Oct 3
The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-google-genai/src/main/java/org/springframework/ai/google/genai/GoogleGenAiChatModel.java[GoogleGenAiChatModel] implements the ChatModel and uses the com.google.genai.Client to connect to the Google GenAI service.
GoogleGenAiChatModel implements ChatModel
Holds
Read Oct 3
The link:https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java[MistralAiChatModel] implements the ChatModel and StreamingChatModel and uses the <<low-level-api>> to connect to the Mistral AI service.
MistralAiChatModel implements StreamingChatModel
Holds
Read Oct 3
The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaChatModel.java[OllamaChatModel] implements the ChatModel and StreamingChatModel and uses the <<low-level-api>> to connect to the Ollama service.
OllamaChatModel implements StreamingChatModel
Holds
Read Oct 3
The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/OllamaChatModel.java[OllamaChatModel] implements the ChatModel and StreamingChatModel and uses the <<low-level-api>> to connect to the Ollama service.
OllamaChatModel depends on OllamaApi
Holds
Read Oct 3
The https://github.com/spring-projects/spring-ai/blob/main/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatModel.java[OpenAiChatModel] implements the ChatModel and StreamingChatModel and uses the <<low-level-api>> to connect to the OpenAI service.
OpenAiChatModel implements StreamingChatModel
Holds
Read Oct 3
Spring AI provides flexible API key management through the ApiKey interface and its implementations. The default implementation, SimpleApiKey, is suitable for most use cases, but you can also create custom implementations for more complex scenarios.
SimpleApiKey implements ApiKey
Holds
Read Oct 3
Spring AI provides flexible API key management through the ApiKey interface and its implementations.
ApiKey is a contract
Holds
Read Oct 3
The item id, the item status and the assistant message phase ride along in the part's attributes(), because an item cannot be rebuilt without them.
MessagePart has an attributes method
Holds
Read Oct 3
A reasoning part is replayed only when its payload came from this provider, which ReasoningPart.replayableTo("openai.responses") reports.
ReasoningPart has a replayableTo method
Holds
Read Oct 3
getReasoning(), getToolCalls(), getMedia() and getText() are views over the same list, so the familiar accessors keep working.
AssistantMessage has a getReasoning method
Holds
Read Oct 3
getReasoning(), getToolCalls(), getMedia() and getText() are views over the same list, so the familiar accessors keep working.
AssistantMessage has a getToolCalls method
Holds
Read Oct 3
getReasoning(), getToolCalls(), getMedia() and getText() are views over the same list, so the familiar accessors keep working.
AssistantMessage has a getMedia method
Holds
Read Oct 3
getReasoning(), getToolCalls(), getMedia() and getText() are views over the same list, so the familiar accessors keep working.
AssistantMessage has a getText method
Holds
Read Oct 3
The ChatClientBuilderConfigurer applies all registered ChatClientBuilderCustomizer beans and wires up observability, mirroring what the auto-configuration does internally.
ChatClientBuilderConfigurer depends on ChatClientBuilderCustomizer
Holds
Read Oct 3
The ChatClient fluent API allows you to create a prompt in three distinct ways using an overloaded prompt method to initiate the fluent API:
ChatClient has a prompt method
Holds
Read Oct 3
validateSchema() -- validate the JSON response against the entity schema and automatically retry with error feedback on failure.
EntityParamSpec has a validateSchema method
Holds
Read Oct 3
useProviderStructuredOutput() -- send the schema to the provider as an API-level constraint instead of prompt text.
EntityParamSpec has an useProviderStructuredOutput method
Holds
Read Oct 3
Internally, the ChatClient uses the PromptTemplate class to handle the user and system text and replace the variables with the values provided at runtime relying on a given TemplateRenderer implementation.
ChatClient depends on TemplateRenderer
Holds
Read Oct 3
Internally, the ChatClient uses the PromptTemplate class to handle the user and system text and replace the variables with the values provided at runtime relying on a given TemplateRenderer implementation. By default, Spring AI uses the StTemplateRenderer implementation, which is based on the open-source https://www.stringtemplate.org/[StringTemplate] engine developed by Terence Parr.
StTemplateRenderer implements TemplateRenderer
Holds
Read Oct 3
The TemplateRenderer configured directly on the ChatClient (via .templateRenderer()) applies only to the prompt content defined directly in the ChatClient builder chain (e.g., via .user(), .system()).
NoOpTemplateRenderer implements TemplateRenderer
Holds
Read Oct 3
The metadata is included in the generated UserMessage and SystemMessage objects and can be accessed through the message's getMetadata() method.
UserMessage has a getMetadata method
Holds
Read Oct 3
The metadata is included in the generated UserMessage and SystemMessage objects and can be accessed through the message's getMetadata() method.
SystemMessage has a getMetadata method
Holds
Read Oct 3
Builder mutate() returns a ChatClient.Builder initialized with the client's default settings.
ChatClient has a mutate method
Holds
Read Oct 3
Builder mutate() returns a ChatClient.Builder initialized with the request's current settings.
ChatClientRequestSpec has a mutate method
Holds
Read Oct 3
You can disable auto-registration for a single call using AdvisorParams.toolCallingAdvisorAutoRegister(false):
AdvisorParams has a toolCallingAdvisorAutoRegister method
Holds
Read Oct 3
Or you can provide your own ToolCallingAdvisor (or any other advisor implementing ToolAdvisor) — in that case auto-registration is suppressed automatically because the chain already contains a ToolAdvisor.
ToolCallingAdvisor implements ToolAdvisor
Holds
Read Oct 3
The default is ToolCallingAdvisor.DEFAULT_ORDER.
ToolCallingAdvisor has DEFAULT_ORDER
Holds
Read Oct 3
ToolAdvisor is a marker interface that signals to the ChatClient that the advisor chain already handles tool execution.
ToolAdvisor is a contract
Holds
Read Oct 3
The interface ChatMemory represents a storage for chat conversation memory.
ChatMemory is a contract
Holds
Read Oct 3
MessageWindowChatMemory is a chat memory implementation that maintains a window of messages up to a specified maximum size (default: 20 messages).
MessageWindowChatMemory implements ChatMemory
Holds
Read Oct 3
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory.
MessageWindowChatMemory depends on ChatMemoryRepository
Holds
Read Oct 3
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The MessageWindowChatMemory is backed by the ChatMemoryRepository abstraction which provides storage implementations for the chat conversation memory. There are several implementations available, including the InMemoryChatMemoryRepository, JdbcChatMemoryRepository, CassandraChatMemoryRepository, Neo4jChatMemoryRepository, MongoChatMemoryRepository, and RedisChatMemoryRepository.
The ChatMemory.CONVERSATION_ID parameter is *required* for all memory advisors.
ChatMemory has CONVERSATION_ID
Holds
Read Oct 3
MemoryAdvisor is a marker interface extended by BaseChatMemoryAdvisor.
MemoryAdvisor is a contract
Holds
Read Oct 3
MemoryAdvisor is a marker interface extended by BaseChatMemoryAdvisor.
BaseChatMemoryAdvisor extends MemoryAdvisor
Holds
Read Oct 3
MemoryAdvisor is a marker interface extended by BaseChatMemoryAdvisor. DefaultChatClient uses this marker to detect downstream memory advisors in the auto-registration logic.
DefaultChatClient depends on MemoryAdvisor
Holds
Read Oct 3
The stream() method takes a String or Prompt parameter similar to ChatModel but it streams the responses using the reactive Flux API.
StreamingChatModel has a stream method
Holds
Read Oct 3
The https://github.com/spring-projects/spring-ai/blob/main/spring-ai-client-chat/src/main/java/org/springframework/ai/chat/prompt/Prompt.java[Prompt] is a ModelRequest that encapsulates a list of https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/chat/messages/Message.java[Message] objects and optional model request options.
Prompt implements ModelRequest
Holds
Read Oct 3
The ChatOptions class is a subclass of ModelOptions and is used to define few portable options that can be passed to the AI model.
ChatOptions extends ModelOptions
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
AssistantMessage has a getParts method
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
UserMessage has a getParts method
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
ToolResponseMessage has a getParts method
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
AssistantMessage depends on MessagePart
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
UserMessage depends on MessagePart
Holds
Read Oct 3
The content of an AssistantMessage, UserMessage, ToolResponseMessage is an ordered list of MessagePart entries, available through getParts().
ToolResponseMessage depends on MessagePart
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
MediaPart is in org.springframework.ai.chat.messages.part
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
ToolCallPart is in org.springframework.ai.chat.messages.part
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
ReasoningPart is in org.springframework.ai.chat.messages.part
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage has a getToolCalls method
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage has a getReasoning method
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage depends on ToolCallPart
Holds
Read Oct 3
The familiar accessors are views over the parts, in part order: getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage depends on ReasoningPart
Holds
Read Oct 3
getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage has a getText method
Holds
Read Oct 3
getText() joins the TextPart entries, getMedia() selects the MediaPart entries, and on AssistantMessagegetToolCalls() selects the complete ToolCallPart entries and getReasoning() the ReasoningPart entries.
AssistantMessage has a getMedia method
Holds
Read Oct 3
A message with parts but no text part has an empty text.
TextPart is in org.springframework.ai.chat.messages.part
Holds
Read Oct 3
A part can carry an OpaquePayload with a provider, a kind and opaque data, for example the Anthropic thinking signature or the Gemini thought signature.
OpaquePayload has provider
Holds
Read Oct 3
A part can carry an OpaquePayload with a provider, a kind and opaque data, for example the Anthropic thinking signature or the Gemini thought signature.
OpaquePayload has kind
Holds
Read Oct 3
A part can carry an OpaquePayload with a provider, a kind and opaque data, for example the Anthropic thinking signature or the Gemini thought signature.
OpaquePayload has data
Holds
Read Oct 3
When streaming, each chunk carries its parts stamped with the index of the content block they belong to and a partial flag, see StreamingParts.
StreamingParts has partial
Holds
Read Oct 3
PagePdfDocumentReader an implementation of DocumentReader
PagePdfDocumentReader implements DocumentReader
Holds
Read Oct 3
TokenTextSplitter an implementation of DocumentTransformer
TokenTextSplitter implements DocumentTransformer
Holds
Read Oct 3
setCharset(Charset charset): Sets the character set used for reading the text file.
TextReader has a setCharset method
Holds
Read Oct 3
Custom metadata can be added to all documents created by the reader using the getCustomMetadata() method.
TextReader has a getCustomMetadata method
Holds
Read Oct 3
The TextSplitter an abstract base class that helps divides documents to fit the AI model's context window.
TextSplitter is declared abstract
Holds
Read Oct 3
Use TokenTextSplitter.builder() to create instances.
TokenTextSplitter has a builder method
Holds
Read Oct 3
The KeywordMetadataEnricher is a DocumentTransformer that uses a generative AI model to extract keywords from document content and add them as metadata.
The FileDocumentWriter is a DocumentWriter implementation that writes the content of a list of Document objects into a file.
FileDocumentWriter implements DocumentWriter
Holds
Read Oct 3
The ChatClient class can be likened to the JdbcClient, built on top of ChatModel and providing more advanced constructs via Advisor to consider past interactions with the model, augment the prompt with additional contextual documents, and introduce agentic behavior.
ChatClient depends on Advisor
Holds
Read Oct 3
The Prompt class functions as a container for an organized series of Message objects and a request ChatOptions.
Prompt depends on ChatOptions
Holds
Read Oct 3
getLastUserOrToolResponseMessage(): Returns the last user or tool response message, useful for conversation continuity
Prompt has a getLastUserOrToolResponseMessage method
Holds
Read Oct 3
All subclasses of AbstractMessage hold their content as an ordered list of MessagePart entries, available through getParts().
AbstractMessage has a getParts method
Holds
Read Oct 3
All subclasses of AbstractMessage hold their content as an ordered list of MessagePart entries, available through getParts().
AbstractMessage depends on MessagePart
Holds
Read Oct 3
All subclasses of AbstractMessage hold their content as an ordered list of MessagePart entries, available through getParts(). getText() joins the TextPart entries and getMedia() (in UserMessage) selects the MediaPart entries, in part order, so the two accessors stay valid views over the parts.
AbstractMessage depends on TextPart
Holds
Read Oct 3
getText() joins the TextPart entries and getMedia() (in UserMessage) selects the MediaPart entries, in part order, so the two accessors stay valid views over the parts.
AbstractMessage has a getText method
Holds
Read Oct 3
getText() joins the TextPart entries and getMedia() (in UserMessage) selects the MediaPart entries, in part order, so the two accessors stay valid views over the parts.
UserMessage has a getMedia method
Holds
Read Oct 3
getText() joins the TextPart entries and getMedia() (in UserMessage) selects the MediaPart entries, in part order, so the two accessors stay valid views over the parts.
UserMessage depends on MediaPart
Holds
Read Oct 3
This class uses the TemplateRenderer API to render templates. By default, Spring AI uses the StTemplateRenderer implementation, which is based on the open-source https://www.stringtemplate.org/[StringTemplate] engine developed by Terence Parr.
StTemplateRenderer implements TemplateRenderer
Holds
Read Oct 3
You can provide your own implementation of TemplateRenderer if you need custom logic. For scenarios where no template rendering is required (e.g., the template string is already complete), you can use the provided NoOpTemplateRenderer.
NoOpTemplateRenderer implements TemplateRenderer
Holds
Read Oct 3
The method String render(): Renders a prompt template into a final string format without external input, suitable for templates without placeholders or dynamic content.
PromptTemplate has a render method
Holds
Read Oct 3
The method Message createMessage(): Creates a Message object without additional data, used for static or predefined message content.
PromptTemplate has a createMessage method
Holds
Read Oct 3
The method Prompt create(): Generates a Prompt object without external data inputs, ideal for static or predefined prompts.
PromptTemplate has a create method
Holds
Read Oct 3
The QuestionAnswerAdvisor uses a default template to augment the user question with the retrieved documents. You can customize this behavior by providing your own PromptTemplate object via the .promptTemplate() builder method.
QuestionAnswerAdvisor depends on PromptTemplate
Holds
Read Oct 3
This is distinct from configuring a TemplateRenderer on the ChatClient itself (using .templateRenderer()), which affects the rendering of the initial user/system prompt content *before* the advisor runs.
ChatClient depends on TemplateRenderer
Holds
Read Oct 3
The custom PromptTemplate can use any TemplateRenderer implementation (by default, it uses StPromptTemplate based on the https://www.stringtemplate.org/[StringTemplate] engine).
PromptTemplate depends on TemplateRenderer
Holds
Read Oct 3
The RetrievalAugmentationAdvisor is an Advisor providing an out-of-the-box implementation for the most common RAG flows, based on a modular architecture.
RetrievalAugmentationAdvisor implements Advisor
Holds
Read Oct 3
A VectorStoreDocumentRetriever retrieves documents from a vector store that are semantically similar to the input query.
VectorStoreDocumentRetriever depends on VectorStore
Holds
Read Oct 3
Spring AI automatically discovers ToolCallback beans in the application context and exposes them through the ToolCallbackResolver for name-based lookup.
ToolCallbackResolver depends on ToolCallback
Holds
Read Oct 3
**With the auto-registered ToolCallingAdvisor, this is automatic** — DefaultChatClient detects any MemoryAdvisor inside the loop and disables internal history with no additional configuration.
AugmentedArgumentEvent<T> — contains toolDefinition(), rawInput(), and arguments() for consumers.
AugmentedArgumentEvent has toolDefinition, rawInput and arguments methods
Holds
Read Oct 3
ToolAdvisor is a marker interface: any custom tool call advisor must implement it so that DefaultChatClient recognizes it, enforces the single-advisor constraint, and registers it in place of the default.
ToolAdvisor is a contract
Holds
Read Oct 3
The ToolCallback interface models a tool: it carries the definition the model sees and the execution logic invoked when the model calls it.
ToolCallback is a contract
Holds
Read Oct 3
Spring AI provides MethodToolCallback and FunctionToolCallback as built-in implementations. Implement ToolCallback directly when you need full control — for example, to proxy a remote tool source (as MCP integration does).
MethodToolCallback implements ToolCallback
Holds
Read Oct 3
Spring AI provides MethodToolCallback and FunctionToolCallback as built-in implementations. Implement ToolCallback directly when you need full control — for example, to proxy a remote tool source (as MCP integration does).
FunctionToolCallback implements ToolCallback
Holds
Read Oct 3
ToolDefinition is the contract the model sees: name, description, and input schema.
ToolDefinition is a contract
Holds
Read Oct 3
For method-based tools, ToolDefinitions.from(method) generates a definition automatically.
ToolDefinitions has a from method
Holds
Read Oct 3
The default DefaultToolCallResultConverter uses Jackson to serialize the result. Configure a custom converter on the @Tool annotation (resultConverter) or via ToolMetadata.
When a tool throws, the exception is wrapped in ToolExecutionException and handed to the ToolExecutionExceptionProcessor:
ToolExecutionExceptionProcessor depends on ToolExecutionException
Holds
Read Oct 3
These defaults (DefaultToolCallingManager.DEFAULT_MAX_CALLS_PER_TOOL / DEFAULT_MAX_TOTAL_TOOL_CALLS) apply even without calling these methods.
DefaultToolCallingManager has DEFAULT_MAX_CALLS_PER_TOOL
Holds
Read Oct 3
These defaults (DefaultToolCallingManager.DEFAULT_MAX_CALLS_PER_TOOL / DEFAULT_MAX_TOTAL_TOOL_CALLS) apply even without calling these methods.
DefaultToolCallingManager has DEFAULT_MAX_TOTAL_TOOL_CALLS
Holds
Read Oct 3
Its finish reason is ToolCallLimitExceededException.FINISH_REASON, and any tool calls that did succeed earlier in the batch are preserved under the METADATA_PARTIAL_TOOL_RESPONSES metadata key instead of being discarded.
ToolCallLimitExceededException has FINISH_REASON
Holds
Read Oct 3
Its finish reason is ToolCallLimitExceededException.FINISH_REASON, and any tool calls that did succeed earlier in the batch are preserved under the METADATA_PARTIAL_TOOL_RESPONSES metadata key instead of being discarded.
ToolCallLimitExceededException has METADATA_PARTIAL_TOOL_RESPONSES
Holds
Read Oct 3
DefaultToolCallingManager throws ToolCallLimitExceededException, carrying the tool name (null for a total-limit breach), the limit that was hit, and the partial ToolExecutionResult already executed in the current batch, so no completed work is discarded.
DefaultToolCallingManager depends on ToolCallLimitExceededException
Holds
Read Oct 3
ToolCallingAdvisor catches it and returns the breach as the final response - a single Generation (via ex.buildGeneration()), never one generation per tool call, so a successful call earlier in a parallel batch can't hide the breach from callers reading only the first result.
ToolCallLimitExceededException has a buildGeneration method
Holds
Read Oct 3
With onLimitExceeded(ToolCallLimitBehavior.RETURN_ERROR_RESPONSE), the manager instead skips the call and synthesizes an error ToolResponse — the same mechanism used for ToolExecutionException — so the model is told the limit was reached and the conversation continues instead of terminating.
ToolCallLimitBehavior has RETURN_ERROR_RESPONSE
Holds
Read Oct 3
By default, StaticToolCallbackResolver is auto-configured with all ToolCallback beans in the application context, plus tools produced by ToolCallbackProvider beans (with the exception of MCP providers, which are excluded to avoid eager listing — see xref:#consuming-mcp-server-tools[Consuming MCP Server Tools]).
StaticToolCallbackResolver depends on ToolCallback
Holds
Read Oct 3
ToolCallingAdvisor implements both CallAdvisor and StreamAdvisor, plus the ToolAdvisor marker interface.
ToolCallingAdvisor implements CallAdvisor
Holds
Read Oct 3
ToolCallingAdvisor implements both CallAdvisor and StreamAdvisor, plus the ToolAdvisor marker interface.
ToolCallingAdvisor implements StreamAdvisor
Holds
Read Oct 3
ToolCallingAdvisor implements both CallAdvisor and StreamAdvisor, plus the ToolAdvisor marker interface.
ToolCallingAdvisor implements ToolAdvisor
Holds
Read Oct 3
The marker interface is what DefaultChatClient uses to enforce that exactly one tool advisor is present in the chain — see xref:#single-tooladvisor-invariant[Single-ToolAdvisor Invariant].
DefaultChatClient depends on ToolAdvisor
Holds
Read Oct 3
ToolExecutionEligibilityChecker is a functional interface:
ToolExecutionEligibilityChecker is a contract
Holds
Read Oct 3
doAfterStream operates on the response aggregated across the iteration's chunks;
ToolCallingAdvisor has doAfterStream
Holds
Read Oct 3
doFinalizeLoopStream can transform the entire output Flux.
ToolCallingAdvisor has doFinalizeLoopStream
Holds
Read Oct 3
ToolSearchToolCallingAdvisor is a concrete example of a ToolCallingAdvisor subclass.
It overrides doInitializeLoop and doInitializeLoopStream to index the tool set at session start and augment the system message, and doBeforeCall and doBeforeStream to inject only the tools discovered so far on each iteration.
ToolSearchToolCallingAdvisor has doInitializeLoop
Holds
Read Oct 3
It overrides doInitializeLoop and doInitializeLoopStream to index the tool set at session start and augment the system message, and doBeforeCall and doBeforeStream to inject only the tools discovered so far on each iteration.
ToolSearchToolCallingAdvisor has doInitializeLoopStream
Holds
Read Oct 3
It overrides doInitializeLoop and doInitializeLoopStream to index the tool set at session start and augment the system message, and doBeforeCall and doBeforeStream to inject only the tools discovered so far on each iteration.
ToolSearchToolCallingAdvisor has doBeforeCall
Holds
Read Oct 3
It overrides doInitializeLoop and doInitializeLoopStream to index the tool set at session start and augment the system message, and doBeforeCall and doBeforeStream to inject only the tools discovered so far on each iteration.
ToolSearchToolCallingAdvisor has doBeforeStream
Holds
Read Oct 3
ToolAdvisor is a marker interface.
ToolAdvisor is a contract
Holds
Read Oct 3
The ToolIndex interface abstracts the search implementation.
ToolIndex is a contract
Holds
Read Oct 3
The ToolIndex interface and its companion types (ToolSearchRequest, ToolSearchResponse, ToolReference) live in the spring-ai-tool-search-tool module under org.springframework.ai.tool.toolsearch.
ToolIndex is in spring-ai-tool-search-tool, and ToolIndex is in org.springframework.ai.tool.toolsearch
Holds
Read Oct 3
The ToolIndex interface and its companion types (ToolSearchRequest, ToolSearchResponse, ToolReference) live in the spring-ai-tool-search-tool module under org.springframework.ai.tool.toolsearch.
ToolSearchRequest is in spring-ai-tool-search-tool, and ToolSearchRequest is in org.springframework.ai.tool.toolsearch
Holds
Read Oct 3
The ToolIndex interface and its companion types (ToolSearchRequest, ToolSearchResponse, ToolReference) live in the spring-ai-tool-search-tool module under org.springframework.ai.tool.toolsearch.
ToolSearchResponse is in spring-ai-tool-search-tool, and ToolSearchResponse is in org.springframework.ai.tool.toolsearch
Holds
Read Oct 3
The ToolIndex interface and its companion types (ToolSearchRequest, ToolSearchResponse, ToolReference) live in the spring-ai-tool-search-tool module under org.springframework.ai.tool.toolsearch.
ToolReference is in spring-ai-tool-search-tool, and ToolReference is in org.springframework.ai.tool.toolsearch
Holds
Read Oct 3
Spring AI offers an abstracted API for interacting with vector databases through the VectorStore interface and its read-only counterpart, the VectorStoreRetriever interface.
VectorStore is a contract
Holds
Read Oct 3
Spring AI offers an abstracted API for interacting with vector databases through the VectorStore interface and its read-only counterpart, the VectorStoreRetriever interface.
VectorStoreRetriever is a contract
Holds
Read Oct 3
The VectorStore interface extends VectorStoreRetriever and adds mutation capabilities:
VectorStore extends VectorStoreRetriever
Holds
Read Oct 3
The similaritySearch methods in the interface allow for retrieving documents similar to a given query string.
VectorStore has a similaritySearch method
Holds
Read Oct 3
Spring AI provides this functionality through the BatchingStrategy interface, which allows for processing documents in sub-batches based on their token counts.
BatchingStrategy is a contract
Holds
Read Oct 3
This interface defines a single method, batch, which takes a list of documents and returns a list of document batches.
BatchingStrategy has a batch method
Holds
Read Oct 3
The TokenCountBatchingStrategy internally uses a TokenCountEstimator (specifically, JTokkitTokenCountEstimator) to calculate token counts for efficient batching.
TokenCountBatchingStrategy depends on JTokkitTokenCountEstimator
Holds
Read Oct 3
For those cases the VectorStore interface offers upsert, which takes the document and its vector paired together in an EmbeddedDocument and never embeds anything itself:
VectorStore has upsert
Holds
Read Oct 3
upsert is opt-in per store: the default implementation throws UnsupportedOperationException, so a store supports it only once it has been implemented.
PgVectorStore has upsert
Holds
Read Oct 3
Spring AI's VertexAiMultimodalEmbeddingModel puts text and images in one 1408-dimension space, but it implements DocumentEmbeddingModel rather than EmbeddingModel, so using it on both sides means wrapping it for the store.
RedisVectorStore implements upsert(List<EmbeddedDocument>), so you can write documents together with embeddings you computed elsewhere instead of having the store embed them.
RedisVectorStore has an upsert method
Holds
Read Oct 3
The Redis Vector Store implementation provides access to the underlying native Redis client (RedisClient) through the getNativeClient() method:
RedisVectorStore has a getNativeClient method
Holds
181 rules from 21 docs
See these where the change is. The browser extension puts a pull request's doc findings, and a diagram of what it changed, on the GitHub page itself, so the code and what your docs say about it are side by side.