Skip to content

Latest commit

Β 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Enterprise-Knowledge-Assistant-using-Amazon-Bedrock-RAG-Architecture-

Enterprise Knowledge Assistant is built with Amazon Bedrock, OpenSearch Serverless, and S3 using Retrieval Augmented Generation (RAG) architecture. πŸ“Œ Project Overview

This project demonstrates how to build an Enterprise Knowledge Assistant using Retrieval Augmented Generation (RAG) architecture with Amazon Bedrock, Amazon S3, and Amazon OpenSearch Serverless.

The system enables users to query enterprise documents using natural language, retrieving relevant information from internal documents and generating intelligent responses using foundation models.

Instead of relying only on pre-trained model knowledge, the assistant retrieves real enterprise data and uses it as context for generating accurate responses.

🧠 Key Features

βœ” Build a Generative AI knowledge assistant βœ” Implement Retrieval Augmented Generation (RAG) βœ” Store enterprise documents in Amazon S3 βœ” Convert documents into vector embeddings βœ” Store embeddings in OpenSearch Serverless βœ” Perform a semantic search for relevant information βœ” Generate responses using Amazon Bedrock foundation models

πŸ— Architecture

Architecture Flow

1️⃣ Upload enterprise documents to Amazon S3

2️⃣ Configure Amazon Bedrock Knowledge Base

3️⃣ Documents are split into text chunks

4️⃣ Chunks are converted into vector embeddings

5️⃣ Embeddings are stored in Amazon OpenSearch Serverless

6️⃣ User submits a natural language query

7️⃣ Relevant document chunks are retrieved using vector similarity search

8️⃣ Amazon Bedrock foundation model generates the final response

🧰 AWS Services Used ☁️ Amazon S3

Object storage used to store enterprise documents.

Features:

Highly scalable storage

Stores files as objects in buckets

Maximum object size: 5 TB

πŸ€– Amazon Bedrock

Fully managed service that provides access to foundation models (FMs).

Used in this project for:

Creating the Knowledge Base

Generating embeddings

Producing AI responses from queries

Models used:

Amazon Titan Embeddings

Amazon Nova Lite

πŸ”Ž Amazon OpenSearch Serverless

OpenSearch Serverless acts as the vector database.

Responsibilities:

Store vector embeddings

Perform similarity search

Retrieve relevant document chunks

Supported vector similarity metrics:

Cosine similarity

Euclidean distance

Dot product

πŸ“š Core AI Concepts Implemented Vector Embeddings

Embeddings convert text into numerical vectors that represent semantic meaning.

Example:

"Increase quarterly revenue"

β†’ vector representation

This allows the system to perform semantic similarity search instead of keyword search.

Retrieval Augmented Generation (RAG)

RAG combines:

Information Retrieval + Large Language Models

Workflow:

User query β†’ converted into vector

Vector database retrieves relevant document chunks

Retrieved content is passed to the LLM

LLM generates a contextual answer

Benefits:

More accurate responses

Reduced hallucination

Ability to use proprietary enterprise data

πŸ“‚ Project Structure

aws-bedrock-enterprise-knowledge-assistant β”‚ β”œβ”€β”€ README.md β”‚ β”œβ”€β”€ architecture β”‚ └── architecture-diagram.png β”‚ β”œβ”€β”€ documentation β”‚ β”œβ”€β”€ project-overview.md β”‚ β”œβ”€β”€ aws-services-used.md β”‚ └── rag-explained.md β”‚ β”œβ”€β”€ guide β”‚ └── step-by-step-lab-guide.md β”‚ β”œβ”€β”€ metadata β”‚ └── metadata-example.json β”‚ β”œβ”€β”€ lab-files β”‚ β”œβ”€β”€ sales-details.csv β”‚ └── sales-report.pdf β”‚ └── screenshot

βš™ Implementation Steps Step 1 β€” Upload Documents

Upload enterprise documents to Amazon S3 buckets

Example:

sales-data sales-reports

Step 2 β€” Enable Bedrock Models

Enable foundation models in the Amazon Bedrock console

Models used:

Amazon Titan Embeddings

Amazon Nova Lite

Step 3 β€” Create Knowledge Base

Create a Bedrock Knowledge Base named:

Sales KB

Step 4 β€” Configure Vector Store

Configure Amazon OpenSearch Serverless as the vector store.

Collection type:

Vector Search

Step 5 β€” Add Data Sources

Add two data sources to the knowledge base:

Data Source Description sales-data Sales CSV data sales-reports Sales report PDF Step 6 β€” Sync Data Sources

During synchronization:

Documents are processed

Text is chunked

Embeddings are generated

Embeddings are stored in OpenSearch

Step 7 β€” Test Knowledge Base

Example query:

How can the sales team improve performance?

The system retrieves relevant document chunks and generates a contextual response.

πŸ§ͺ Validation Criteria

The project validation checks:

βœ” A Bedrock Knowledge Base named Sales KB exists βœ” Two data sources are configured βœ” Both data sources are successfully synced βœ” Documents are ingested into the vector store

πŸ“Έ Screenshots

Screenshots included in /screenshots folder:

S3 bucket setup

Bedrock model enablement

Knowledge base configuration

OpenSearch vector store

Data source sync

Query test results

🎯 Learning Outcomes

This project demonstrates:

βœ” Generative AI application architecture βœ” Vector databases and semantic search βœ” Retrieval Augmented Generation (RAG) βœ” Integration of enterprise data with LLMs βœ” Building AI knowledge assistants using AWS

πŸš€ Future Improvements

Potential enhancements:

Build a chatbot interface

Integrate with Slack / Microsoft Teams

Automate the document ingestion pipeline

Deploy using AWS Lambda + API Gateway

Add real-time knowledge updates

πŸ‘¨β€πŸ’» Author

Cloud & AI Enthusiast

Focused on:

Cloud Computing ☁️

Generative AI πŸ€–

Machine Learning πŸ“Š

AWS Architecture πŸ—

About

Enterprise Knowledge Assistant built with Amazon Bedrock, OpenSearch Serverless, and S3 using Retrieval Augmented Generation (RAG) architecture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors