JevMade hello@JevMade.com
← Back to guides

JevMade field notes / RAG walkthrough

How to filter search results before an AI assistant reads them

You will learn how to test a method that checks saved documents before giving them to an AI assistant. This guide shows how to score text for relevance and hidden instructions to build better answers.

Original by TypeSafe AIRetrieval

Listen to this guide

JevMade’s plain-English explanation

0:00 /

AI narration

Credits

“Classifying RAG passages” by TypeSafe AI. Read the original source.

This expanded guide is an AI-narrated adaptation prepared by JevMade. It expands the source’s essential ideas, examples and caveats in JevMade’s own words and is not a word-for-word reading. The synthetic voice does not imitate the author or imply their endorsement.

Our summary

This guide tests a way to help an AI assistant find useful information and leave out text it does not need. People use this method to sort through saved documents, ensuring the software only reads relevant facts instead of confusing instructions.

In these tests, the system uses an AI tool that chooses from options to score each piece of text. It asks if the text answers the question or hides bad instructions. A code script then groups the acceptable text for the AI assistant.

This approach is useful for developers building search tools with API keys, which are private access codes. However, filtering cannot fix a collection of saved documents that is already false. The software must still treat all incoming text as untrusted information.

Key takeaways

  1. Judge each piece of text on its own instead of trusting the original search order.
  2. Keep rules in your code to separate useful facts from hostile or conflicting text.
  3. Build the final instructions for the AI assistant using only the text that passes your tests.

Filtering evidence cannot make an incomplete or incorrect collection of documents truthful. The AI assistant must still treat all filtered text as untrusted data.

TypeSafe cookbook · Source reviewed

Read the original guide Opens the author’s site in a new tab.