Chatrix is an agentic evaluation platform for conversational AI applications. This project enables automated testing and quality assessment of conversational agents through multi-scenario simulations and intelligent evaluation.
- π€ Multi-Agent Testing: Automated conversation simulation with testing agents.
- π Intelligent Evaluation: AI-powered assessment of conversation quality and outcomes.
- π― Scenario-Based Testing: Support for multiple test scenarios with custom prompts.
- π Comprehensive Reporting: Detailed test results with success rates and analytics.
- OS: Linux, macOS, or Windows
- Python: 3.11+
- Services:
- OpenAI-compatible LLM inference endpoints (OpenAI, OpenRouter, vLLM, Ollama, etc.)
-
Clone the repository
git clone https://github.com/taresh18/chatrix.git cd chatrix -
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # Linux/macOS # venv\Scripts\activate # Windows
-
Install dependencies
pip install -e . -
Configure environment variables
cp .env.example .env nano .env # Add your API keys and endpoints -
Set up test scenarios
- Create test scenarios in
test_suite/scenarios/ - Each scenario needs:
test_agent.txt,evaluation_agent.txt - Configure main agent prompt in
test_suite/main_agent.txt
- Create test scenarios in
-
Configure your environment
Ensure all API keys and endpoints are set in your
.envfile. -
Run the test suite
python -m chatrix.main
-
View results
- Test results are saved to timestamped directories in
outputs/ - Each run generates a comprehensive JSON summary
- Individual conversation transcripts are saved with evaluation details
- Test results are saved to timestamped directories in
chatrix/
βββ test_suite/
β βββ main_agent.txt # Main agent system prompt
β βββ scenarios/
β βββ balance_inquiry/
β β βββ test_agent.txt # Testing agent prompt
β β βββ evaluation_agent.txt # Evaluation criteria
β βββ payment_confirmation/
β βββ test_agent.txt
β βββ evaluation_agent.txt
βββ chatrix/
β βββ core/ # Orchestration and agent factory
β βββ agents/ # Agent service implementations
β βββ models/ # Data models and schemas
β βββ utils/ # Logger, settings, and utilities
βββ outputs/ # Test results and transcripts
βββ .env.example # Template for environment variables
βββ pyproject.toml # Project dependencies
βββ .gitignore
βββ README.md
-
Create scenario directory
mkdir test_suite/scenarios/your_scenario
-
Add testing agent prompt (
test_agent.txt)- Define the user persona and objectives
- Specify the conversation flow and expected outcomes
-
Add evaluation criteria (
evaluation_agent.txt)- Define what constitutes a successful conversation
- Specify evaluation criteria and outcome checks
-
Configure main agent (
main_agent.txt)- Set the system prompt for the agent under test
- This prompt is shared across all scenarios
Chatrix generates comprehensive test reports:
- Overall Result: PASS/FAIL based on scenario success rates
- Success Rate: Percentage of scenarios that passed evaluation
- Scenario Results: Individual pass/fail status for each test
- Conversation Transcripts: Full dialogue with evaluation details
- Outcome Checks: Detailed assessment of conversation quality
Example output:
Starting Chatrix Test Suite...
==================================================
TEST SUITE RESULTS
==================================================
Overall Result: PASS
Success Rate: 100.0%
Output Directory: outputs/test_run_20250907_193206
Summary:
Total Scenarios: 2
Passed: 2
Failed: 0
Errors: 0
Scenario Results:
[PASS] balance_inquiry
ββ Test Result: PASS
[PASS] payment_confirmation
ββ Test Result: PASS
- Pydantic AI: https://github.com/pydantic/pydantic-ai
This project is released under the Apache License 2.0. See the LICENSE file for details.