Retrieval-augmented generation (RAG) makes a model answer from your own documents. On AWS, start with Amazon Bedrock Knowledge Bases: point it at S3 and it chunks, embeds, stores and retrieves for you, then returns cited answers. Build your own pipeline only when you need custom chunking, hybrid search or strict multi-tenant access control.
RAG is a pattern, not a product. Before the model answers, you retrieve the most relevant passages from your own data and put them in the prompt. The model answers from those passages instead of from memory alone.
A foundation model only knows its training data, frozen at a cutoff date. It knows nothing about your wiki, tickets, contracts or last night's product change, and if you ask, it may invent an answer. RAG separates knowledge from reasoning. The model does the language and reasoning; the facts come from data you control and can update at any time.
Offline, you split documents into chunks, turn each chunk into a vector with an embedding model, and store the vectors. At query time, you embed the question with the same model, find the nearest chunks, optionally re-rank them, and put the best ones in the prompt with an instruction such as "answer only from the context below and cite the passage you used."
You get three things. Freshness: update a document and the next answer reflects it, with no retraining. Citations: users can check the source. Governance: you decide what is in the corpus and who can retrieve what. Fine-tuning bakes knowledge into weights, is costly to update, gives no citations and cannot enforce per-user access. Use RAG for knowledge; use fine-tuning for style or a narrow skill.
Every RAG system, managed or DIY, runs the same seven stages. Most quality problems trace back to one of them.
1. Ingest. Land documents in Amazon S3 from your wiki, CRM, ticketing system or database exports. PDFs, HTML and Word files need clean text extraction (Amazon Textract helps with scans and tables). Messy extraction is the most common silent cause of bad answers.
2. Chunk. Split documents into passages small enough to embed precisely and large enough to carry meaning. A common starting point is 300 to 800 tokens with 10 to 20% overlap. Tune it on your data.
3. Embed. Turn each chunk into a vector with Amazon Titan Text Embeddings V2 or Cohere Embed on Bedrock. Change the embedding model later and you must re-embed everything.
4. Store. Write each vector, its text and its metadata (document ID, title, access tags, timestamps) to a vector store. Options are in section IV.
5. Retrieve. Embed the question with the same model and fetch the nearest chunks, often 10 to 50 at this stage. Hybrid retrieval (vectors plus keyword search) usually beats vectors alone, because it catches exact terms, product names and acronyms.
6. Re-rank. A re-ranker (Amazon Rerank or Cohere Rerank on Bedrock) scores each candidate against the question and keeps the best few. It is often the biggest single quality gain.
7. Generate. Send the instruction, the re-ranked chunks and the question to a model on Bedrock (Claude, Amazon Nova, Llama, Mistral). Ask it to answer only from the context and to cite sources, and show those citations to the user.
| Stage | Phase | What it does | Typical AWS service |
|---|---|---|---|
| 1. Ingest | Indexing | Land and parse documents | Amazon S3, Textract |
| 2. Chunk | Indexing | Split into passages | Bedrock KB built-in, or Lambda or Glue (DIY) |
| 3. Embed | Indexing | Text to vectors | Titan Text Embeddings V2, Cohere Embed (Bedrock) |
| 4. Store | Indexing | Index vectors and metadata | OpenSearch Serverless, Aurora pgvector, S3 Vectors, Pinecone and others |
| 5. Retrieve | Query | Find the nearest chunks | Vector store query, plus keyword search for hybrid |
| 6. Re-rank | Query | Keep the best few chunks | Amazon Rerank, Cohere Rerank (Bedrock) |
| 7. Generate | Query | Answer with citations | Claude, Nova, Llama, Mistral (Bedrock) |
Start managed. Move a stage to DIY only when a specific requirement forces it.
Point a knowledge base at S3 or a connector (web crawler, Confluence, Salesforce, SharePoint), pick an embedding model and a vector store, and Bedrock handles ingestion, chunking, embedding, indexing, retrieval and optional re-ranking. Call Retrieve for chunks or RetrieveAndGenerate for a cited answer. It syncs changed documents, returns citations and works with Bedrock Guardrails.
Choose it when you want to ship fast, your documents live in S3 or a supported source, the built-in chunking (fixed, semantic or hierarchical) is good enough, and you do not need unusual retrieval logic. That covers most internal-knowledge and support use cases.
You still call Bedrock for embeddings and generation, but you own every other stage: parser, chunker (Lambda, Glue or Step Functions), writes to the vector store, retrieval and hybrid search, re-ranking and prompt assembly. LangChain or LlamaIndex are common but optional.
Choose it when you need document-aware chunking, hybrid search with your own score fusion, row-level or strict multi-tenant access control, an existing vector store, or tight cost and latency tuning. The cost is more engineering time and upkeep.
Prototype on Bedrock Knowledge Bases to prove the use case and get baseline quality. Move a stage to DIY only when a concrete requirement forces it. Many production systems mix both: a knowledge base for the bulk corpus, DIY for one demanding source.
The vector store holds your embeddings and answers nearest-neighbour queries. The right one depends on how you operate, your cost shape and your scale.
Bedrock Knowledge Bases can use Amazon OpenSearch Serverless, OpenSearch Service managed clusters, Amazon S3 Vectors, Amazon Aurora PostgreSQL (pgvector), Neptune Analytics (for GraphRAG), Pinecone, Redis Enterprise Cloud and MongoDB Atlas. A DIY pipeline can use any of these, plus stores such as Amazon MemoryDB. The current list is in the Bedrock user guide.
OpenSearch Serverless is the common default. It does vector and keyword search in one engine, so hybrid retrieval is built in, but it bills by capacity units with a baseline, which can feel high for a small corpus. Aurora PostgreSQL with pgvector suits teams already on Postgres: vectors sit next to your relational data and you filter with SQL. S3 Vectors targets large vector sets that are queried less often, at lower storage cost. Pinecone is a vector-only managed service from a third party. In-memory stores such as MemoryDB fit retrieval where latency matters most, at a higher cost per GB.
| Vector store | Hybrid search | Best fit | Watch out for |
|---|---|---|---|
| OpenSearch Serverless | Built in (vector and keyword) | Default for Bedrock KB; one engine for both | Baseline cost on small corpora |
| Aurora PostgreSQL (pgvector) | Vector plus SQL filters | Teams already on Postgres | Specialist engines win at very high scale |
| Amazon S3 Vectors | Vector plus metadata filters | Large, less-queried vector sets | Higher query latency than in-memory stores |
| Pinecone | Vector plus metadata filters | Vector-first workloads with little tuning | Separate vendor and contract |
| MemoryDB (DIY) | Vector plus filters | Lowest-latency retrieval | Memory pricing on large indexes |
If the right chunk never reaches the prompt, no model can answer well. Three knobs matter most.
Amazon Titan Text Embeddings V2 is AWS-native, low cost and lets you choose output dimensions (256, 512 or 1,024); smaller vectors save storage and speed search at a small recall cost. Cohere Embed (English and multilingual) is a common pick for multilingual corpora. Two rules matter more than the winner: embed queries and documents with the same model and version, and benchmark on your own questions before you commit, because switching later means re-embedding everything.
Chunks that are too large blur the embedding and waste tokens; chunks that are too small lose context. Start around 300 to 800 tokens with some overlap, then tune. Split on headings, keep tables and code blocks whole, and store the section title in metadata. For long technical or legal documents, hierarchical chunking (retrieve small child chunks, send the larger parent to the model) is one of the most reliable upgrades. Bedrock Knowledge Bases offers fixed, semantic and hierarchical chunking.
Vector search is fast but approximate. A re-ranker reads the question and each candidate together and scores real relevance. Retrieve a wide set cheaply, then re-rank and keep the best few. Amazon Rerank and Cohere Rerank are on Bedrock, and Knowledge Bases can apply re-ranking for you. You get better answers and fewer input tokens.
When answers are bad, check retrieval before generation: (1) is the right chunk in the index? (2) does it come back in the wide candidate set? (3) does it survive re-ranking? (4) only then, is the prompt or model the problem? Most RAG quality issues are retrieval problems.
A demo is not an evaluation. Use metrics that separate retrieval problems from generation problems.
Build a fixed set of real questions with correct answers and, ideally, the source passage. Run it on every change. Amazon Bedrock includes RAG evaluation that uses a model as a judge to score retrieval and answers; open-source tools such as Ragas do the same for DIY pipelines.
In production, log every query with its retrieved chunks and answer, and have a person review a sample. Automated judges miss domain errors an expert catches at once.
Four things rarely show up in a prototype and always show up in production.
A fixed evaluation set in CI · citations on every answer · access filters on every retrieval · a freshness target per source · Guardrails on inputs and outputs · query, context and answer logging · streaming · billing alarms.
Most GenAI assistants are RAG underneath. The differences are the sources, the channel and the controls.
The fastest credible path to a cited RAG system on AWS. A DIY build follows the same order.
A RAG bill has five lines. Generation is usually the largest, then the vector store baseline. Check the AWS pricing pages for current rates.
| Cost line | When you pay | Main lever |
|---|---|---|
| Embeddings (indexing) | Once per corpus, then on updates | Chunk size, smaller dimensions, re-embed only changed documents |
| Vector store | Continuously | Right-size the engine; use pgvector if Postgres already runs |
| Query embeddings | Per query | Small per call; cache repeated questions |
| Re-ranking | Per query | Re-rank a modest candidate set; skip trivial queries |
| Generation | Per query, usually the largest | Smaller model for easy questions, fewer chunks, prompt caching, a max-token limit |
A partner files one kind of AWS funding. You apply for the other.
Partner-filed funding. If the build qualifies, your matched AWS partner can file POC (proof of concept) funding to test the use case, or incremental workload (IW) funding if you already run on AWS and are launching new work such as an AI assistant. If you are moving to AWS from another cloud, it can file MAP migration funding. For startups this is typically $50K to $150K. Depends on the workload; AWS approves. See AWS partner funding.
AWS Activate credits. You apply yourself at aws.amazon.com/startups/credits: Activate Founders gives $1,000 to start, up to $5,000; Activate Portfolio gives up to $200,000 with an Org ID from your VC, accelerator or angel group if it is an Activate Provider. A consulting partner cannot file Activate for you.
If your team can build RAG and you only need Activate credits, apply yourself; you do not need a partner. A partner helps when you want the build done with you, or when the work qualifies for funding only a partner can file.
Default to managed. Move a stage to DIY only when a row in the right column is a hard requirement.
| Dimension | Bedrock Knowledge Bases | DIY (Bedrock plus your stack) |
|---|---|---|
| Time to first answer | Fast: point at S3, sync, call an API | Slower: build every stage |
| Pipeline you maintain | Almost none | All of it |
| Chunking | Fixed, semantic or hierarchical presets | Anything, fully custom |
| Retrieval logic | Managed retrieval, optional re-rank, metadata filters | Custom hybrid search and score fusion |
| Access control | Metadata filters | Anything: row-level, per tenant, external policy engine |
| Vector store | The supported list in the Bedrock user guide | Any store |
| Cost control | Less granular | Tune every stage |
| Best for | Most internal-knowledge and support use cases | Custom chunking, hybrid search, strict multi-tenancy, cost squeeze |
You fill in a short form: what you run today, what you want to move, test or build, your stage and your region.
We read your answers and pick one vetted AWS consulting partner that fits the work, the stack and the region. We reply within 24 hours; your matched partner reaches out within 5 business days.
Your matched partner scopes the test with you. Then it checks whether the test qualifies for POC (proof of concept) funding. A POC can fit whether or not you run on AWS today.
If the work qualifies, the partner files the funding request with AWS. AWS reviews it and decides. The amount depends on the workload.
CloudRoute is free for startups. Partners pay CloudRoute a monthly membership plus 10% of AWS-approved funding.
AWS Activate credits are separate, and you apply for them yourself. Use Activate Founders if no investor backs you. Use Activate Portfolio with the Org ID or invite from your VC, accelerator, incubator or angel group if it is an Activate Provider. A consulting partner cannot apply for Activate on your behalf.
CloudRoute matches you with one vetted AWS partner that builds RAG on Bedrock: Knowledge Bases or a custom pipeline, the vector store, re-ranking, access control and evaluation. If the build qualifies, the partner files POC or incremental workload (IW) funding, typically $50K to $150K for startups. Depends on the workload; AWS approves. CloudRoute is free for startups.