
Meet your instructor Himanshu Sharma and join this practical introduction to Spring AI, a course with a practical approach and minimal theory; share your feedback as you begin this journey.
Learn how chat model interfaces standardize interaction with language models in Spring AI, focusing on the llama chat model class implementation and OpenAI, Hugging Face, and anthropic's class-level approaches.
Set up a Spring AI project and use a default chat model with llama, configure YAML and temperature, then run a command line test to interact with the model.
Configure a Spring AI chat setup with two beans, llama model and gemma model, using llama options, qualifiers, and the llama 3.2 latest model name.
Explore three ways to use the call method: prompt, list of messages, and string message, by building system and user messages, testing behaviors, and retrieving results with get output.
Create prompts with a prompt template by filling placeholders with a question and model, then generate the final prompt and explore custom delimiters.
Use the default chat client builder to interact with the language model. Configure the application with yaml and remove the chat model config to switch to a chat client.
Configure two chat clients, Gemma and Lama, in a chat client config, each backed by its own chat model via the Lambda api builder.
Learn how the chat client’s friendly methods set system behavior with a default system and origin, observing British and Spanish responses from llama chat and Gemma.
Enable and customize logging in a chat client by adding default advisors, configuring application YAML, and using a custom logger advisor to control request and response details.
Demonstrate structured output with a Java record for a football player and clubs using a chat client, including entity mapping, list handling, and parameterized type references.
Learn how to add chat memory to a language model by using a conversation ID to link messages, configure a memory advisor, and preserve context across calls with config settings.
Explore how embedding models generate text embeddings as n-dimensional vectors, and how the PKG vector database stores these embeddings with text to enable query time similarity search.
Set up a local vector database with Docker using a vector image tag, enable three extensions, create a test data table with embeddings, and build an index for 1024 mvi.
Interact with the embedding model and the PG vector database using a llama embedding model. Build an embedding request with hello world and spring ai is awesome, then view embeddings.
Store embeddings with their content in a vector store and query them via natural language to retrieve relevant results. Configure a Postgres vector store with cosine distance and aligned dimensions.
Present an overview of the flow for integrating a vector database with embeddings, storing the Spring Framework documentation as embeddings, and using a vector advisor to inform the chat model.
Set up a RAG flow in Spring AI by uploading a pdf, splitting into chunks, storing in a vector store, and querying with a chat client using a question-answer advisor.
Explore tool calling and the model context protocol, showing how tools overcome LM limitations from training data and how the MCP server standardizes tool metadata for the client.
Learn tool calling in a Spring AI setup, enabling client–server interaction via the Model Context Protocol, and configure Llama 3.2 for invoking tools like current time and weather.
Set up an MCP server with a tool service and tool callback provider, enabling the client to fetch tools via SSE endpoints and call the language model through MCP.
Evaluate a model's relevancy and fact accuracy in Spring AI using relevancy and fact checking evaluators, test folders, and context-based evaluation requests.
Explore the fact checking evaluator and model evaluation in Spring AI, demonstrating test-driven validation of correctness and relevancy through assertions that pass or fail.
Understand how evaluators use the default prompt template with relevancy and fact-checking checks, and create a custom evaluator that trims whitespace to reliably interpret yes responses.
This course helps students to understand different aspects of Spring AI. Ollama is used for hosting the LLM models locally which will allow students to work with language models without requiring any subscription.
ChatModel
In this section student will get an idea on the purpose of ChatModel and how it can be used in different ways to interact with language models.
ChatClient
In this section, students will get an idea about ChatClient interface which internally use ChatModel but provide convenient developer friendly methods to interact with language models. Also, student will get to know how to have a memory in their flow so that language model can able to recall previous discussion to answer query.
Embed Model
In this section, students will get an understanding of embedding models and their purpose in AI engineering. They will able to interact with embedding models and will also interact with vector store for storage and retrieval of the data.
Retrieval Augmented Generation (RAG)
In this section, students will get to know about RAG flow and the role of chat and embedding models in this setup.
Model Context Protocol (MCP)
In this section, students will get to know about tool calling feature and how it is closely related to MCP. Also how Spring AI can be used to setup MCP client and server interaction.
Model Evaluation
In this section, students get to know how models can be evaluated using Spring AI evaluators.