Professional Documents
Culture Documents
Improve The Factuality of Your Generative AI Apps by Grounding Responses in Your Data
Improve The Factuality of Your Generative AI Apps by Grounding Responses in Your Data
of your generative AI
apps by grounding
responses in your data
Proprietary
Lewis Tom
Liu Beyer
Group Product Manager, Group Product Manager,
Google Cloud Google Cloud
Proprietary 04
Factuality &
Grounding
- Niche knowledge
Natively Sophisticated Advanced
multimodal reasoning Coding
The
1M long context Highly
window efficient
era
is here Now, grounding
with Google
Search
developing new
experience and
interaction with Google
Search grounding
Suggested Searches
Proprietary 015
Quora Poe Tap inline source links to
open the source webpage
Platform to developers
to build and share
chatbot. It has millions
of custom bots in one
place, with native apps
for every device.
Core
Grounded Generation & Check Grounding API components
On top of: Document AI, Embeddings API, Ranking API and Vector Search
Orchestration
Vertex AI Vertex AI
DIY Reasoning engine RAG API
rag_retrieval_tool = Tool.from_retrieval(
1. DIY - Built to be fully customizable
retrieval=rag.Retrieval(
Use default settings to start with, or configure your own source=rag.VertexRagStore(
for every step, from chuck size, chuck overlap, choice of rag_corpora="my-corpus",
embedding models, vector database, and many more.
similarity_top_k=3),
)
2. Enterprises-grade RAG at scale )
# Generate response with RAG
Enterprise-ready features to support large number of
response =
documents, and wide range of connectors of data
GenerativeModel("gemini-pro",tools=[rag_retrieval_tool])
sources
.generate_content("What is RAG and why it is helpful?")
Instructions + Query
Sources
Grounded answer
Custom facts with citations with
grounding score
Configuration
contents { content {
role: "user" role: "model"
parts { parts {
text: "What is the current status of the global economy?" text: "The global economy showed resilience in 2023, but growth is
}
easing due to restrictive monetary policies. Global growth is expected to
}
slow from 5.9% in 2021 to 4.4% in 2022 and further to 2.9% in 2024,
grounding_sources {
according to the International Monetary Fund (IMF)."
grounding_content {
grounding_content_text { }
text: "Fact text #1 goes here" }
attributes { grounding_score: 0.8
key: "url" candidate_citation {
value: "Insert URL here" cited_chunks {
} chunk_text: "Relevant text chunk in the document."
} source: "1"
} source_metadata {
[...]
key: "uri"
}
value: "URI of the document"
grounding_sources {
key: "title"
vertex_ai_search {
search_params { value: "title of the document"
serving_config: "projects/.../..." key: "page_identifier"
} value: "page number of the document"
} }
} }
Retrieve &
Rank
Facts Answer Gen Answer
? – Grounding of the response
– Attribution to sources
RAG
Retrieved facts:
● [1] Inception is a 2010 science fiction action film
written and directed by Christopher Nolan, who
also produced the film with Emma Thomas, his
wife. […]
● [2] Inception stars Leonardo DiCaprio, Ken
Watanabe, Marion Cotillard, Joseph Gordon-Levitt,
Elliot Page, Tom Hardy, Cillian Murphy, Tom
Berenger, Dileep Rao, and Michael Caine among
others. […]
● [3] Inception's premiere was held in London on July
8, 2010; it was released in both conventional and
IMAX theaters beginning on July 16, 2010.
Inception grossed over $837 million worldwide,
becoming the fourth-highest-grossing film of
2010. […]
● [4] The movie Inception is about a professional
thief who steals information by infiltrating the
subconscious of his targets.
Google Cloud Next ‘24 Proprietary
For the Builder: Check Grounding example
Confidence
Check
Facts & scores &
Answer gen Answer Grounding
Instructions Attribution to
New!
sources
LLM prompt for the user question:
Tell me about the movie Inception.
Proprietary 035