Evaluation¶
The Jenkins agent evaluation system is built using the DeepEval framework combined with pytest. The suite is designed to test the agent against four key pillars, using parameterized test cases (defined in test_cases.py) that simulate real-world problem-solving scenarios and logic traps.
1. Answer Relevancy¶
File:
test_answer_relevancy.pyGoal: Ensure answers are direct, relevant, and limited to the DevOps/Jenkins context.
Metrics:
AnswerRelevancyMetricKey Detail: If the user asks questions out of context (e.g., recipes), the agent should refuse to answer. This polite refusal is evaluated as the correct response and receives a full score (1.0).
2. Context Recall¶
File:
test_context_recall.pyGoal: Evaluate the Hybrid Retriever and Reranker system by querying the real Vector DB (Qdrant).
Metrics:
ContextualRecallMetricKey Detail: Unlike other tests that use mocked data, this test verifies that the text chunks retrieved from the vector database actually contain the necessary facts (
expected_output) to correctly answer the user’s query.
3. Faithfulness (Groundedness)¶
File:
test_faithfulness.pyGoal: Prevent hallucinations. The output must be entirely deducible from the responses provided by the tools.
Metrics:
FidelityMetricKey Detail: The test cases belong to specific “Hallucination Traps.” For example, the agent is tested to see if it invents the existence of a missing file or assumes that a plugin is installed just because it is popular (e.g., Kubernetes plugins), forcing it to rely only on the logs/data received.
4. Latency and Costs¶
File:
test_performance.pyGoal: Ensure that end-to-end (E2E) operations meet budget and time constraints.
Metrics: Custom classes
AgentLatencyMetricandAgentCostMetric.Key detail: The test tracks execution time in seconds and calculates actual costs by counting input and output tokens (multiplied by the prices defined in the environment). It fails if the latency exceeds the
max_latencyor if the cost exceeds themax_costdefined for that specific scenario.