Module 20 Lesson 1: Controlled RAG
·AWS Bedrock

Module 20 Lesson 1: Controlled RAG

High-Fidelity Search. How to use AgentCore to make your RAG systems more reliable by adding pre-search and post-search nodes.

AgentCore + KB: The Verified Search

In a basic Knowledge Base (Module 8), the AI just reads a chunk and answers. In AgentCore, we can make this process much more robust by adding Verification Nodes.

1. The Strategy: "Query Refinement"

Instead of searching exactly what the user typed, we use a node to Refine the query first.

  • User: "Where's my stuff?"
  • Refinement Node (AI): "The user is asking for order status. I will generate a search query for 'Order delivery status policy' for the Knowledge Base."

2. Integrated Retrieval

In AgentCore, the Knowledge Base call is just one node in the graph. You can decide what to do if the search fails before the user sees an error.


3. Visualizing Controlled RAG

graph TD
    U[User Query] --> R[AI Node: Refine Query]
    R --> KB[Node: KB Search]
    KB --> V{Node: Is context relevant?}
    V -->|No| R2[Node: Try different search]
    V -->|Yes| G[AI Node: Generate Answer]
    R2 --> KB

4. Why this is the "Enterprise Way"

It prevents the AI from "Guessing" when the search results are weak. By adding a Verification Node (Is context relevant?), you ensure that the AI only answers when it has high-quality evidence.


Summary

  • Refinement Nodes improve search accuracy.
  • Knowledge Base calls are just one step in an AgentCore graph.
  • Verification Nodes catch "Weak search results" before the AI generates a hallucination.
  • This structure allows for Multi-try Search logic.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn