AWS Builder Center
AWS RAG: SageMaker, Knowledge Bases, and Generative AI

AWS RAG: SageMaker, Knowledge Bases, and Generative AI

Understand how AWS, Amazon SageMaker, RAG, and Knowledge Bases fit together to build generative AI applications that can retrieve relevant enterprise information and provide grounded responses.

System Integrator
Generative AI becomes significantly more useful when it can work with relevant organizational data.
Retrieval-Augmented Generation (RAG) combines information retrieval with generative AI: instead of relying only on the model's existing knowledge, the application retrieves relevant information and provides it as context to the model.

AWS + AI + RAG

A simple way to understand the ecosystem is:
1
2
3
4
5
6
7
8
9
10
11
12
AWS
│
├── Cloud Infrastructure & Services
│
├── Amazon SageMaker
│ └── AI/ML Development & Operations
│
├── RAG
│ └── Retrieval + Generation Architecture
│
└── Knowledge Bases
└── Managed Knowledge Retrieval

What is RAG?

RAG stands for Retrieval-Augmented Generation.
The basic workflow is:
1
2
3
4
5
6
7
8
9
10
11
User Question
↓
Retrieve Relevant Information
↓
Knowledge Base / Vector Search
↓
Relevant Context
↓
Foundation Model
↓
Generated Response
The retrieval step provides additional context to the model before the response is generated.

RAG on AWS

A typical RAG architecture can look like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Enterprise Data
│
├── Documents
├── Databases
└── Other Data Sources
│
↓
Amazon S3
│
↓
Knowledge / Retrieval Layer
│
├── Chunking
├── Embeddings
└── Vector Search
│
↓
Relevant Context
│
↓
Foundation Model
│
↓
AI Response
AWS services can provide the storage, compute, security, data, model, retrieval, and application components required for an end-to-end solution.

Where Amazon SageMaker Fits

Amazon SageMaker provides capabilities for building, training, deploying, evaluating, and managing machine-learning and generative AI solutions.
Common areas include:
  • Model development
  • Training and fine-tuning
  • Model deployment
  • Model evaluation
  • Monitoring
  • Generative AI workflows

Where Knowledge Bases Fit

A knowledge-base approach provides a retrieval layer between enterprise information and the foundation model.
For example:
1
2
3
4
5
6
7
8
9
Company Documentation
↓
Knowledge Base
↓
Retrieve Relevant Content
↓
Foundation Model
↓
Answer with Retrieved Context
This can be useful for:
  • IT support documentation
  • Product documentation
  • Technical manuals
  • Internal policies
  • Troubleshooting guides
  • Enterprise knowledge repositories

Example: IT Support RAG

Imagine an employee asks:
"How do I troubleshoot a VPN connection problem?"
Instead of asking the model to answer without organizational context, a RAG application can:
  1. Receive the question.
  2. Search the organization's knowledge base.
  3. Retrieve relevant VPN documentation.
  4. Provide the retrieved content as context.
  5. Generate a response using that context.
1
2
3
4
5
6
7
8
9
10
11
Question
↓
Knowledge Search
↓
VPN Troubleshooting Documents
↓
Relevant Context
↓
Foundation Model
↓
Step-by-Step Response

The Big Picture

ComponentRole
AWSCloud ecosystem and services
Amazon SageMakerAI/ML development and operations
RAGRetrieval + generation architecture
Knowledge BasesManaged knowledge retrieval capability
Foundation ModelGenerates the final response
Enterprise DataProvides the organization's knowledge

Key Takeaway

AWS provides the cloud foundation.
SageMaker provides AI/ML capabilities.
RAG provides the retrieval-and-generation architecture.
Knowledge Bases provides a managed way to connect knowledge to generative AI applications.
The real value of enterprise generative AI is not only the model. It is the combination of:
Data + Retrieval + Context + Model + Security + Application
Better data → better context → more useful AI applications.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article