DEV Community

1 1

Getting Started with Amazon Q and RAG: Build an AI Assistant Using Just S3 Files!

Are you someone who has always wondered what the buzzword RAG is all about?

If you’ve been following the world of Generative AI, chances are you’ve seen it pop up frequently — especially alongside tools like Amazon Q. But if it still feels like a mystery, you're in the right place.

In this blog, I’ll break down three key ideas:

✅ What is an LLM?

✅ What is Amazon Q and how is it different from ChatGPT?

✅ What exactly is RAG (Retrieval-Augmented Generation)?

And then — we’ll make things fun by building a Cricket Q&A Bot powered by Amazon Q, using just a few PDFs about Virat Kohli and RCB!


Let’s Start With LLMs

You’ve probably used tools like ChatGPT, Grok, or Gemini — marveled at how they can answer almost anything you throw at them.

That’s thanks to something called an LLM — a Large Language Model.

As the name implies "Large" --> These models are trained on massive amounts of public data: books, websites, forums, code, and more.

They use that training to:

  • Understand your questions
  • Predict contextually accurate responses
  • Hold conversations like a human would

So far so good — but here’s the catch...


What If You Want AI to Only Use Your Data?

Let’s say you’re a massive Virat Kohli fan. You’ve collected 5 PDFs — articles, stats, bios — all about him and RCB.

Now imagine you want to create a chatbot that answers questions only from those PDFs. Not the entire internet.

No external opinions. Just facts from those documents.

Can ChatGPT or Grok do that?

❌ Not directly.

But Amazon Q can.

✅ It lets you build an AI assistant that works exclusively on your data — PDFs, CSVs, PPTs, etc. — stored privately and securely in S3.


Enter RAG: Retrieval-Augmented Generation

Here’s where the magic happens.

RAG stands for Retrieval-Augmented Generation — and it’s how tools like Amazon Q answer questions accurately from your documents.

Think of it as a two-step AI process:

  1. Retrieve relevant content from your uploaded documents (like searching inside your PDFs)
  2. Generate a natural, human-like response using that content

Simple Analogy:

RAG is like an open-book exam.

The AI doesn’t memorize everything — it looks up answers in your docs, and then explains them in plain English.

This means:

  • No outdated info from the web
  • You stay in full control of your assistant's brain

Cricket Bot Example — Powered by RAG & Amazon Q

I built a quick Cricket Q&A Bot using Amazon Q Developer.

Here’s what I did:

  • Uploaded 5 short PDFs about Virat Kohli and RCB to S3
  • Created an Amazon Q application (takes <5 mins)
  • Asked it questions like:
"How many runs did Kohli score in IPL 2016?"
"Has RCB ever won the IPL?"
"Who coached RCB in 2023?"
Enter fullscreen mode Exit fullscreen mode

Why This Is a Game-Changer
With Amazon Q and RAG, you can build assistants that:

Rely only on private data (great for enterprise use)
Scale as you add new content
Work across industries: HR, finance, insurance, healthcare, sports — you name it!

What You Need to Try This Yourself

✅ An AWS account (Developer Tier is enough)
✅ A few PDFs or files you want to build an assistant for
✅ Amazon Q Developer Console
✅ 20 minutes of curiosity!

Demo

Step 1: Prepare Your Data

Get your source material ready. For this example:

  • I collected 5 short PDFs about Virat Kohli and RCB
  • Make sure each document is cleanly structured (stats, articles, bios, etc.)

Step 2: Upload Your Documents to S3

  1. Go to your AWS Console
  2. Open the S3 service
  3. Create a new bucket (e.g., cricket-kohli-bot-data)
  4. Upload your PDFs

Image description

Image description

Step 3: Create an Amazon Q Application

  1. Go to Amazon Q Developer Console
  2. Click Create Application
  3. Name it something like RCB-Kohli-Assistant
  4. Select Private Data as your knowledge source
  5. Add S3 as your data source, and point it to your bucket

Image description

Image description

Now it’s time to point your data source. But first — make sure to click on “Create Index” — this is required before you can select any data source (like S3 in our case).

Once the index is created, go ahead and choose S3 as your data source.

You can leave all the settings as default and simply click “Create”.

After setup, your data source will appear in the list — don’t forget to click “Sync” to pull in all your source files (your PDFs from S3).

Image description

This will take a while (<1 min for me) but depends on the volume of files you wish to sync.

Now we have all set, lets spin up our bot applicaiton.

Image description

Once you enable the “Preview web experience,” it opens a webpage where you can start asking questions — just like you would with ChatGPT.

My questions :

Image description

if the info is not available in those PDF's it just returns as No answer found.

Image description

And that’s it — you’ve just built your very own customized ChatGPT-style chatbot, tailored exclusively to your data!

Final thoughts :

AI isn’t just about answering everything — it’s about answering the right things based on the right data.

Amazon Q gives you that power.
RAG makes it smart and conversational.
And cricket? Well, that just made it fun. 😄

P.S.: I’m well aware that as of June 4th 2025, RCB finally clinched the title after 18 years! But for the sake of this demo, I’m using sample data that isn’t updated beyond early 2025 — just to illustrate how the concept works in theory.

Thanks for reading, please share your thoughts!

Harsha

DevCycle image

Ship Faster, Stay Flexible.

DevCycle is the first feature flag platform with OpenFeature built-in to every open source SDK, designed to help developers ship faster while avoiding vendor-lock in.

Start shipping

Top comments (2)

Collapse
 
srinivas_duggirala_27eb7d profile image
Srinivas Duggirala

Nice, it motivates me to create one for my our Product documentation which is in HTML, Question : How can it describes more with limited data as feed to assistant?

Collapse
 
hvmathan profile image
Harsha Mathan

Thanks, Srinivas! It works similarly to our Vic— the more data you provide, the better and faster the assistant can respond. When relevant data is available, it can present more detailed and comprehensive answers. That’s exactly where Retrieval-Augmented Generation (RAG) makes a difference.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post