
This course introduces Retrieval Augmented Generation and Knowledge Graph concepts, focusing on how to utilize Generative AI with proprietary company information using Spring AI. A basic understanding of Java Spring programming is recommended, but no prior coding knowledge in AI is necessary; familiarity with tools like ChatGPT is sufficient.
This course requires prior knowledge of Java and basic Spring Boot programming, particularly REST API and Spring Data JPA, and covers various aspects of artificial intelligence and Retrieval Augmented Generation (RAG), including hands-on coding with Spring AI and OpenAI API, along with enhancing RAG using knowledge graphs. The course allows flexibility in skipping certain theoretical lessons based on individual needs.
This course utilizes Java Spring Boot 3 and Spring AI, focusing on OpenAI as the AI engine, though other providers are supported. It features Neo4J for graph database management and PostgreSQL for relational database needs, with a minimal cost for OpenAI usage, including possible free tiers from some AI engines.
The source code and scripts for this course are available in the "Resources and References" section, and while minor differences may occur between the video and the source files due to updates, these differences are ensured to be non-breaking for continued use in the course.
This course focuses on teaching Spring AI and Retrieval Augmented Generation, utilizing GitHub Copilot as an optional AI assistant to enhance coding efficiency, while also acknowledging its limitations and the rapid evolution of generative AI technologies. Participants can fully engage without relying on Copilot, ensuring a comprehensive learning experience.
In this optional section, we will explore Artificial Intelligence (AI) and large language models, particularly focusing on their impact on work and learning, as well as discussing prompt engineering using examples like ChatGPT and GitHub Copilot. Although it's not mandatory for those only interested in Retrieval Augmented Generation, understanding AI's role in software engineering is advised.
This lesson emphasizes that large language models like ChatGPT and GitHub Copilot are rapidly evolving, non-deterministic tools that assist rather than replace human decision-making in programming. Participants should expect to see variability in AI-generated responses and the importance of validating and adjusting these outputs using their coding skills.
The lesson explains that while many prompts and source code for the course are available for download, some simpler prompts are not. It also notes that any discrepancies between the downloadable material and the video content may be due to updates but assures that the provided resources should still be functional.
The lesson discusses how AI assistants like ChatGPT and GitHub Copilot can simplify programming by generating code based on plain English prompts, thus easing the learning curve associated with syntax, and helping users understand and detect bugs in their code. It emphasizes that while AI-generated code is valuable, it is essential to test and verify its functionality before relying on it.
Software testing is a vital aspect of the software development lifecycle that ensures quality and performance by evaluating both functional and non-functional requirements, utilizing test cases and scripts for consistency, while balancing automation tools with human oversight to mitigate risks and enhance testing effectiveness, particularly with the support of AI assistants for generating test scenarios and data.
This lesson discusses the transformative role of AI assistants in software engineering, highlighting the distinct functionalities of ChatGPT for natural language tasks and GitHub Copilot for code generation. It emphasizes best practices for their integration, including complementary usage, continuous feedback, and ethical considerations regarding licensing and user privacy.
The lesson introduces the use of ChatGPT as a web application available at chatgpt.com, which can be accessed in both free and paid versions. It also discusses the necessity of a GitHub account for using GitHub Copilot, the requirement of Visual Studio Code for the course, and highlights that these tools are available across multiple operating systems.
The lesson introduces Docker, explaining its benefits for software installation, such as handling dependencies and running on various operating systems. It provides a brief overview of the key steps for using Docker in this course, including installation, downloading Docker images, and running containers.
In this lesson, you'll learn how to download and set up Visual Studio Code on various operating systems, install essential extensions for Java and Spring development, and optionally integrate GitHub Copilot as an AI assistant for your programming tasks. The instructions are straightforward, making the setup process quick and easy.
This lesson demonstrates how to effectively use GitHub Copilot as an AI assistant for Java projects within Visual Studio Code, covering installation, setup, and various ways to interact with Copilot for coding assistance, including using its chat feature and built-in functions. It emphasizes that while using GitHub Copilot enhances the programming experience, it is not essential for completing the course.
This lesson introduces Artificial Intelligence (AI) as a field that enables computers to learn from data and recognize patterns, with special focus on Machine Learning, Deep Learning, and Generative AI. It highlights various applications of AI in domains like healthcare, finance, and entertainment, along with examples of specific generative AI models that produce text, images, audio, and video.
The lesson introduces the concept of Artificial Intelligence (AI) and Large Language Models (LLMs), highlighting their ability to learn from data, recognize patterns, and generate human-like language. It covers the components of effective prompts, including context, constraints, and output format, which guide LLMs in generating desired responses.
Large language models (LLMs) show significant advancements in AI but have limitations, including unawareness of events post-knowledge cutoff, potential outdated or factually incorrect responses, and lack of access to non-public information. Techniques like Retrieval Augmented Generation (RAG) can be employed to provide up-to-date, accurate, and proprietary information to enhance LLM responses.
Retrieval Augmented Generation (RAG) enhances the accuracy of large language model (LLM) responses by programmatically retrieving and integrating relevant external information into the input prompt. This process allows the model to generate more precise, fact-based responses while minimizing reliance on its pre-existing knowledge, effectively operating independently from the user.
The lesson discusses the critical components of the RAG (Retrieve, Augment, Generate) process, emphasizing the importance of a well-structured knowledge base, an effective indexing pipeline, and the roles of retrievers, prompt management, and LLM setups in generating accurate responses. It also highlights the significance of safeguards and security measures to protect data and maintain compliance within the RAG framework.
The lesson guides users through creating a basic Spring Boot application for AI integration with OpenAI's API, including steps for project setup, API key management, and configuring necessary dependencies while emphasizing best practices for handling sensitive information like API keys. It also covers creating configuration classes and ensuring the application runs correctly.
This lesson teaches how to create an AI Service interface in a Spring application for interacting with OpenAI, implementing methods for both blocking and non-blocking response handling. It covers the creation of an API to send prompts, receive responses, and demonstrates testing with Postman and terminal commands.
In this lesson, we will develop a basic indexing pipeline using Spring AI, involving the reading and cleaning of various data formats, splitting the text into manageable chunks, and storing it in a simple text file. The process includes utilizing specific document readers and the TokenTextSplitter to efficiently handle and organize the information for future access.
This lesson guides you through building a document indexing pipeline using Spring and the Tika library, including the creation of components for reading, processing, and writing documents, as well as implementing RESTful APIs to trigger these functionalities from file systems and URLs. Key elements include creating Spring service classes, handling metadata, and setting up validation for input requests.
In this lesson, students are guided to test a Java application by indexing HTML and PDF documents using Postman, with the process including keyword definitions and the generation of text files from the indexed content. Additionally, the lesson demonstrates indexing data from a URL, highlighting the handling of long articles and the organization of multiple documents in the output files.
The lesson explains how to implement the Retrieval Augmented Generation (RAG) process using a knowledge base, specifically a text file, in Java with the Spring AI framework. It emphasizes the use of prompt templates to create customizable prompts that can be modified without recompiling the application, enhancing the flexibility of the prompt generation process.
The lesson outlines the steps to create a Java service for a Retrieval-Augmented Generation (RAG) system, including defining a prompt template, implementing a processor service, and handling HTTP POST requests to generate and stream RAG responses based on user prompts and custom context files. It emphasizes the use of annotations, dependency injection, and reactive programming concepts to manage responses.
In this lesson, we explore how to log prompts sent to a Language Learning Model (LLM) using Spring AI Advisors to enhance functionality, followed by testing the application in Postman with financial statement queries to demonstrate both effective context retrieval and the pitfalls of incorrect knowledge base associations. The lesson emphasizes the importance of refining the indexing pipeline and Retrieval Augmented Generation (RAG) process for more accurate real-life applications.
The lesson explains the concept of embeddings in machine learning, emphasizing how non-numeric data, like text and images, must be converted into numerical vector representations for processing and similarity searching. It highlights the roles of embedding models, vector databases, and the use of cosine similarity for measuring vector closeness in high-dimensional spaces.
The lesson introduces Neo4j, a graph database that utilizes the Cypher query language for managing complex relationships and can function as a vector store for use cases like semantic search and recommendations. Participants will set up the Neo4j community edition locally using Docker, with instructions for logging in and changing the default password.
This lesson outlines the steps to configure Spring AI with a Neo4J vector store, including adding necessary dependencies, configuring connectivity, modifying indexing services, and adjusting API requests to facilitate document storage and embedding in the Neo4J database without certain parameters. The lesson emphasizes initializing the Neo4J schema and ensuring that the application runs correctly with the new configurations.
In this lesson, participants are guided to download specific sample documents, index them using a Java application and Postman, and verify their addition in a Neo4J database by running Cypher queries. The lesson emphasizes the importance of embedding dimensions in indexed documents and demonstrates the process of retrieving and filtering documents based on keywords.
The lesson explains the process of Retrieval-Augmented Generation (RAG) using vector similarity search, highlighting how to retrieve relevant documents based on user prompts using a method called "similaritySearch." It details the ability to customize the search with parameters like top K, similarity threshold, and metadata filters to optimize the results for generating responses.
The lesson outlines the steps to create a Java class named `RAGVectorProcessorService` within the "service" package, detailing the setup of various constants, methods for retrieving and augmenting prompts, and handling HTTP POST requests for generating and streaming RAG responses using an AI service. It emphasizes the integration of vector similarity search and a Neo4j vector store within a Spring framework context.
The lesson details the process of testing a vector indexing application using endpoints for financial statements and the Solar Venture Prospectus, highlighting the importance of context from a knowledge base and the limitations of vector stores in retrieving the most relevant data. It also demonstrates improvements in handling relevant document chunks effectively while minimizing data clutter.
The lesson discusses issues with the vector indexing pipeline in Neo4J, highlighting the problem of storing duplicate documents, which can lead to unnecessary context in the application’s responses and increased costs due to higher token usage in Generative AI. It emphasizes the importance of avoiding duplicate information to maintain efficiency and accuracy in the knowledge base.
This lesson focuses on enhancing a vector indexing pipeline to avoid duplicate document indexing using unique keys and hash values for each document, implemented with PostgreSQL and the reactive Spring stack. It covers table creation, dependencies, repository interfaces, and methods for processing documents reactively, while ensuring that previous chunks are removed and updated correctly in the database.
The lesson demonstrates the process of indexing documents into Neo4J and PostgreSQL using Postman, showing how to handle document updates and failures in indexing requests when the source document remains unchanged. It also highlights the management of document nodes and their corresponding chunks in the databases after modifications to the source files.
The lesson discusses the use of Neo4J as a vector database in the course due to its built-in browser and visualization features, while also highlighting that Spring AI supports various other vector databases, allowing for flexible integration with minimal changes based on user needs. It mentions that users can choose databases like PostgreSQL if preferred, and points to the Spring AI documentation for further guidance.
The lesson outlines the process of building a dedicated indexing pipeline application using Temporal, an open-source workflow orchestration platform. It covers the creation of a Spring Boot application with necessary configurations and dependencies, as well as the implementation of workflows and activities for processing documents, maintaining error handling, and leveraging features like automatic retries and scheduling.
The lesson provides an overview of graphs as collections of objects (nodes) and their relationships (edges), explaining various types of graphs (directed, undirected, weighted, bipartite, etc.) and their applications in representing complex networks such as social connections, transportation systems, and knowledge representation in AI. It highlights the significance of knowledge graphs in organizing structured and unstructured data with meaningful semantics, improving information retrieval processes.
Enhance Your Generative AI Expertise with Retrieval Augmented Generation (RAG) and Knowledge Graph
Retrieval-augmented generation (RAG) is a powerful approach for utilizing generative AI to access information beyond the pre-trained data of Large Language Models (LLMs) while avoiding over-reliance on these models for factual content. The effectiveness of RAG hinges on the ability to quickly identify and provide the most relevant context to the LLM. Knowledge Graphs transforms RAG systems with improved performance, accuracy, traceability, and completeness.
The RAG with Knowledge Graph, also known as GraphRAG, is an effective way to improve the capability of Generative AI. Take your AI skills to the next level with this ultimate course, designed to help you unlock the potential of LLMs by leveraging Knowledge Graphs and RAG systems.
In this course, you will learn:
Introduction to RAG Systems: Discover why Retrieval Augmented Generation is a groundbreaking tool for enhancing AI.
Foundations of Knowledge Graphs: Grasp the basics of knowledge graphs, including their structure and data relationships. Understand how these graphs enhance data modeling for RAG.
Implementing GraphRAG from Scratch: Build a fully operational RAG system with knowledge graphs. Use LLMs to extract and organize information.
Building Knowledge From Multiple Data Sources: Learn to integrate knowledge graphs with unstructured and structured data sources.
Querying Knowledge Graphs: Gain practical experience with leading tools and techniques.
Technology Highlights:
Spring AI: A new technology from famous Java Spring to help engineers work easily with various Generative AI and Large Language Models
Open AI: The innovative Generative AI that everyone loves. A groundbreaking tool for Large Language Models and AI.
Neo4J: Graph database and Vector store that integrates easily with Spring AI to form RAG and Knowledge Graph
Temporal: A workflow orchestrator platform to help engineers build a reliable GrahRAG pipeline.
Mastering advanced AI techniques offers a significant edge in today's fast-paced, data-driven world. This course provides actionable insights to enhance your career or innovate in your field.