Skip to main content
Generate functional tests directly from your RAG knowledge base to validate that your model correctly retrieves and synthesizes information from your documents.

Overview

Testing RAG applications requires validating that:
  1. Retrieval works correctly: Relevant documents are found
  2. Synthesis is accurate: Information is correctly combined
  3. Responses are grounded: Answers are based on the knowledge base
  4. No hallucinations: Model doesn’t make up information

How It Works

TrustTest automatically:
  1. Connects to your knowledge base (vector store, database, etc.)
  2. Retrieves document chunks
  3. Generates question-answer pairs based on the content
  4. Creates test cases with expected responses
  5. Evaluates your model’s actual responses against expectations

Supported Knowledge Bases


Code Example

Using In-Memory Knowledge Base

Using PostgreSQL with pgvector


Configuration Options


Question Types

TrustTest generates different types of questions:

Evaluating RAG Responses

For RAG applications, use these evaluators: