Overview
Testing RAG applications requires validating that:- Retrieval works correctly: Relevant documents are found
- Synthesis is accurate: Information is correctly combined
- Responses are grounded: Answers are based on the knowledge base
- No hallucinations: Model doesn’t make up information
How It Works
TrustTest automatically:- Connects to your knowledge base (vector store, database, etc.)
- Retrieves document chunks
- Generates question-answer pairs based on the content
- Creates test cases with expected responses
- Evaluates your model’s actual responses against expectations
Supported Knowledge Bases
Code Example
Using In-Memory Knowledge Base
Using Azure AI Search
Using PostgreSQL with pgvector
Configuration Options
Question Types
TrustTest generates different types of questions:Evaluating RAG Responses
For RAG applications, use these evaluators:Gold answers from retrieved docs
UseRagContextBuilder when you want an ExpectedResponseContext dataset grounded in retrieved chunks:
embeddings and topic_summarizer with set_config before clustering unlabeled documents. Clustering (UMAP / HDBSCAN) is not Azure-only.