Phase 1.1 Evaluation Framework - Progress Report
Tracks progress building a 100-question golden set and running RAGAS benchmarks for a Buddhist sutra Q&A system.
What this file does
Tracks progress building a 100-question golden set and running RAGAS benchmarks for a Buddhist sutra Q&A system.
When to use it
- You need a progress template for a multi-phase evaluation pipeline
- You are generating a golden test set with LLM and want rate-limit handling patterns
- You want to document baseline vs. reranker RAG performance targets
Assumes this stack
Phase 1.1 Evaluation Framework - Progress Report
Date: 2025-11-08 Status: π‘ In Progress
Completed Tasks β
1. Evaluation Directory Structure
Created complete evaluation framework at opennotebook/evaluation/:
evaluation/
βββ README.md # Complete usage documentation
βββ requirements.txt # Python dependencies
βββ PROGRESS.md # This file
βββ golden_set.json # Generated Q&A dataset (in progress)
βββ golden_set_builder.py # Gemini-based Q&A generator
βββ ragas_evaluator.py # RAGAS metrics implementation
βββ trulens_monitor.py # TruLens RAG Triad monitor
βββ benchmark_suite.py # End-to-end benchmark runner
βββ evaluation_results/ # Output directory (created on first run)
2. Dependencies Installed
β
ragas>=0.1.0
β
datasets>=2.14.0
β
requests>=2.31.0
β
loguru>=0.7.0
Note: TruLens is optional (requires OPENAI_API_KEY for evaluation)
3. Golden Set Generation (In Progress)
Script: golden_set_builder.py
Target: 100 Q&A pairs from diverse sutras
Current Status: ~20/100 questions generated (4 sutras)
Features:
- Uses Gemini 2.0 Flash Experimental for high-quality generation
- Generates 5 questions per sutra across 3 categories:
- Factual (μ¬μ€): Direct content questions
- Interpretive (ν΄μ): Meaning and interpretation
- Practical (μ€μ²): Practice and application
- Auto-checkpoint saves progress after each sutra
- Handles rate limits gracefully
- Estimated completion time: ~5-10 minutes total
Rate Limit Handling: The script is encountering 429 errors from Gemini API (quota: 300 req/min). This is expected and handled by:
- 1.5 second delay between requests
- Continuing with other sutras on failure
- Auto-saving progress
- Will complete as quota resets
Next Steps π
Phase 1.1 Remaining
-
β³ Complete Golden Set (ETA: ~10 minutes)
- Wait for builder to finish 100 Q&A pairs
- Verify quality and distribution
-
π Run Baseline Benchmark
- Ensure RAG server is running
- Execute
benchmark_suite.py - Measure current system performance:
- Context Precision (retrieval accuracy)
- Context Recall (retrieval completeness)
- Faithfulness (hallucination detection)
- Answer Relevancy (response quality)
Phase 1.2 - Reranker Integration
After baseline is established:
- Install
ms-marco-MiniLM-L-12-v2reranker - Integrate with LangChain
ContextualCompressionRetriever - Re-run benchmark with
experiment_name="with_reranker" - Compare improvements
Phase 1.3 - Anti-Hallucination Prompt
- Strengthen prompt with explicit groundedness instructions
- Add "don't guess" guardrails
- Measure Faithfulness improvement
System Architecture
Current RAG Pipeline (Baseline)
User Query
β
Vector Search (ChromaDB)
ββ Embedding: bert-ancient-chinese-finetuned
ββ Collection: cbeta_sutras_finetuned (99,723 docs)
ββ Retrieval: top_k=10 (or 20 with sutra filter)
β
LLM Generation (Gemini 2.0 Flash)
β
Answer + Sources
Phase 1.2 Target Architecture (With Reranker)
User Query
β
Vector Search (ChromaDB) β top_k=20
β
Reranker (MiniLM-L-12-v2) β top_k=10
ββ Filters irrelevant contexts
ββ Improves precision
β
LLM Generation
β
Answer + Sources (higher quality)
Evaluation Methodology
RAGAS Metrics
Each metric scored 0-1 (higher is better):
-
Context Precision: Retrieved contexts relevance to question
- Baseline target: 0.60
- Phase 1 goal: 0.75 (+25%)
-
Context Recall: Ground truth coverage in contexts
- Baseline target: 0.65
- Phase 1 goal: 0.80 (+23%)
-
Faithfulness: Answer grounding in contexts (anti-hallucination)
- Baseline target: 0.80
- Phase 1 goal: 0.90 (+12%)
-
Answer Relevancy: Answer relevance to question
- Baseline target: 0.70
- Phase 1 goal: 0.85 (+21%)
Benchmark Process
- Load golden set (100 Q&A pairs)
- Query RAG system for each question
- Extract answer + retrieved contexts
- Compare with ground truth
- Calculate RAGAS metrics
- Save results to
evaluation_results/
Usage Commands
Check Golden Set Progress
cd evaluation
tail -f ../source_explorer/source_data/golden_set_builder.log
# Or check the file directly:
wc -l golden_set.json
Run Baseline Benchmark (After Golden Set Complete)
# Terminal 1: Ensure server is running
cd /Users/vairocana/Desktop/buddhakorea/buddha-korea-notebook-exp/opennotebook
python main.py
# Terminal 2: Run benchmark
cd evaluation
python benchmark_suite.py
View Results
cd evaluation_results
ls -lt # List results by modification time
cat benchmark_baseline_v1_*.json | jq '.ragas_scores'
Success Criteria for Phase 1.1
- β Evaluation framework created
- β Dependencies installed
- β³ Golden set with 100 Q&A pairs
- β³ Baseline benchmark completed
- β³ All 4 RAGAS metrics measured
- β³ Results saved and documented
Overall Phase 1.1 Completion: ~70%
Known Issues
Rate Limiting (429 Errors)
Impact: Slower golden set generation Workaround: Script auto-retries and continues with other sutras Solution: None needed - will resolve automatically
TruLens Optional
Impact: TruLens monitoring requires OPENAI_API_KEY
Workaround: Use RAGAS only for now
Solution: Set export OPENAI_API_KEY=xxx if you want TruLens dashboard
Files Created (Phase 1.1)
| File | Lines | Purpose |
|---|---|---|
golden_set_builder.py | 270 | Generate Q&A from CBETA summaries |
ragas_evaluator.py | 170 | RAGAS evaluation implementation |
trulens_monitor.py | 180 | TruLens monitoring (optional) |
benchmark_suite.py | 300 | End-to-end benchmark orchestration |
README.md | 250 | Complete usage documentation |
requirements.txt | 10 | Python dependencies |
golden_set.json | - | Generated Q&A dataset |
Total New Code: ~1,200 lines Total Documentation: ~500 lines
Updated: 2025-11-08 14:55 KST Next Update: After golden set completion
What's inside
6 sections covering completed tasks, next steps, architecture diagrams, evaluation methodology, usage commands, and success criteria.
Change this for your project
- Replace
opennotebook/evaluation/with your own evaluation directory path - Replace
ltk1186/buddhakoreawith your repository name - Replace
/Users/vairocana/Desktop/buddhakorea/buddha-korea-notebook-exp/opennotebookwith your project root - Replace
cbeta_sutras_finetunedwith your own ChromaDB collection name
Where it goes
Keep alongside your test suite. Used to define and score model evaluations.
Worth borrowing
- Auto-checkpoint golden set generation after each sutra to survive rate limits
- Define explicit baseline targets and improvement goals for each RAGAS metric before running experiments
Related Documents
IATA BCBP Standard Compliance
Documents which IATA BCBP fields and barcode formats a Swift library implements, including Version 8 gender code support.
Evaluating AI Agent Systems: Metrics, Benchmarks, and Quality Assurance (2024-2026)
Surveys 2024-2026 metrics, benchmarks, and monitoring tools for evaluating AI agent systems, with recommendations for a self-improving coding agent.
Voice AI Leaderboards, Benchmarks, and Evaluation Gaps (Jan 2025 -- Feb 2026)
Surveys 20+ voice AI benchmarks from Jan 2025, Feb 2026, identifies evaluation gaps, and provides leaderboard data for STT, TTS, and end-to-end voice agents.
LLM Evaluation β Deep Dive
Covers why LLM evaluation is hard, benchmark taxonomy, LLM-as-judge methodology, contamination, robustness, and designing an eval suite for a product.