Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To build a useful retrieval-augmented generation (RAG) system, treat it as a pipeline: prepare trusted documents, retrieve relevant evidence for real user questions, give that evidence to a language model, and evaluate retrieval and answers separately. The seven steps below take you from defining the task to diagnosing failures, without assuming one chunk size, search pattern, or architecture works for every application.

What RAG does—and what it does not guarantee

RAG retrieves information from an external knowledge source and provides it to a language model as context before the model generates a response. It is commonly used when an application needs to answer from custom or proprietary documents that may not be in the model’s training data. Microsoft Learn’s Azure Architecture Center describes RAG as an industry-standard approach for applications that use language models with specific or proprietary data; AWS Prescriptive Guidance similarly describes a foundation model referring to an authoritative source, such as custom documents, before responding.

Retrieval can make relevant evidence available to a model, but it does not establish that the source is accurate, current, complete, or authorized for a particular user. Nor does retrieving context guarantee that the generated response will use it correctly. Design the source pipeline, access controls, answer behavior, and evaluation as parts of one system.

Step 1: Define the information need and success criteria

Start with a specific task

Write down what a user needs to accomplish, what kinds of questions they will ask, and which sources are authoritative for those answers. “Answer questions about our policies” is too broad to evaluate well; define representative tasks such as finding a policy requirement, comparing two procedures, or identifying where a rule applies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Build a test set before tuning

For each representative question, record the expected evidence and what a successful response should do. Include questions that depend on different documents, use different wording, or require combining information. This gives you a way to tell whether a change to chunking, search, or prompting actually helped. Microsoft’s solution-design guidance treats test documents and queries as part of the process, while AWS frames RAG around an authoritative source outside the model’s training data.

Step 2: Inspect and prepare source documents

Check the material before indexing it

Inventory the formats, structure, freshness, and permissions of the documents. Identify content that is obsolete, duplicated, incomplete, or not meant for every user. A system cannot retrieve a document that was never ingested, and retrieval from the wrong version can produce a plausible but outdated answer.

Preserve the path back to the source

For unstructured private data, AWS describes a preparation pipeline that converts documents to text, splits that text into manageable chunks, and preserves a mapping to the original document. Keep stable source identifiers and the metadata needed to trace each retrieved passage to its file and location. That traceability supports citations, debugging, and access checks; extracted text alone may lose layout or context that matters in the original file.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Step 3: Experiment with chunking and enrichment

Choose a method that fits the content

A chunk is a unit of source content that can be indexed and retrieved. Microsoft’s guidance describes several approaches: sentence-based, fixed-size, custom, layout-analysis, and machine-learning methods. The right choice depends on how the source is organized and what questions users ask. A document with clear sections, for example, may need a different treatment from a complex file whose meaning depends on layout.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare on representative questions

Try plausible chunking approaches against the test questions from Step 1. Inspect whether retrieved passages contain enough context to answer, whether unrelated material is being pulled in, and whether boundaries separate information that belongs together. The cited guidance does not establish a universally best chunk size, so do not treat a token or character count as a general rule. For complex layouts or files, assess whether layout analysis or a model-assisted approach is appropriate, and verify that the resulting text remains faithful to the source.

Step 4: Embed and index the content

Make prepared content searchable

Embeddings encode chunks as vectors so a search system can compare their meaning with a query. Store the vectors in an index alongside the source identity and metadata needed to filter, cite, and trace results. AWS explains that vector choices have implementation implications; the embedding method and index depend on the architecture you select.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Verify ingestion before tuning search

Check that the expected documents and chunks are present, that their metadata survived ingestion, and that each result can be mapped back to its source. If content is missing or mapped incorrectly, changing the search strategy will not fix the underlying preparation problem.

Step 5: Design retrieval for the questions people ask

Use the simplest search pattern that meets the need

Begin with representative queries and inspect the returned passages. Some workloads may be handled by a simpler single-query search. Others may benefit from conversational context, splitting a broad request into focused subqueries, or retrieving from multiple sources. Choose based on observed needs rather than assuming a more elaborate retrieval pipeline is automatically better.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the trade-off between classic and agentic patterns

In its Azure AI Search context, Microsoft describes classic RAG as a simpler pattern that avoids an LLM query-planning step. Its agentic retrieval pattern can use conversation context, parallel subqueries, semantic ranking, and structured grounding and citation data. That added planning and coordination can suit questions that need decomposition, but it also adds complexity. This is a vendor-described product-pattern comparison, not a universal performance benchmark.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Approach Useful when Trade-off described by Microsoft
Classic RAG A query can be handled without planning several focused searches. Simpler and faster in the Azure AI Search pattern because it avoids LLM query planning.
Agentic retrieval A request may need conversation context, multiple subqueries, or coordinated retrieval. Adds query planning and coordination; Microsoft describes capabilities including parallel subqueries, semantic ranking, and structured grounding and citation data.

Test the options on the same questions and evidence expectations. The vendor descriptions do not establish a general latency or quality result for your workload.

Step 6: Generate answers grounded in retrieved evidence

Give the model evidence and clear task instructions

Pass the retrieved context to the language model along with instructions suited to the application. Specify how it should handle unsupported questions and preserve the source references needed for attribution. Depending on the application, RAG may produce direct quotations or natural-language responses based on query results.

Keep answer claims tied to evidence

Inspect whether the response actually supports its claims with the retrieved passages. A fluent answer can still be wrong or inadequately grounded if retrieval missed the relevant evidence, returned poor matches, or the model overstated what the passages say. Citations are useful only when they point to relevant material and support the claims attached to them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Step 7: Evaluate, diagnose, and iterate

Measure retrieval separately from the response

Use the fixed test set to assess whether the retrieved context is relevant and sufficiently complete, then assess the generated answer. AWS documents retrieval measures such as context relevance and context coverage. For answers, it describes correctness, completeness, helpfulness, faithfulness, citation precision, and citation coverage. These measures address different failure modes: citation precision asks whether cited passages are correct, while citation coverage asks how well the response’s claims are supported.

Use failures to choose what to change

  • Relevant evidence is absent: check document ingestion, chunk boundaries, metadata filters, and search behavior.
  • Evidence is present but incomplete or irrelevant: revisit chunking, enrichment, and retrieval settings using the same test questions.
  • The answer does not follow the evidence: inspect the context passed to the model and the instructions governing its response.
  • Citations point to weak or unrelated support: examine source mapping and whether each cited passage supports the associated claim.

Microsoft describes end-to-end evaluation after preparing test documents and queries, chunking and enriching the content, embedding and indexing it, and implementing search. Change the component implicated by the failure, then run the evaluation set again.

Interpret scores within their limits

An evaluation score averages results across the selected prompts; it is not a guarantee for every future query. The score reflects the questions and data in that evaluation set, so retain the set and document what it covers when comparing system versions. A 2025 survey by Aoran Gan, Hao Yu, Kai Zhang, Qi Liu, Wenyu Yan, Zhenya Huang, Shiwei Tong, and Guoping Hu reports that its authors collected 582 PDF manuscripts for their analysis of RAG evaluation research. That figure describes the survey’s own corpus, not the total number of RAG papers. The survey identifies evaluation as difficult in part because retrieval and generation form a hybrid architecture and knowledge sources can change; it considers performance, factual accuracy, safety, and computational efficiency in addition to answer fluency.

Choose an architecture that fits your control and operating needs

Managed services can abstract parts of the RAG pipeline. A custom architecture gives you more choice over components such as the retriever or language model, but requires you to own more of the integration and operation. Compare viable options against the same application requirements rather than choosing by feature list alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Control: decide which pipeline components must be configurable and which can be managed for you.
  • Retrieval needs: determine whether your questions need one search, conversational context, query decomposition, or multiple sources.
  • Content shape: account for document structure, language, complex layouts, images, and PDFs.
  • Evidence quality: compare context relevance and coverage, answer correctness and faithfulness, and citation precision and coverage on the same evaluation set.
  • Operations: verify the provider’s current regions, data access controls, pricing, and supported integrations directly before selecting a production service; these details change and are not established here.

Official Microsoft, AWS, and Google Cloud materials describe relevant RAG and knowledge-base approaches, but product capabilities evolve. Treat provider-specific patterns as options to validate against your own documents, queries, access requirements, and evaluation results—not as proof that one managed or custom design is best for every system.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.