Agentic RAG Evaluation
Evaluation Features
Agentic RAG differs from the classical approach in that the system can perform multiple search steps, reformulate queries, choose between different sources and tools. Evaluation should consider not only the final response but also intermediate actions.
Metrics
| Aspect | Metric | Description |
|---|---|---|
| Response | Faithfulness | Alignment of the response with found facts |
| Response | Answer Relevancy | Relevance of the response to the query |
| Search | Context Precision | Precision of the found context |
| Actions | Tool Selection Accuracy | Correctness of tool selection |
| Process | Efficiency | Number of steps to the answer |
Approaches
- Step-by-step evaluation: evaluation of each agent action (tool selection, query formulation).
- Final result evaluation: evaluation of only the final response.
- Process-result oriented: combination of both approaches.
# Example of evaluating an agent step
def evaluate_step(agent_action, expected_action):
if agent_action.tool != expected_action.tool:
return 0.0
return similarity(agent_action.query, expected_action.query)