Jeff Maruschek: How does RAG REALLY work?

awschicago 546 views 25 slides Jun 26, 2024
Slide 1
Slide 1 of 25
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25

About This Presentation

AWS Community Day Midwest 2024
Jeff Maruschek
How does RAG REALLY work?


Slide Content

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Jeff Maruschek
Amazon Web Services
Solutions Architect –DoD –Air Force
Retrieval-Augmented Generation (RAG)
Overview and Interactive Demos

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2
Introduction

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
Introduction

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4
djmooseon Mixcloud:

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is RAG?
What are Embeddings?
Amazon Bedrock ChatBotDemo
Amazon Bedrock Knowledge Bases Demo
Agenda
5

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6
What book genre is The Three-Body Problem?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
What instrument does Joshua Bell play?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
What instrument does the musician Joshua Bell
play?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
Who is Joshua Bell?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
•Retrieval
▪Fetches the relevant content from the
external knowledge base or data sources
based on a user query
•Augmentation
▪Adding the retrieved relevant context to
the user prompt, which goes as an input to
the foundation model
•Generation
▪Response from the foundation model
based on the augmented prompt.
12
What is RAG?

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 13

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are embeddings?
EMBEDDING
MODEL
0.027-0.011 -0.023…
0.025-0.009 -0.025…
New York
Paris
Vector EmbeddingsHuman Text
•Numerical representation of
text (vectors) that captures
semantics and relationships
between words.
•Embedding models capture
features and nuances of the
text.
•Rich embeddings can be used
to compare text similarity.
•Multilingual Text Embeddings
can identify meaning in
different languages.
-0.0110.021 0.013…Animal
-0.0090.019 0.015…Horse

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20
Amazon Bedrock ChatBotDemo
https://github.com/aws-samples/bedrock-claude-chat

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21
Documents Used

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
Architecture

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
However, when it comes to implementing
RAG, there are challenges…
Creating vector
embeddings for large
volumes of data
Orchestration
Managing
multiple data
sources
Scaling retrieval
mechanism
Coding effort
Incremental
updates to vector
store

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
Amazon Bedrock Knowledge Bases Demo
https://aws.amazon.com/bedrock/knowledge-bases/

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 25
Documents Used

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
Jeff Maruschek
Solutions Architect –DoD –Air Force
[email protected]
26