Want a live demo of our AI support agents? Join our next webinar on Wed 18 Nov, 9:30am (PT) / 5:30pm (UK)Webinar Wed 18 Nov · 9:30am PT / 5:30pm UK (opens in a new tab)

Design RAG retrieval and reranking for support questions

The short answer

Good retrieval finds evidence the customer is allowed to see, for the problem they actually have. Work out the question from the conversation, ask when the meaning is genuinely unclear, combine search methods that suit your content and add reranking only when tests show it helps. Then give the answer step enough evidence to be right, with its sources, conditions and gaps still visible.

The support case

Establish the question before searching

Retrieval quality starts before any search runs. Use the recent conversation to work out the subject, the time period and what is still unresolved. Keep what the customer actually said separate from what you infer from it: “my order” is a statement, while “they mean order ORD-204” is a guess until the customer or a trusted record confirms it.

If a missing detail would change the next action, ask a targeted question instead of guessing. “Are you waiting for the parcel or the refund?” gets you a useful answer in one turn. A broad “Can you tell me more?” makes the customer do the work of figuring out what you need.

When the question is clear enough to search, search for the stated issue and for the reasonable alternatives, without turning one of those alternatives into a fact. Write the search request from the conversation, not just the last message, and keep literal details such as order numbers, product names and error codes exactly as the customer typed them.

Use the search method that fits the question

Support questions come in two broad shapes, and each suits a different kind of search. Keyword search matches the exact words in the query, which is what you want for an error code like “E-1042”, a SKU or a named plan. Semantic search uses embeddings, numeric representations of meaning, so it can match “my card keeps getting declined” to an article titled “Payment failures” even though the words differ.

Most support traffic mixes both, so test both. Hybrid search runs the two methods and merges the results, and it often helps when one message contains an exact identifier and a loose description of the symptom. Measure it on your own questions before adopting it, because it also adds tuning work and another thing to debug.

ChoiceWhen it may helpWhat to measure
Keyword searchOrder codes, error strings and exact terminologyExact-match recall and irrelevant matches
Semantic searchDifferent wording for the same issueRelevant evidence found across customer phrasing
Hybrid searchMixed exact and descriptive queriesCoverage gain and operational complexity
RerankingSeveral plausible candidates need a better orderRelevant evidence near the top, answer quality, latency and cost
ClarificationSeveral meanings would require different answersUseful follow-up questions and customer effort

Apply access filters before anything reaches the model

The retrieval request should carry the audience and account permissions that your application has verified, not ones the model or the customer supplied. Use them to filter out restricted sources before the model sees any text. If you give the model a restricted fact and then tell it not to mention it, you are relying on the model’s obedience, and a paraphrase or summary can still leak it. Filtering first means the fact is simply not there to leak.

It also helps to keep two kinds of private content apart. An approved internal instruction, such as “transfer billing disputes over $500 to the finance queue”, is something the agent is meant to use, even though the customer never sees the instruction itself. A restricted account document may contain information this visitor must not receive at all. Record those as separate classes in your source register so the filter treats them differently.

Treat reranking as a measured choice

A reranker is a second model that takes the candidates your search returned and re-scores each one against the question, so the most useful passages move to the top. That can make a real difference when search finds the right article but ranks it fifth. It cannot fix a source that does not exist, an access-control mistake or a query so poor that none of the candidates are useful.

To decide whether you need one, compare a baseline without reranking against a configuration with it, using the same documents and a set of held-out questions the team did not use for tuning. Look at whether the needed evidence reaches the top results and whether the final answers improve, then weigh that against the extra latency and cost per request.

Options include hosted rerankers from Cohere and Voyage AI by MongoDB, and open models such as BGE through the FlagEmbedding library. These are examples to evaluate, not a statement about which models My AskAI uses. Before you commit, check the specific model’s language coverage, input limits, license, hosting requirements and current terms.

Give the answer step a bounded set of evidence

Pass each piece of evidence with its title, where it came from, when it was last updated and enough surrounding text to keep its conditions attached. An answer can fail because it gets too little context: a chunk that says “refunds take 5 days” without the following sentence, “except for international orders”, will produce a confident wrong reply. Adding every retrieved chunk causes the opposite problem, burying the one rule that matters under loosely related material.

Set a context budget, remove duplicates and measure what gets cut. Treat an empty search, a truncated result, conflicting sources and a failed search as different states, because each calls for a different reply. “I couldn’t find anything on that” is honest after an empty search, but misleading after a search that errored.

When sources conflict, apply your defined source priority or ask the content owner to resolve it. Don’t let the model quietly pick whichever policy is most convenient. Relevance scores are not a verdict either: a low score is not proof the answer is wrong, and a high score is not proof the fact is current.

Test retrieval separately from the final answer

A good final reply can hide weak retrieval, and a bad reply can come from good retrieval used badly. Evaluate the two steps separately. For each test question, label which source should be found, check whether search found it, then check whether the final reply used it correctly.

Build the test set from the cases that break retrieval in practice: misspellings, short follow-ups like “and the other one?”, exact codes, questions in other languages, questions with no answer in your content, policies that recently changed and questions whose only matching source is restricted. Re-run the set whenever you change sources, embeddings or ranking.

Build decisions and checks

Use these decisions to turn the worked case into your own implementation. A check is complete only when you have evidence for the stated result.

Handle unclear and incomplete questions

Required. "It still won't work" might refer to an earlier step, an order or a new issue.

Build. Use the conversation and verified facts to build search queries. Keep IDs and error codes exactly as written. Search the plausible meanings within a set budget. When the alternatives would lead to different actions, ask one focused question.

Check. Test misspellings, short follow-ups, exact codes and ambiguous requests. The agent never invents an order or an intent.

Compare search and ranking methods

When it applies. The closest text match can miss a crucial exception or an exact identifier.

Build. Compare keyword, vector and hybrid search. Evaluate reranking (re-sorting results by relevance) with Voyage AI by MongoDB, Cohere or an open implementation, and keep the extra step only if it improves your chosen cases enough to justify the cost and delay. Apply access and source filters based on trusted identity and entitlements before any content reaches the model. Relevance never grants access.

Check. Measure whether the needed evidence shows up and whether the final answer gets better. Test languages and long documents separately. An anonymous visitor gets no restricted fact, not even as a paraphrase or summary.

Control how much evidence reaches the model

Required. Too much text buries the key facts. Too little drops the condition that makes an answer correct.

Build. Set a context budget and remove duplicates. Keep the surrounding clauses an answer depends on, plus source metadata. Treat empty, truncated, conflicting and failed retrieval as different states. Run extra retrieval only when it can fill a specific gap.

Check. Test an answer that depends on an exception near a chunk boundary, and a tool result that comes back incomplete.

Make uncertainty and source limits visible

Required. A confident answer can quote an outdated page or expose an internal link.

Build. Require evidence for business facts. Check that links shared with customers work and are relevant. Define when to ask, decline or transfer. Don't retrieve restricted customer facts for someone who isn't authorized. Approved internal instructions, such as a transfer rule, can shape behavior without revealing their confidential contents. Whether a source can be cited and whether a fact can be disclosed are separate checks.

Check. Ask questions that have no answer and questions with conflicting evidence. The agent never makes up a policy or a citation.

Templates and examples

Every file uses synthetic data. Adapt it to your own policies and test it somewhere safe before it touches customers.

All templates and checklists

Keep it working

Launch is the start of the work, not the end. These are the recurring jobs this part of the agent needs, and who usually owns them.

CadenceOwnerWork
WeeklySupport leadTurn failed searches and clarification loops into new test cases.
On changeEngineeringTest again after changes to sources, embeddings or ranking.
WeeklyEngineeringReview context size, truncation and claims the evidence doesn't support.
WeeklyKnowledge ownerReview unsupported answers, broken links and use of stale sources.

Test your decision

A reranker moves an outdated article above the current policy. Should you fix this only by changing the prompt?

Show the expected decision

No. Fix the source lifecycle and metadata first, so the current policy is clearly identifiable and the stale article is removed or correctly scoped. A prompt instruction to “prefer newer articles” papers over the problem and will fail the next time two versions look similar. Once the sources are clean, re-test ranking and answer behavior.

Common questions

Does every support agent need a reranker?

No. Add one when testing shows it improves both retrieval and the final answers enough to justify the extra latency, cost and operational work. A small, well-maintained knowledge base may not need one.

How many chunks should reach the model?

Enough to support the answer along with its conditions and exceptions. There is no universal number. Set a bounded context budget and test it against representative questions, including ones where the key exception sits near a chunk boundary.

What should the agent do when retrieval finds nothing useful?

Say so plainly and offer the next step, such as a clarifying question or a handover, instead of answering from general knowledge. Log the question so the content owner can see whether a source is missing.

Sources

Official documentation backs the provider-specific facts; the worked cases and recommendations are teaching material. Check the current API and model version before you build.

Rather skip the build?

My AskAI is an AI support agent that already does all of this inside your helpdesk. Set it up in minutes and pay per AI reply: $0.05 on the Scale plan, with models, hosting and maintenance included.