Powering Spring AI with Model Context Protocol
Integration
SOUJAVA - Java 30Y #CelebrationWeek
Juarez Barbosa Junior @juarezjunior
Senior Principal Java Developer Evangelist
ORACLE
Copyright © 2025, Oracle and/or its affiliates
Juarez Barbosa Junior
Senior Principal Java Developer Evangelist @ Oracle
• Speaking from Dublin, Ireland
• 30 years of experience in SW Engineering & DevRel
• Oracle, Microsoft, IBM, Nokia, Unisys, Accenture, startups
• Microsoft Azure Developer Relations Lead
• IBM Watson Tech Evangelist & Cloud Rockstar
• IBM Mobile Tech Evangelist & Global Thought Leader
• Nokia Developers Global Champion
• Java, Python, Cloud, DevOps, SRE, Cloud-native, IoT, AI, Blockchain, Rust
• Speaker at conferences
• Oracle CloudWorld, Oracle Code, Microsoft Ignite & TechX, jPrime, JCON,
DevConf.cz, GeeCon, DevOpsDays, DeveloperWeek, DevOps Institute,
CloudLand, DWX, The Developer’s Conference (TDC), Sec4Dev, JSNation,
NodeConf, Conf42, Shift Conf, Global Azure, Open-Source Lisbon,
CodeFrenzy, Mêlée Numérique, React Summit, Test.js Summit, Porto
TechHub Conf, I Love Tech, Pyjamas, MiTechCon, Data Science Summit,
OpenSourceNorth, WeAreDevelopers, Global Software Architecture
Summit, Java Day Istanbul, JUGs, OUGs, GDGs, meetups, hackathons, and
customer engagements.
@juarezjunior
@juarezjunior
Confidential - Oracle Restricted
Agenda
• Spring AI - overview
• Spring AI - basics (chat, image, multimodal)
• Oracle AI Vector Search
• Spring AI + Oracle AI Vector Search + RAG
• Spring AI - Tool calling
• Agentic Protocols - MCP, A2A, ACP
• MCP - Model Context Protocol
• Spring AI - MCP
• Spring AI - Agentic Patterns
• Technical References
• Reference Architecture for GenAI
• Oracle Developer Relations
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
AI and GenAI –
Synthetic Content
Brasilia in Brazil pictured in a futuristic cityscape
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Artificial Intelligence / GenAI
• Core concepts in a nutshell
• GenAI - Artificial intelligence algorithms and transformer models with
the capability of generating content.
• Content - Text, images, videos, code, and others.
• Generation – a result of an input prompt (prompt engineering).
• Ethical issues – misuse, deep fakes, bias and discrimination,
automation and job replacements, cybersecurity and cybercriminals.
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Artificial Intelligence / AGI / ASI
• Core concepts in a nutshell
• Apps – Applied in the fields of content development, entertainment,
drug discovery, software development, healthcare, material
generation sciences, and others.
• AI is now a commodity!
• Artificial General Intelligence (AGI) – ultimate goal
• Artificial Super Intelligence (ASI)
Copyright © 2025, Oracle and/or its affiliates
Spring AI - Connecting your enterprise
data and APIs with AI models
Confidential - Oracle Restricted
Spring AI (1.0.0)
• Spring AI (AI Concepts)
• A Java app framework for building AI-related applications. It provides a robust abstraction layer
that encapsulates many of the complexities required to interact with various GenAI providers,
such as OpenAI, Cohere, Google Vertex AI/Gemini, and others.
• API support across AI providers for chat, text-to-image, embedding models, agents, etc.
• Its goal is to apply to the AI domain Spring ecosystem design principles, such as portability and
modular design, and promote using POJOs as the building blocks of an application to the AI
domain.
• https://spring.io/projects/spring-ai
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Spring AI
• Spring AI – Blazingly Fast Performance
• GraalVM
• Native Image - compile Java code ahead of
time (AOT) to a binary – a native executable
• Developing an Oracle JDBC app with GraalVM
Native Image
• mvn -Pnative native:compile
• ./target/spring-ai-graalvm-oai.exe
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Spring AI
• Spring AI – Blazingly Fast Performance
• Spring with Virtual Threads
• Add the following entry in the application.properties file:
spring.threads.virtual.enabled=true
• Class VirtualThreadTaskExecutor
• Embracing Virtual Threads
• All together now: Spring Boot 3.2, GraalVM native images, Java 21, and virtual
threads with Project Loom
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Spring AI
• The Spring AI API covers a wide range of functionalities
• Chat Completion API
• Embeddings API
• Image Generation API
• Speech / Transcription API
• Vector Databases
• Function Calling / Tools API
• MCP – Model Context Protocol
Copyright © 2025, Oracle and/or its affiliates
Spring AI – Basic Scenarios
Confidential - Oracle Restricted
Chat Completion - Spring AI with Open AI
• Demo – Chat - Direct LLM calls
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Image Generation - Spring AI with Open AI
• Demo – Image Generation
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Multimodality - Spring AI with Open AI
• Demo - Multimodality
Copyright © 2025, Oracle and/or its affiliates
Oracle AI Vector Search
Confidential - Oracle Restricted
Oracle Database 23ai
Next-Generation Converged Database Services
Over 300 major new features plus thousands of enhancements
Available on OCI and Azure
Major focus on
• AI for Data features
• Developer/Analyst features
• Mission-Critical features
Addresses data management pain points that have frustrated customers forever
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Oracle Database 23ai - AI for Data
Algorithmic AI AI Vector Search Augmented Generative AI (LLMs)
Distributed AI AI Storage AI Developer Tools
Copyright © 2025, Oracle and/or its affiliates
Oracle Database 23ai Vector Search
Converged Database
Add vector search to your business database
NEW Vector data type for storing vector embeddings
NEW SQL syntax and functions express similarity search with
ease
NEW Approximate search indexes packaged and tuned for
high performance and quality
There is no need to move and synchronize data,
manage multiple products, etc.
Better Together: Business Data and Business Vectors
Copyright © 2025, Oracle and/or its affiliates
20
21 Copyright © 2025, Oracle and/or its affiliates
How
Oracle AI Vector Search Works
Databases have
traditionally
performed value-
based searches
Orders
Customer
records
Products
Find revenue
by products
22 Copyright © 2025, Oracle and/or its affiliates
Growing volume
of unstructured
business data that
must be searched by
semantics
Find products that
match a photo or
description
Orders
Customer
records
Products
Medical
forms
Invoices
Social data
images
Videos
Phone call
scripts
The “all data” opportunity
JSON
23 Copyright © 2025, Oracle and/or its affiliates
AI Vector Search A new breakthrough
technology to help find
documents, images, and
other unstructured data
Based on their semantic
content, rather than
their words or pixels
24 Copyright © 2025, Oracle and/or its affiliates
Vector
33
42
16
21
50
An AI Vector is a sequence of
numbers, called dimensions, used to
capture the important “features” of
the data
Represent the semantic content of
data, not the actual words in a
document or pixels in an image
Produced by AI Deep Learning
Models known as Embedding
Models
25 Copyright © 2025, Oracle and/or its affiliates
The main operation on vectors is the
Mathematical Distance between them
8
2
1
3
3
2
6
2
Distance (Euclidean Squared)
= ((3-2)2+(1-6)2+(2-2)2+(8-3)2)
There are many mathematical distance formulas
26 Copyright © 2025, Oracle and/or its affiliates
Laptop Gen 32
Support Rep: Jane Doe
Email: jane@doe.com
• Severity 1
• Spontaneous reboot
• Resolved
• Applied OS Update 42
Support Incident
An Example Business Scenario:
The vector for a support incident could be ...
Vector
33
42
16
21
50
27 Copyright © 2025, Oracle and/or its affiliates
Laptop Gen 32
Support Rep: Jane Doe
Email: jane@doe.com
• Severity 1
• Spontaneous reboot
• Resolved
• Applied OS Update 42
Support Incident
An Example Business Scenario:
The vector for a support incident could be ...
Each dimension
(number), represents a
different feature of the
support incident
Vector Features
Severity
Current OS version
Symptoms
Product
Status
33
42
16
21
50
Note: Features are often chosen by ML algorithms and are not as simple as shown here
28 Copyright © 2025, Oracle and/or its affiliates
Copyright © 2025, Oracle and/or its affiliates
29
Collapsing vectors into 2 dimensions
instead of hundreds could look like this
d2
d1
Support Incidents
for Laptops running
slowly
Support Incident
for Desktop crashing
Copyright © 2025, Oracle and/or its affiliates
30
d2
d1
Not as Similar
Similar
Similarity Property: Images that are more similar
produce vectors that are closer together
Copyright © 2025, Oracle and/or its affiliates
31
d2
d1
Similarity Property: Images that are more similar
produce vectors that are closer together
Documents and
images also work the
same way
Document vectors that
represent similar
content are closer
than those
representing dissimilar
content
blackberry
strawberry
apple
raspberry
pear
plum
cat
kitten
dog
puppy
wolf
lion
Texas
California
New York
kiwi
elephant
Animals
Fruit
States
tiger
32 Copyright © 2025, Oracle and/or its affiliates
Now that we know what vectors are, let’s talk
about how they are used
Vector Search works best when combined
with relational search to solve
business problems
33
42
16
21
50
Copyright © 2025, Oracle and/or its affiliates
Use cases
What do embeddings and vector databases enable?
Similarity Search
Match candidates with jobs
Image and video retrieval
Find patients with similar issues
Legal e-discovery
Content-Based
Filtering
Personalized recommendation
Find retail items from image
Natural Language
Processing
Text Classification and Clustering
SQL generation
Data Analytics
Anomaly detection
Pattern recognition
Computer Vision
Face recognition
Biometric identification
Object detection
Biomedical Research
Gene/DNA similarity analysis
Molecular structure search
Geographic
Information Systems
Spatial analysis
Map rendering
Industrial Applications
Quality control
Predictive maintenance
Machinery malfunction
What is Vector Generation or Embedding?
• The process of converting unstructured data (text, images, etc.) into vectors
• Vectors are generated using deep-learning embedding models
• Vector embedding models can be obtained commercially, from Open Source, or can be created
• There may be no BEST embedding model, and different data may need different models
• No one size fits all
• Evaluate a model based on your data
34 Copyright © 2025, Oracle and/or its affiliates
Embedding
Model
Unstructured
Data
Deep-learning
ML models
Vectors
Perform AI Vector Search on VECTOR columns using SQL
AI Vector Search Highlights
GENERATE
STORE
SEARCH
INDEX
INTEGRATE
35
Generate vector embeddings from unstructured data
Store vectors in table columns using new VECTOR type
Build approximate vector indexes on VECTOR columns
Integrate with Mission-Critical Enterprise Capabilities
Copyright © 2025, Oracle and/or its affiliates
AI Vector Search powers Complete Gen AI pipeline
Data Sources Document
Loaders
Document Transformation
(e.g., Text Splitting,
Summarization)
Embedding
Models
Vector
Database
Similarity
Search
LLMs User
AI Vector Search in Oracle 23ai Database
RAG
1. Native Database APIs for Gen-AI, from Document Processing to
REST call-outs to LLM Providers
2. Tight integration with 3rd party frameworks such as Langchain
36 Copyright © 2024, Oracle and/or its affiliates
Spring AI - Vector Search + RAG
Confidential - Oracle Restricted
Retrieval-Augment
Generation (RAG)
• RAG (Retrieval-Augment Generation) with Oracle Cloud / Oracle Database
23ai
• LLMs' baseline knowledge might have gaps based on their training data. If you ask
an LLM to write about a recent trend or event, the LLM won't know what you're
talking about, so you may get meaningless responses.
• There's a way to provide LLMs with additional information (including business-
specific data)- that is what RAG is for!
• Oracle - What Is Retrieval-Augmented Generation (RAG)?
• Oracle – What Is Generative AI? How Does It Work?
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
• RAG (Retrieval-Augment Generation) with Spring AI
• In a nutshell, RAG is a technique that:
• Reads unstructured data;
• Converts the data into tokens;
• It uses embeddings to transform the tokens into floating-point arrays
or vectors so that LLM can process and interpret them;
• It stores vectors in Vector Databases.
Copyright © 2025, Oracle and/or its affiliates
Retrieval-Augment
Generation (RAG)
Confidential - Oracle Restricted
RAG – Retrieval-Augment Generation
Spring AI with Open AI and Oracle Database 23ai
• Demo - RAG – Retrieval-Augmented
Generation with Spring AI +
OracleVectorStore + Oracle Database 23ai
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Tool Calling - Spring AI
Copyright © 2025, Oracle and/or its affiliates
Source: Spring AI
Confidential - Oracle Restricted
Tool Calling - Spring AI with Open AI
• Demo - Tool Calling
Copyright © 2025, Oracle and/or its affiliates
Agentic Protocols – MCP, A2A, ACP
Confidential - Oracle Restricted
Agentic Protocols – MCP, A2A, ACP
Copyright © 2025, Oracle and/or its affiliates
Introducing the Model Context Protocol (November 2024)
• MCP – Model Context Protocol (Anthropic)
• Standardizes context and tool integration between LLM hosts/clients and data/tool
servers
• Uses JSON-RPC 2.0 over standard transports (stdio and HTTP with SSE)
• Offers capability discovery and negotiation between client/browser and servers
• Multi-language SDK support (Python, TypeScript, Go, Java, C#, Rust)
• Focus: enabling LLMs to connect to external tools and data sources (“USB-C for AI”)
Confidential - Oracle Restricted
Agentic Protocols – MCP, A2A, ACP
Copyright © 2025, Oracle and/or its affiliates
Announcing the Agent2Agent Protocol - A2A (April 2025)
• A2A – Agent2Agent Protocol (Google)
• Enables secure agent-to-agent communication and coordination in multi-agent
workflows
• Built on existing standards: HTTP, SSE, JSON-RPC, and security mechanisms.
• Uses “Agent Cards” (JSON contracts) for agent capability and trust discovery
• Facilitates cross-organizational and platform interoperability (Google, Oracle,
Microsoft, others)
• Focus: universal interoperability of autonomous agents across diverse environments
Confidential - Oracle Restricted
Agentic Protocols – MCP, A2A, ACP
Copyright © 2025, Oracle and/or its affiliates
The simplest protocol for AI agents to work together (May 2025)
• ACP – Agent Communication Protocol (IBM)
• Defines a REST-based agent communication standard with well-defined HTTP
endpoints
• Supports multimodal message payloads using arbitrary MIME types (text, image,
audio, custom binary)
• Offers both synchronous and asynchronous (including streaming) modes
• No mandatory SDK: official SDKs available in Python and TypeScript
• Focus: broad agent-to-agent communication interoperability, agnostic of internal
architecture
Confidential - Oracle Restricted
Agentic Protocols – MCP, A2A, ACP
Copyright © 2025, Oracle and/or its affiliates
Introducing the Model Context Protocol (Nov. 2024)
MCP - Model Context Protocol
Confidential - Oracle Restricted
MCP – Architecture
Copyright © 2025, Oracle and/or its affiliates
Source: Model Context Protocol -
Introduction
• Client-server architecture – main components
• MCP Hosts: Programs like Claude Desktop, IDEs, or AI tools that want
to access data through MCP
• MCP Clients: Protocol clients that maintain 1:1 connections with
servers
• MCP Servers: Lightweight programs that each expose specific
capabilities through the standardized Model Context Protocol (1…*).
Servers can also include additional logic, caching, data
transformations, others
• Local Data Sources: Your computer’s files, databases, and services
that MCP servers can securely access
• Remote Services: External systems available over the internet (e.g.,
through APIs) that MCP servers can connect to
• MCP Inspector: debugging and analysis tool for inspecting,
visualizing, and validating context passed through the Model Context
Protocol in LLM applications
Confidential - Oracle Restricted
MCP –
Internals
Copyright © 2025, Oracle and/or its affiliates
Source: Demystifying
(MCP)
Spring AI - MCP
Confidential - Oracle Restricted
Spring AI + MCP Java SDK - Overview
Copyright © 2025, Oracle and/or its affiliates
Source: Spring AI MCP / MCP Java SDK
Confidential - Oracle Restricted
Spring AI – MCP Examples
• Demo – Model Context
Protocol (examples)
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Spring AI + MCP – Dynamic Tool
Update
Copyright © 2025, Oracle and/or its affiliates
Source: Dynamic Tool Updates in Spring AI's Model Context Protocol
• Dynamic Tool Updates in Spring AI's Model Context
Protocol
• Zero Downtime Tooling
• Real-Time Discovery & Adaptability
• Future-Proof & Pluggable Architecture
• Unified, Structured Tool Interface
• Enhanced Agent-Style Orchestration
Agentic Systems
Input Prompt
Tools
Agent
Tool calling Tools results
Complement from tool results
User Interface
AI Agents
Agents Pipeline
AI
Final answer
Comprises Java tools/function
calling, MCP, API calls, etc...
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
• Workflows
• Systems where LLMs and tools are
orchestrated through predefined code
paths (prescriptive system)
• Agents
• Systems where LLMs dynamically direct
their own processes and tool usage
Copyright © 2025, Oracle and/or its affiliates
Spring AI - Agentic
Systems
Source: Spring AI
Confidential - Oracle Restricted
• Rationale
• While fully autonomous agents might seem appealing, workflows often provide
better predictability and consistency for well-defined tasks. This aligns perfectly
with enterprise requirements where reliability and maintainability are crucial.
• Fundamental Patterns
• Let's examine how we can implement such concepts through fundamental
design patterns, each serving specific use-case scenarios.
Copyright © 2025, Oracle and/or its affiliates
Spring AI - Agentic
Systems
Source: Spring AI
Confidential - Oracle Restricted
Chain Workflow
Copyright © 2025, Oracle and/or its affiliates
Source: Building Effective Agents with Spring AI
Confidential - Oracle Restricted
Parallelization Workflow
Copyright © 2025, Oracle and/or its affiliates
Source: Building Effective Agents with Spring AI
Confidential - Oracle Restricted
Routing Workflow
Copyright © 2025, Oracle and/or its affiliates
Source: Building Effective Agents with Spring AI
Confidential - Oracle Restricted
Orchestrator-Workers
Copyright © 2025, Oracle and/or its affiliates
Source: Building Effective Agents with Spring AI
Confidential - Oracle Restricted
Evaluator-Optimizer
Copyright © 2025, Oracle and/or its affiliates
Source: Building Effective Agents with Spring AI
Confidential - Oracle Restricted
Agentic Patterns – Best Practices
• Start Simple:
• Begin with basic workflows before adding complexity
• Use the simplest pattern that meets your requirements
• Add sophistication only when needed
• Design for Reliability:
• Implement clear error handling
• Use type-safe responses where possible
• Build in validation at each step
Copyright © 2025, Oracle and/or its affiliates
Consider Trade-offs:
• Balance latency vs. accuracy
• Evaluate when to use parallel processing
• Choose between fixed workflows and dynamic
agents
Confidential - Oracle Restricted
Reference
Architecture
for GenAI
Copyright © 2025, Oracle and/or its affiliates
Source: Architectural Approach for Building Generative AI Applications
Copyright © 2025, Oracle and/or its affiliates
Technical References
• Spring AI - https://spring.io/projects/spring-ai
• Spring AI - API - https://docs.spring.io/spring-ai/reference/api/index.html
• Getting started with Oracle’s contribution to Spring AI - https://rb.gy/estsp3
• Retrieval-Augmented Generation (RAG) with Spring AI, Oracle Database 23ai, and OpenAI
- https://rb.gy/e1mwt4
• Oracle Database 23ai https://rb.gy/pdmwmz
• Oracle AI Vector Search for Java Developers with the Oracle Database 23ai -
https://rb.gy/7ivwxr
• Oracle AI Vector Search User's Guide -
https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/preface.html
Copyright © 2025, Oracle and/or its affiliates
Technical References
• Hibernate Vector Module - https://rb.gy/6h882g
• Getting started with Oracle’s contribution to LangChain4J - https://rb.gy/h21e1z
• LangChain4J - Retrieval-Augmented Generation (RAG) with LangChain4J and the
• Oracle Database 23ai https://rb.gy/pdmwmz
• Oracle AI Vector Search for Java Developers with the Oracle Database 23ai -
https://rb.gy/7ivwxr
• Oracle AI Vector Search User's Guide -
https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/preface.html
Confidential - Oracle Restricted
Oracle LiveLabs
Showcasing how Oracle’s solutions can solve
your business problems
500+
free workshops,
available or in
development
3.5 million
people have already visited LiveLabs
developer.oracle.com/livelabs
learn something new …at your pace!
600+
events run using
LiveLabs
workshops
3 membership tiers
Connect: @oracleace facebook.com/OracleACEs
aceprogram_ww@oracle.com
500+ technical experts &
community leaders helping peers globally
The Oracle ACE Program recognizes & rewards individuals for
their technical & community contributions to the Oracle community
Nominate
yourself or a candidate:
ace.oracle.com/nominate
Learn more - ace.oracle.com
blogs.oracle.com/ace
Confidential - Oracle Restricted
Create your FREE
Cloud Account
• Go to
https://signup.cloud.oracle.com/
Copyright © 2025, Oracle and/or its affiliates
Juarez Junior
@juarezjunior
Carlos
Henrique
Oracle Database for Java Developers
Confidential - Oracle Restricted
Java App
Dev with
Oracle
Database
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Overview of Oracle DB Access with Java
Copyright © 2025, Oracle and/or its affiliates
Confidential - Oracle Restricted
Oracle JDBC - Support for the Latest Java
Versions
• Support for the latest Java and GraalVM
• Project Loom - Virtual Threads support
• Java Virtual Threads and Pipelined
Database Operations
• JDBC Standards - 4.2 and 4.3
• Reactive Streams - Java Flow API support
• R2DBC, Reactive Streams Ingestion (RSI)
• Pipelined Database Operations
Data access is critical in mission-
critical applications!
Copyright © 2025, Oracle and/or its affiliates
Copyright © 2025, Oracle and/or its affiliates
Technical References
• Java / JDBC – https://www.oracle.com/jdbc
• Introduction to Oracle JDBC Driver Support for Virtual Threads - https://bit.ly/3UlNJWP
• Developing an Oracle JDBC app with GraalVM Native Image - https://rb.gy/iy3sgh
• Getting Started with Reactive Relational Database Connectivity and the Oracle R2DBC
Driver - https://rb.gy/42dnz5
• Getting Started with the Java library for Reactive Streams Ingestion (RSI) -
https://bit.ly/3rEiRnC
• Introduction to JDBC Reactive Extensions with the Oracle Database — Developer Release
– https://rb.gy/qxlrbx
• Pipelined Database Operations - https://rb.gy/iy3sgh

Powering Spring AI with Model Context Protocol Integration

  • 1.
    Powering Spring AIwith Model Context Protocol Integration SOUJAVA - Java 30Y #CelebrationWeek Juarez Barbosa Junior @juarezjunior Senior Principal Java Developer Evangelist ORACLE Copyright © 2025, Oracle and/or its affiliates
  • 2.
    Juarez Barbosa Junior SeniorPrincipal Java Developer Evangelist @ Oracle • Speaking from Dublin, Ireland • 30 years of experience in SW Engineering & DevRel • Oracle, Microsoft, IBM, Nokia, Unisys, Accenture, startups • Microsoft Azure Developer Relations Lead • IBM Watson Tech Evangelist & Cloud Rockstar • IBM Mobile Tech Evangelist & Global Thought Leader • Nokia Developers Global Champion • Java, Python, Cloud, DevOps, SRE, Cloud-native, IoT, AI, Blockchain, Rust • Speaker at conferences • Oracle CloudWorld, Oracle Code, Microsoft Ignite & TechX, jPrime, JCON, DevConf.cz, GeeCon, DevOpsDays, DeveloperWeek, DevOps Institute, CloudLand, DWX, The Developer’s Conference (TDC), Sec4Dev, JSNation, NodeConf, Conf42, Shift Conf, Global Azure, Open-Source Lisbon, CodeFrenzy, Mêlée Numérique, React Summit, Test.js Summit, Porto TechHub Conf, I Love Tech, Pyjamas, MiTechCon, Data Science Summit, OpenSourceNorth, WeAreDevelopers, Global Software Architecture Summit, Java Day Istanbul, JUGs, OUGs, GDGs, meetups, hackathons, and customer engagements. @juarezjunior @juarezjunior
  • 3.
    Confidential - OracleRestricted Agenda • Spring AI - overview • Spring AI - basics (chat, image, multimodal) • Oracle AI Vector Search • Spring AI + Oracle AI Vector Search + RAG • Spring AI - Tool calling • Agentic Protocols - MCP, A2A, ACP • MCP - Model Context Protocol • Spring AI - MCP • Spring AI - Agentic Patterns • Technical References • Reference Architecture for GenAI • Oracle Developer Relations Copyright © 2025, Oracle and/or its affiliates
  • 4.
    Confidential - OracleRestricted AI and GenAI – Synthetic Content Brasilia in Brazil pictured in a futuristic cityscape Copyright © 2025, Oracle and/or its affiliates
  • 5.
    Confidential - OracleRestricted Artificial Intelligence / GenAI • Core concepts in a nutshell • GenAI - Artificial intelligence algorithms and transformer models with the capability of generating content. • Content - Text, images, videos, code, and others. • Generation – a result of an input prompt (prompt engineering). • Ethical issues – misuse, deep fakes, bias and discrimination, automation and job replacements, cybersecurity and cybercriminals. Copyright © 2025, Oracle and/or its affiliates
  • 6.
    Confidential - OracleRestricted Artificial Intelligence / AGI / ASI • Core concepts in a nutshell • Apps – Applied in the fields of content development, entertainment, drug discovery, software development, healthcare, material generation sciences, and others. • AI is now a commodity! • Artificial General Intelligence (AGI) – ultimate goal • Artificial Super Intelligence (ASI) Copyright © 2025, Oracle and/or its affiliates
  • 7.
    Spring AI -Connecting your enterprise data and APIs with AI models
  • 8.
    Confidential - OracleRestricted Spring AI (1.0.0) • Spring AI (AI Concepts) • A Java app framework for building AI-related applications. It provides a robust abstraction layer that encapsulates many of the complexities required to interact with various GenAI providers, such as OpenAI, Cohere, Google Vertex AI/Gemini, and others. • API support across AI providers for chat, text-to-image, embedding models, agents, etc. • Its goal is to apply to the AI domain Spring ecosystem design principles, such as portability and modular design, and promote using POJOs as the building blocks of an application to the AI domain. • https://spring.io/projects/spring-ai Copyright © 2025, Oracle and/or its affiliates
  • 9.
    Confidential - OracleRestricted Spring AI • Spring AI – Blazingly Fast Performance • GraalVM • Native Image - compile Java code ahead of time (AOT) to a binary – a native executable • Developing an Oracle JDBC app with GraalVM Native Image • mvn -Pnative native:compile • ./target/spring-ai-graalvm-oai.exe Copyright © 2025, Oracle and/or its affiliates
  • 10.
    Confidential - OracleRestricted Spring AI • Spring AI – Blazingly Fast Performance • Spring with Virtual Threads • Add the following entry in the application.properties file: spring.threads.virtual.enabled=true • Class VirtualThreadTaskExecutor • Embracing Virtual Threads • All together now: Spring Boot 3.2, GraalVM native images, Java 21, and virtual threads with Project Loom Copyright © 2025, Oracle and/or its affiliates
  • 11.
    Confidential - OracleRestricted Spring AI • The Spring AI API covers a wide range of functionalities • Chat Completion API • Embeddings API • Image Generation API • Speech / Transcription API • Vector Databases • Function Calling / Tools API • MCP – Model Context Protocol Copyright © 2025, Oracle and/or its affiliates
  • 12.
    Spring AI –Basic Scenarios
  • 13.
    Confidential - OracleRestricted Chat Completion - Spring AI with Open AI • Demo – Chat - Direct LLM calls Copyright © 2025, Oracle and/or its affiliates
  • 14.
    Confidential - OracleRestricted Image Generation - Spring AI with Open AI • Demo – Image Generation Copyright © 2025, Oracle and/or its affiliates
  • 15.
    Confidential - OracleRestricted Multimodality - Spring AI with Open AI • Demo - Multimodality Copyright © 2025, Oracle and/or its affiliates
  • 16.
  • 17.
    Confidential - OracleRestricted Oracle Database 23ai Next-Generation Converged Database Services Over 300 major new features plus thousands of enhancements Available on OCI and Azure Major focus on • AI for Data features • Developer/Analyst features • Mission-Critical features Addresses data management pain points that have frustrated customers forever Copyright © 2025, Oracle and/or its affiliates
  • 18.
    Confidential - OracleRestricted Oracle Database 23ai - AI for Data Algorithmic AI AI Vector Search Augmented Generative AI (LLMs) Distributed AI AI Storage AI Developer Tools Copyright © 2025, Oracle and/or its affiliates
  • 19.
    Oracle Database 23aiVector Search
  • 20.
    Converged Database Add vectorsearch to your business database NEW Vector data type for storing vector embeddings NEW SQL syntax and functions express similarity search with ease NEW Approximate search indexes packaged and tuned for high performance and quality There is no need to move and synchronize data, manage multiple products, etc. Better Together: Business Data and Business Vectors Copyright © 2025, Oracle and/or its affiliates 20
  • 21.
    21 Copyright ©2025, Oracle and/or its affiliates How Oracle AI Vector Search Works
  • 22.
    Databases have traditionally performed value- basedsearches Orders Customer records Products Find revenue by products 22 Copyright © 2025, Oracle and/or its affiliates
  • 23.
    Growing volume of unstructured businessdata that must be searched by semantics Find products that match a photo or description Orders Customer records Products Medical forms Invoices Social data images Videos Phone call scripts The “all data” opportunity JSON 23 Copyright © 2025, Oracle and/or its affiliates
  • 24.
    AI Vector SearchA new breakthrough technology to help find documents, images, and other unstructured data Based on their semantic content, rather than their words or pixels 24 Copyright © 2025, Oracle and/or its affiliates
  • 25.
    Vector 33 42 16 21 50 An AI Vectoris a sequence of numbers, called dimensions, used to capture the important “features” of the data Represent the semantic content of data, not the actual words in a document or pixels in an image Produced by AI Deep Learning Models known as Embedding Models 25 Copyright © 2025, Oracle and/or its affiliates
  • 26.
    The main operationon vectors is the Mathematical Distance between them 8 2 1 3 3 2 6 2 Distance (Euclidean Squared) = ((3-2)2+(1-6)2+(2-2)2+(8-3)2) There are many mathematical distance formulas 26 Copyright © 2025, Oracle and/or its affiliates
  • 27.
    Laptop Gen 32 SupportRep: Jane Doe Email: jane@doe.com • Severity 1 • Spontaneous reboot • Resolved • Applied OS Update 42 Support Incident An Example Business Scenario: The vector for a support incident could be ... Vector 33 42 16 21 50 27 Copyright © 2025, Oracle and/or its affiliates
  • 28.
    Laptop Gen 32 SupportRep: Jane Doe Email: jane@doe.com • Severity 1 • Spontaneous reboot • Resolved • Applied OS Update 42 Support Incident An Example Business Scenario: The vector for a support incident could be ... Each dimension (number), represents a different feature of the support incident Vector Features Severity Current OS version Symptoms Product Status 33 42 16 21 50 Note: Features are often chosen by ML algorithms and are not as simple as shown here 28 Copyright © 2025, Oracle and/or its affiliates
  • 29.
    Copyright © 2025,Oracle and/or its affiliates 29 Collapsing vectors into 2 dimensions instead of hundreds could look like this d2 d1 Support Incidents for Laptops running slowly Support Incident for Desktop crashing
  • 30.
    Copyright © 2025,Oracle and/or its affiliates 30 d2 d1 Not as Similar Similar Similarity Property: Images that are more similar produce vectors that are closer together
  • 31.
    Copyright © 2025,Oracle and/or its affiliates 31 d2 d1 Similarity Property: Images that are more similar produce vectors that are closer together Documents and images also work the same way Document vectors that represent similar content are closer than those representing dissimilar content blackberry strawberry apple raspberry pear plum cat kitten dog puppy wolf lion Texas California New York kiwi elephant Animals Fruit States tiger
  • 32.
    32 Copyright ©2025, Oracle and/or its affiliates Now that we know what vectors are, let’s talk about how they are used Vector Search works best when combined with relational search to solve business problems 33 42 16 21 50
  • 33.
    Copyright © 2025,Oracle and/or its affiliates Use cases What do embeddings and vector databases enable? Similarity Search Match candidates with jobs Image and video retrieval Find patients with similar issues Legal e-discovery Content-Based Filtering Personalized recommendation Find retail items from image Natural Language Processing Text Classification and Clustering SQL generation Data Analytics Anomaly detection Pattern recognition Computer Vision Face recognition Biometric identification Object detection Biomedical Research Gene/DNA similarity analysis Molecular structure search Geographic Information Systems Spatial analysis Map rendering Industrial Applications Quality control Predictive maintenance Machinery malfunction
  • 34.
    What is VectorGeneration or Embedding? • The process of converting unstructured data (text, images, etc.) into vectors • Vectors are generated using deep-learning embedding models • Vector embedding models can be obtained commercially, from Open Source, or can be created • There may be no BEST embedding model, and different data may need different models • No one size fits all • Evaluate a model based on your data 34 Copyright © 2025, Oracle and/or its affiliates Embedding Model Unstructured Data Deep-learning ML models Vectors
  • 35.
    Perform AI VectorSearch on VECTOR columns using SQL AI Vector Search Highlights GENERATE STORE SEARCH INDEX INTEGRATE 35 Generate vector embeddings from unstructured data Store vectors in table columns using new VECTOR type Build approximate vector indexes on VECTOR columns Integrate with Mission-Critical Enterprise Capabilities Copyright © 2025, Oracle and/or its affiliates
  • 36.
    AI Vector Searchpowers Complete Gen AI pipeline Data Sources Document Loaders Document Transformation (e.g., Text Splitting, Summarization) Embedding Models Vector Database Similarity Search LLMs User AI Vector Search in Oracle 23ai Database RAG 1. Native Database APIs for Gen-AI, from Document Processing to REST call-outs to LLM Providers 2. Tight integration with 3rd party frameworks such as Langchain 36 Copyright © 2024, Oracle and/or its affiliates
  • 37.
    Spring AI -Vector Search + RAG
  • 38.
    Confidential - OracleRestricted Retrieval-Augment Generation (RAG) • RAG (Retrieval-Augment Generation) with Oracle Cloud / Oracle Database 23ai • LLMs' baseline knowledge might have gaps based on their training data. If you ask an LLM to write about a recent trend or event, the LLM won't know what you're talking about, so you may get meaningless responses. • There's a way to provide LLMs with additional information (including business- specific data)- that is what RAG is for! • Oracle - What Is Retrieval-Augmented Generation (RAG)? • Oracle – What Is Generative AI? How Does It Work? Copyright © 2025, Oracle and/or its affiliates
  • 39.
    Confidential - OracleRestricted • RAG (Retrieval-Augment Generation) with Spring AI • In a nutshell, RAG is a technique that: • Reads unstructured data; • Converts the data into tokens; • It uses embeddings to transform the tokens into floating-point arrays or vectors so that LLM can process and interpret them; • It stores vectors in Vector Databases. Copyright © 2025, Oracle and/or its affiliates Retrieval-Augment Generation (RAG)
  • 40.
    Confidential - OracleRestricted RAG – Retrieval-Augment Generation Spring AI with Open AI and Oracle Database 23ai • Demo - RAG – Retrieval-Augmented Generation with Spring AI + OracleVectorStore + Oracle Database 23ai Copyright © 2025, Oracle and/or its affiliates
  • 41.
    Confidential - OracleRestricted Tool Calling - Spring AI Copyright © 2025, Oracle and/or its affiliates Source: Spring AI
  • 42.
    Confidential - OracleRestricted Tool Calling - Spring AI with Open AI • Demo - Tool Calling Copyright © 2025, Oracle and/or its affiliates
  • 43.
    Agentic Protocols –MCP, A2A, ACP
  • 44.
    Confidential - OracleRestricted Agentic Protocols – MCP, A2A, ACP Copyright © 2025, Oracle and/or its affiliates Introducing the Model Context Protocol (November 2024) • MCP – Model Context Protocol (Anthropic) • Standardizes context and tool integration between LLM hosts/clients and data/tool servers • Uses JSON-RPC 2.0 over standard transports (stdio and HTTP with SSE) • Offers capability discovery and negotiation between client/browser and servers • Multi-language SDK support (Python, TypeScript, Go, Java, C#, Rust) • Focus: enabling LLMs to connect to external tools and data sources (“USB-C for AI”)
  • 45.
    Confidential - OracleRestricted Agentic Protocols – MCP, A2A, ACP Copyright © 2025, Oracle and/or its affiliates Announcing the Agent2Agent Protocol - A2A (April 2025) • A2A – Agent2Agent Protocol (Google) • Enables secure agent-to-agent communication and coordination in multi-agent workflows • Built on existing standards: HTTP, SSE, JSON-RPC, and security mechanisms. • Uses “Agent Cards” (JSON contracts) for agent capability and trust discovery • Facilitates cross-organizational and platform interoperability (Google, Oracle, Microsoft, others) • Focus: universal interoperability of autonomous agents across diverse environments
  • 46.
    Confidential - OracleRestricted Agentic Protocols – MCP, A2A, ACP Copyright © 2025, Oracle and/or its affiliates The simplest protocol for AI agents to work together (May 2025) • ACP – Agent Communication Protocol (IBM) • Defines a REST-based agent communication standard with well-defined HTTP endpoints • Supports multimodal message payloads using arbitrary MIME types (text, image, audio, custom binary) • Offers both synchronous and asynchronous (including streaming) modes • No mandatory SDK: official SDKs available in Python and TypeScript • Focus: broad agent-to-agent communication interoperability, agnostic of internal architecture
  • 47.
    Confidential - OracleRestricted Agentic Protocols – MCP, A2A, ACP Copyright © 2025, Oracle and/or its affiliates Introducing the Model Context Protocol (Nov. 2024)
  • 48.
    MCP - ModelContext Protocol
  • 49.
    Confidential - OracleRestricted MCP – Architecture Copyright © 2025, Oracle and/or its affiliates Source: Model Context Protocol - Introduction • Client-server architecture – main components • MCP Hosts: Programs like Claude Desktop, IDEs, or AI tools that want to access data through MCP • MCP Clients: Protocol clients that maintain 1:1 connections with servers • MCP Servers: Lightweight programs that each expose specific capabilities through the standardized Model Context Protocol (1…*). Servers can also include additional logic, caching, data transformations, others • Local Data Sources: Your computer’s files, databases, and services that MCP servers can securely access • Remote Services: External systems available over the internet (e.g., through APIs) that MCP servers can connect to • MCP Inspector: debugging and analysis tool for inspecting, visualizing, and validating context passed through the Model Context Protocol in LLM applications
  • 50.
    Confidential - OracleRestricted MCP – Internals Copyright © 2025, Oracle and/or its affiliates Source: Demystifying (MCP)
  • 51.
  • 52.
    Confidential - OracleRestricted Spring AI + MCP Java SDK - Overview Copyright © 2025, Oracle and/or its affiliates Source: Spring AI MCP / MCP Java SDK
  • 53.
    Confidential - OracleRestricted Spring AI – MCP Examples • Demo – Model Context Protocol (examples) Copyright © 2025, Oracle and/or its affiliates
  • 54.
    Confidential - OracleRestricted Spring AI + MCP – Dynamic Tool Update Copyright © 2025, Oracle and/or its affiliates Source: Dynamic Tool Updates in Spring AI's Model Context Protocol • Dynamic Tool Updates in Spring AI's Model Context Protocol • Zero Downtime Tooling • Real-Time Discovery & Adaptability • Future-Proof & Pluggable Architecture • Unified, Structured Tool Interface • Enhanced Agent-Style Orchestration
  • 55.
  • 56.
    Input Prompt Tools Agent Tool callingTools results Complement from tool results User Interface AI Agents Agents Pipeline AI Final answer Comprises Java tools/function calling, MCP, API calls, etc... Copyright © 2025, Oracle and/or its affiliates
  • 57.
    Confidential - OracleRestricted • Workflows • Systems where LLMs and tools are orchestrated through predefined code paths (prescriptive system) • Agents • Systems where LLMs dynamically direct their own processes and tool usage Copyright © 2025, Oracle and/or its affiliates Spring AI - Agentic Systems Source: Spring AI
  • 58.
    Confidential - OracleRestricted • Rationale • While fully autonomous agents might seem appealing, workflows often provide better predictability and consistency for well-defined tasks. This aligns perfectly with enterprise requirements where reliability and maintainability are crucial. • Fundamental Patterns • Let's examine how we can implement such concepts through fundamental design patterns, each serving specific use-case scenarios. Copyright © 2025, Oracle and/or its affiliates Spring AI - Agentic Systems Source: Spring AI
  • 59.
    Confidential - OracleRestricted Chain Workflow Copyright © 2025, Oracle and/or its affiliates Source: Building Effective Agents with Spring AI
  • 60.
    Confidential - OracleRestricted Parallelization Workflow Copyright © 2025, Oracle and/or its affiliates Source: Building Effective Agents with Spring AI
  • 61.
    Confidential - OracleRestricted Routing Workflow Copyright © 2025, Oracle and/or its affiliates Source: Building Effective Agents with Spring AI
  • 62.
    Confidential - OracleRestricted Orchestrator-Workers Copyright © 2025, Oracle and/or its affiliates Source: Building Effective Agents with Spring AI
  • 63.
    Confidential - OracleRestricted Evaluator-Optimizer Copyright © 2025, Oracle and/or its affiliates Source: Building Effective Agents with Spring AI
  • 64.
    Confidential - OracleRestricted Agentic Patterns – Best Practices • Start Simple: • Begin with basic workflows before adding complexity • Use the simplest pattern that meets your requirements • Add sophistication only when needed • Design for Reliability: • Implement clear error handling • Use type-safe responses where possible • Build in validation at each step Copyright © 2025, Oracle and/or its affiliates Consider Trade-offs: • Balance latency vs. accuracy • Evaluate when to use parallel processing • Choose between fixed workflows and dynamic agents
  • 65.
    Confidential - OracleRestricted Reference Architecture for GenAI Copyright © 2025, Oracle and/or its affiliates Source: Architectural Approach for Building Generative AI Applications
  • 66.
    Copyright © 2025,Oracle and/or its affiliates Technical References • Spring AI - https://spring.io/projects/spring-ai • Spring AI - API - https://docs.spring.io/spring-ai/reference/api/index.html • Getting started with Oracle’s contribution to Spring AI - https://rb.gy/estsp3 • Retrieval-Augmented Generation (RAG) with Spring AI, Oracle Database 23ai, and OpenAI - https://rb.gy/e1mwt4 • Oracle Database 23ai https://rb.gy/pdmwmz • Oracle AI Vector Search for Java Developers with the Oracle Database 23ai - https://rb.gy/7ivwxr • Oracle AI Vector Search User's Guide - https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/preface.html
  • 67.
    Copyright © 2025,Oracle and/or its affiliates Technical References • Hibernate Vector Module - https://rb.gy/6h882g • Getting started with Oracle’s contribution to LangChain4J - https://rb.gy/h21e1z • LangChain4J - Retrieval-Augmented Generation (RAG) with LangChain4J and the • Oracle Database 23ai https://rb.gy/pdmwmz • Oracle AI Vector Search for Java Developers with the Oracle Database 23ai - https://rb.gy/7ivwxr • Oracle AI Vector Search User's Guide - https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/preface.html
  • 68.
    Confidential - OracleRestricted Oracle LiveLabs Showcasing how Oracle’s solutions can solve your business problems 500+ free workshops, available or in development 3.5 million people have already visited LiveLabs developer.oracle.com/livelabs learn something new …at your pace! 600+ events run using LiveLabs workshops
  • 69.
    3 membership tiers Connect:@oracleace facebook.com/OracleACEs aceprogram_ww@oracle.com 500+ technical experts & community leaders helping peers globally The Oracle ACE Program recognizes & rewards individuals for their technical & community contributions to the Oracle community Nominate yourself or a candidate: ace.oracle.com/nominate Learn more - ace.oracle.com blogs.oracle.com/ace
  • 70.
    Confidential - OracleRestricted Create your FREE Cloud Account • Go to https://signup.cloud.oracle.com/ Copyright © 2025, Oracle and/or its affiliates
  • 72.
  • 74.
  • 75.
    Oracle Database forJava Developers
  • 76.
    Confidential - OracleRestricted Java App Dev with Oracle Database Copyright © 2025, Oracle and/or its affiliates
  • 77.
    Confidential - OracleRestricted Overview of Oracle DB Access with Java Copyright © 2025, Oracle and/or its affiliates
  • 78.
    Confidential - OracleRestricted Oracle JDBC - Support for the Latest Java Versions • Support for the latest Java and GraalVM • Project Loom - Virtual Threads support • Java Virtual Threads and Pipelined Database Operations • JDBC Standards - 4.2 and 4.3 • Reactive Streams - Java Flow API support • R2DBC, Reactive Streams Ingestion (RSI) • Pipelined Database Operations Data access is critical in mission- critical applications! Copyright © 2025, Oracle and/or its affiliates
  • 79.
    Copyright © 2025,Oracle and/or its affiliates Technical References • Java / JDBC – https://www.oracle.com/jdbc • Introduction to Oracle JDBC Driver Support for Virtual Threads - https://bit.ly/3UlNJWP • Developing an Oracle JDBC app with GraalVM Native Image - https://rb.gy/iy3sgh • Getting Started with Reactive Relational Database Connectivity and the Oracle R2DBC Driver - https://rb.gy/42dnz5 • Getting Started with the Java library for Reactive Streams Ingestion (RSI) - https://bit.ly/3rEiRnC • Introduction to JDBC Reactive Extensions with the Oracle Database — Developer Release – https://rb.gy/qxlrbx • Pipelined Database Operations - https://rb.gy/iy3sgh