Agent skill
eval-frameworks
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/eval-frameworks
SKILL.md
Evaluation Frameworks
Overview
Traditional software metrics (accuracy, F1) fail to capture the quality of LLM outputs. Evaluation frameworks like Ragas and DeepEval use "LLM-as-a-judge" to quantify subjective qualities like faithfulness, relevance, and professionalism.
When to Use
- RAG Benchmarking: To verify if answers are supported by retrieved context (Faithfulness).
- Regression Testing: Ensuring that a prompt change or model upgrade doesn't break existing behavior.
- Synthetic Benchmarking: Creating evaluation sets when manual gold-standard data is unavailable.
Decision Tree
- Do you want to check for hallucinations?
- YES: Run a Faithfulness metric.
- Is the retrieved context actually useful for the question?
- YES: Run a Retrieval Relevance metric.
- Do you need to scale evaluation without manual labeling?
- YES: Use Synthetic Data Generation.
Workflows
1. Evaluating RAG Faithfulness
- Capture the
query, theretrieved_context, and theactual_outputfrom the system. - Run a Faithfulness metric (from Ragas or LlamaIndex) which uses an LLM to verify if the output claims are supported by the context.
- If the score is low, investigate whether the context was irrelevant or the model hallucinated.
2. Unit Testing LLM Outputs (DeepEval)
- Install
deepevaland create a test filetest_example.py. - Define an
LLMTestCasewith input, actual_output, and expected_output. - Apply a
GEvalmetric with a customcriteria(e.g., 'professionalism'). - Run
deepeval test runto assert that the score meets the defined threshold.
3. Automated Question Generation
- Point the evaluation framework (e.g., LlamaIndex) at a set of source documents.
- Use the
QuestionGenerationmodule to synthetically create test cases (question-context pairs). - Run the RAG pipeline against these generated questions to benchmark performance across the entire dataset.
Non-Obvious Insights
- LLM-as-a-Judge: A stronger model (GPT-4o) can effectively grade a smaller/faster model (Llama 3) with human-like accuracy using research-backed metrics like GEval.
- Separation of Concerns: Good evaluation splits into 'Response' (was the answer good?) and 'Retrieval' (did we find the right docs?). Fixing one doesn't always fix the other.
- Synthetic Scaling: Manual evaluation doesn't scale; using an LLM to generate 1000 edge cases from your data is the only way to reach high production confidence.
Evidence
- "Faithfulness: Evaluates if the answer is faithful to the retrieved contexts (in other words, whether if there’s hallucination)." - LlamaIndex
- "GEval is a research-backed metric... for you to evaluate your LLM output's on any custom metric with human-like accuracy." - DeepEval
- "Traditional evaluation metrics don't capture what matters for LLM applications." - Ragas
Scripts
scripts/eval-frameworks_tool.py: Script defining a Faithfulness evaluation loop.scripts/eval-frameworks_tool.js: Node.js simulation for calculating relevance scores.
Dependencies
ragasdeepevalllama-index
References
- references/README.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?