An Azure-hosted RAG accelerator that grounds a chat assistant in your own documents, returning answers with inline citations to sources.
Azure-Samples/ai-rag-chat-evaluator
Scripts and tools to evaluate RAG chat apps using the Azure AI Evaluate SDK and OpenAI-based graders.
- Stars
- 336
- Forks
- 116
- Open issues
- 25
- Last commit
- 4 days ago
What is it?
This project provides a command-line toolkit for measuring the answer quality of chat applications built on retrieval-augmented generation (RAG). Parameters such as the system prompt, search settings, and GPT model options all change how answers look, so each change can be checked against a set of ground truth question-and-answer pairs.
The evaluator sends questions to a running chat endpoint and scores the responses with GPT-based metrics such as groundedness, relevance, coherence, and similarity, plus code-based metrics like latency, answer length, and citation presence. It also includes generators that create ground truth question sets, including questions the source documents cannot answer, to test whether an app can say "I don't know".
Results are saved per run with per-question details and summary statistics. Built-in review commands compare runs in a terminal and show each run's parameters. The tool works with Azure OpenAI deployments (with keyless access by default) or openai.com accounts, and is set up through the azd CLI.
Key features
- 01Scores RAG answers with GPT-based metrics such as groundedness, relevance, and coherence.
- 02Computes code-based metrics including latency, answer length, and citation checks.
- 03Generates ground truth question sets, including questions the documents cannot answer.
- 04Compares answers across runs in a terminal diff view, with filtering by changed metrics.
- 05Supports Azure OpenAI with keyless authentication or openai.com accounts.
Use cases
- Checking whether a prompt or search setting change improves answer quality before deploying.
- Measuring how often a RAG chat app admits it does not know when the sources lack an answer.
- Running quick subset evaluations during development with a limited number of questions.
- Comparing two experiment runs question by question to find regressions.
Quick start
- 1
Install Python 3.10 or higher
- 2
Create and activate a Python virtual environment
- 3
Install the project into the virtual environment
python -m pip install -e . - 4
Run an evaluation with the example config
python -m evaltools evaluate --config=example_config.json
Things to know
- Evaluation relies on a GPT-4 class model, so you need an Azure OpenAI or openai.com instance.
- Running GPT-based evaluators incurs token costs for every question and evaluator used.
- Built-in metrics use English-language prompts and are only suited to English answers.
In collections
Topics
FAQ
- What is ai-rag-chat-evaluator?
- Scripts and tools to evaluate RAG chat apps using the Azure AI Evaluate SDK and OpenAI-based graders. This project provides a command-line toolkit for measuring the answer quality of chat applications built on retrieval-augmented generation (RAG). Parameters such as the system prompt, search settings, and GPT model options all change how answers look, so each change can be checked against a set of ground truth question-and-answer pairs.
- Is ai-rag-chat-evaluator free to use? What license does it have?
- ai-rag-chat-evaluator is open source under the MIT license. Check the license terms before using it in commercial products.
- Is ai-rag-chat-evaluator still maintained?
- Actively maintained. The last commit to ai-rag-chat-evaluator was on Nov 3, 2026.
- What can I use ai-rag-chat-evaluator for?
- Checking whether a prompt or search setting change improves answer quality before deploying. Measuring how often a RAG chat app admits it does not know when the sources lack an answer. Running quick subset evaluations during development with a limited number of questions. Comparing two experiment runs question by question to find regressions.
- How do I install ai-rag-chat-evaluator?
- Install Python 3.10 or higher Create and activate a Python virtual environment Install the project into the virtual environment: python -m pip install -e . Run an evaluation with the example config: python -m evaltools evaluate --config=example_config.json
- Where can I get ai-rag-chat-evaluator?
- The source code and installation instructions are on GitHub: https://github.com/Azure-Samples/ai-rag-chat-evaluator
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source Python framework for unit-testing LLM apps, with metrics for RAG, agents, chatbots, voice agents and more, similar in spirit to Pytest.
A Python and TypeScript library for scoring AI model outputs with LLM-as-a-judge, heuristic, and statistical evaluators.
Python and TypeScript library of prebuilt and customizable evaluators for testing LLM application outputs, including LLM-as-judge scoring.
A Python chat web app that calls Azure OpenAI with managed identity, provisioned and deployed to Azure Container Apps via azd.
Azure-based solution accelerator that mines conversational and document data with generative AI, offering chat exploration and auto-generated insight dashboards.