
Explore fundamentals of Gen AI and Spring AI, set up OpenAI, run local models, and build chatbots and multimodal apps with embeddings, vector stores, prompts, and moderation.
Maximize your learning in this hands-on spring ai for beginners course by completing short lectures and quizzes. Then set up spring tool suite, OpenAI, Ollama, and Docker to run models.
Access the lecture resources to download a zip file, unzip it, and import two completed Maven projects into your IDE for reference as you build your own from scratch.
Download a zip of the course slides, unzip to access a Keynote for Mac and a PowerPoint for Windows, then share them with colleagues.
Download prompts document provides prompts for travel guidance, cuisine helper, and interview helper, enabling you to copy prompts from the PDF into your code.
Learn what generative AI is, how it differs from traditional AI and machine learning, and how GPT models generate new content using neural networks and NLP.
Explore what OpenAI is and how the OpenAI API enables developers to access text, images, and audio models via RESTful HTTP calls with Python or JavaScript libraries.
Learn to work with multiple llms, from OpenAI to Google Gemini, and open source models like llama, gamma, and mistral, then install and use Olama locally with RAM guidance.
Discover spring AI, a module that simplifies building large language model apps by abstracting boilerplate and enabling chat models for OpenAI, Vertex AI Gemini, and Llama Mistral.
Explore spring ai documentation to navigate large language models and switch between models like Amazon Bedrock and Anthropic. Access the spring ai reference and chat models in the left panel.
Learn to create and access an OpenAI account, navigate the home page, manage billing and profile, and monitor usage and free credits for building AI apps.
Create an OpenAI API key, keep it secret, and set it as an environment variable named OpenAI_API_key. Export this variable on Windows, Mac, or Linux to enable authenticated API calls.
Explore the OpenAI playground in your web browser to interact with models, choose a model, and run prompts, while using system, user, and assistant messages to guide behavior.
Explore how to drive model behavior with configurable options such as temperature, max tokens, top sequences, top p, and frequency and presence penalties.
Install and run open source language models locally with Ollama, pull Gemma 2b, manage models via command line, and access them through localhost:11434.
Set up a Spring Boot project with a Spring Starter, Thymeleaf, and Web dependencies. Integrate OpenAI via the Spring AI OpenAI Starter, and wire controllers, a service, and Thymeleaf templates.
Learn how Spring AI supports generic chat clients versus specific OpenAI chat model classes, how the starter and pom.xml configure the model, and how to set connection details in application.properties.
Build ChatGPT-like apps with Spring AI using an ask anything flow that calls OpenAI GPT models via a chat client and renders answers in a simple UI.
Learn how LLMs lack built-in memory by showing that each request is stateless; build your app to maintain context by sending previous interactions with every query using Spring AI.
Capture outgoing requests and incoming responses to maintain in-memory chat memory and context for large language models, using Spring AI advisors such as the message chat memory advisor.
Configure memory for a chat app by exposing a chat memory bean and a message chat memory advisor as the default advisor, enabling context preservation in chat interactions.
Configure OpenAI chat options by setting model, temperature, and max tokens in code or application.properties, using a prompt instance via setter or builder, to tailor responses.
Explore running open source models locally in spring boot apps with spring ai and gemma 2B via Ollama, then create and wire a spring starter project to test locally.
Learn to create prompt templates with placeholders for city, month, language, and budget, instantiate with Spring AI, replace values via create, and pass the prompt to the ChatLine prompt method.
Build a travel guide app with a four-parameter prompt template, filling city, month, language, and budget to generate a travel guide response rendered on the UI.
Implement the cuisine helper use case to fetch popular cuisines by country in a chosen language, return a country cuisines object, and render cuisines in the UI.
Learn prompt engineering to curb model hallucinations and craft precise prompts for GenAI apps, using a cuisine helper example to test country-specific dish information.
Learn how text embeddings convert words, phrases, and sentences into numeric vectors that capture context and meaning, enabling similarity, search, recommendations, and language translation.
Retrieve word and sentence embeddings using OpenAI's embedding model, display the resulting float vectors as comma-separated values, and test with words like dog or cat.
Learn to calculate a similarity score between two texts using embeddings and cosine similarity. Explore how to build a similarity finder in spring ai with a simple UI.
Store and retrieve data with vector stores, create embeddings, and run similarity searches in Spring AI, then inject the store implementation via dependencies.
Switch to Pine Cone as your vector store in spring ai by setting up a Pine Cone account, creating an index, and generating an API key.
Set up a Pinecone account, create an index for embeddings and text chunks, and generate API key to connect your Spring app using text embedding 3 small model (1536 dimensions).
Update a Spring Boot project to enable vector stores by adding Pinecone dependencies and keys, then load job listings for vector search on the Pinecone index Spring AI demo.
Walk through building a job-search feature with a vector store and semantic search. Load and chunk listings, compute embeddings with OpenAI, and query a chroma DB to fetch matching jobs.
Master the token text splitter class in spring ai for beginners, exploring overloaded constructors and tuning chunking with default and minimum sizes, length to embed, maximum chunks, and separator retention.
Load the job listings into the Chroma DB vector store by creating a data initializer class, reading the text file, splitting into chunks, and saving to the demo collection.
Implement the job search helper end-to-end by wiring the data initializer, a vector store, and the OpenAI service to perform semantic search over document content.
Learn to use the search request for similarity searches with filters and top-k in the spring vector store, then restart Docker for a fresh Chroma DB.
Learn how rag, or retrieval augmented generation, improves prompts by retrieving relevant latest or company data, chunking documents, and using embeddings in a vector store.
Build a product data bot by loading product data.txt into a vector store, chunking it, generating embeddings, and using Spring AI's Rag advisor to answer with an LLM.
Learn to implement retrieval augmented generation by loading product data into a vector store using product-data.txt, reusing the job listings code, and generating embeddings with a token text splitter.
Finish implementing a rag use case by building a product data bot that returns a string response to user queries via the OpenAI service and a vector store.
Explore how rag bot powers a product data bot by embedding queries, performing semantic search in a vector store, and delivering context-aware responses from a model.
Generate images with OpenAI's Dall-E and analyze them via a multimodal GPT model, then explore calling the image model with an image prompt and adjustable options in the demo app.
Build an image generator using OpenAI image models by entering a prompt to produce and display an image URL in a Thymeleaf UI.
Explore multi-modality in large language models, using GPT to analyze images via the chat client and media method, and build an image analyzer and diet helper.
Pass system and user messages in Spring AI to guide the LLM, implement generate answer with roles, and prepare prompts and media for image analysis.
Implement the image analyzer use case by uploading an image through the Thymeleaf user interface, sending the prompt to the image processing controller, and generating an explanation via the service.
Create the explain image method by sending a text prompt and an uploaded image via chat client, using mime type utils and a file system resource to return the explanation.
Test the image analyzer by downloading a sample image, uploading it, and asking it to describe the image, then receive a multimodal GPT explanation of an airport terminal scene.
Explore practical image analysis use cases: analyze fridge items, generate website HTML/CSS from an image, and get living room design prompts with downloadable resources.
Create a diet helper app that lets users upload two diet images, compare nutrition facts like Belvita breakfast and Choco chips, and receive model-generated diet advice based on prompts.
Learn to use transcription and text-to-speech models with Spring AI to convert audio to text, generate captions, and produce audio from text by configuring options and passing an audio file.
Implement a speech to text feature using OpenAI's transcription model to upload audio and obtain text transcriptions in a Spring app via Thymeleaf templates and a transcription prompt.
Configure OpenAI audio transcription prompts with a builder pattern, specifying language, model, translation prompts, and response formats like VTT to create multilingual subtitles.
Implement a text to speech feature that converts user input into audio, streams from the controller using OpenAI models, and enables download as output.mp3.
Welcome to Spring AI for Beginners!
This course is designed to provide a gentle, step-by-step introduction to Spring AI, guiding you
from the basics to more advanced concepts. Whether you're a complete novice or have some
experience with AI, this course will help you understand and leverage the power of Spring AI for
building AI-powered applications.
Course Goals:
- Gradual Learning: Learn Spring AI gradually from basic to advanced topics with clear and
concise instructions.
- Comprehensive Understanding: Understand why Spring AI is a powerful tool for building AI
applications and how it simplifies the integration of language models into your projects.
- Hands-On Experience: Gain practical experience with essential Spring AI features such as
prompt templates, chains, agents, document loaders, output parsers, and model classes.
What You Will Learn:
- Introduction to Spring AI: Get started with the basics of Spring AI and understand its core
concepts.
- Building Blocks of Spring AI: Learn about prompt templates, chains, agents, document loaders,
output parsers, and model classes.
- Creating AI Applications: See how these features come together to create a smart and flexible
- Practical Coding: Write and run code examples to get a hands-on sense of how Spring AI
development looks like.
Course Structure:
- Concise Chapters: Each chapter focuses on a specific topic in Spring AI programming,
ensuring you gain a deep understanding of each concept.
- Interactive Learning: Code along with the examples provided to reinforce your learning and build
your skills.
By the end of this course, you will:
Learn what Spring AI is how it simplifies using LLMs in our applications
Use OpenAI LLMs in a Spring Boot application
Use Open Source LLMs like Mistral,Gemma in a Spring Boot application
Run Open Source LLMs on your local machine using OLLAMA
Use PromptTemplates to reuse and build dynamic prompts
Learn why and how to maintain Chat History
Learn what embeddings are and use the Embeddings Model to find text Similarity
Understand what a Vector Store is and use it to store and retrieve Embeddings
Understand the process of Retrieval Augmented Generation(RAG)
Implement (RAG) to use our own data with LLMs in simple steps
Analyze images using Multi Modal Models
Build multiple LLM APPs using Thymeleaf and Spring AI
All in simple steps