continuous-evaluation
CI/CD for RAG quality: golden dataset fixtures, RAGAS/DeepEval in pytest, regression thresholds, GitHub Actions workflows, merge-blocking gates, weekly scheduled eval, LangSmith/Langfuse in CI. USE WHEN: user mentions "RAG CI", "eval in CI", "regression gate", "golden dataset fixture", "PR quality check", "scheduled RAG evaluation", "LangSmith CI", "Langfuse CI" DO NOT USE FOR: RAGAS metric internals - use `rag-evaluation`; ARES - use `ares-framework`; Giskard internals - use `giskard-rag`; shadow deploys - use `shadow-mode-deployment`
What this skill does
# Continuous RAG Evaluation
## Three Layers of Cadence
| Layer | When | Budget | Purpose |
|---|---|---|---|
| PR gate | Every pull request | <5 min, $0-$5 | Block obvious regressions |
| Nightly | Daily scheduled | 20-60 min, $10-$50 | Full gold set + trend reporting |
| Weekly | Weekly scheduled | Hours, $50-$300 | Refresh testset, sample live traffic |
Missing any of these layers leaves a gap. PR gate without nightly misses slow
drift; nightly without PR gate lets bad PRs land.
## Golden Dataset as a Fixture
```python
# tests/fixtures/gold.py
import json, functools
@functools.lru_cache(maxsize=1)
def load_gold():
with open("tests/fixtures/gold.jsonl") as f:
return [json.loads(l) for l in f]
# tests/fixtures/gold.jsonl is git-tracked
```
```json
{"id":"g001","question":"How do I rotate an API key?","expected":"Settings > API Keys > Rotate","relevant_doc_ids":["kb-042","kb-110"],"category":"procedural","difficulty":"easy"}
{"id":"g002","question":"Which SSO providers are supported?","expected":"Okta, Google Workspace, Microsoft Entra","relevant_doc_ids":["kb-200"],"category":"factual","difficulty":"easy"}
```
Rules:
- Keep 100-300 records minimum.
- Stratify across category, difficulty, persona.
- Version with git; never mutate without a PR.
- Add one failing production query each week.
## PR Gate with DeepEval + Pytest
```python
# tests/test_rag_pr_gate.py
import pytest
from deepeval import assert_test
from deepeval.test_case import LLMTestCase
from deepeval.metrics import (
FaithfulnessMetric, AnswerRelevancyMetric,
ContextualPrecisionMetric, ContextualRecallMetric,
)
from fixtures.gold import load_gold
from rag_pipeline import answer
# Fast subset: only `difficulty == easy` runs on PR
GOLD_PR = [g for g in load_gold() if g["difficulty"] == "easy"][:30]
@pytest.mark.parametrize("gold", GOLD_PR, ids=lambda g: g["id"])
def test_pr_gate(gold):
result = answer(gold["question"])
tc = LLMTestCase(
input=gold["question"],
actual_output=result.answer,
expected_output=gold["expected"],
retrieval_context=result.contexts,
)
assert_test(tc, [
FaithfulnessMetric(threshold=0.80),
AnswerRelevancyMetric(threshold=0.80),
ContextualPrecisionMetric(threshold=0.70),
ContextualRecallMetric(threshold=0.75),
])
```
Run: `pytest tests/test_rag_pr_gate.py -n 4 --maxfail=3`.
## Nightly RAGAS Eval
```python
# eval/nightly.py
from datasets import Dataset
from ragas import evaluate
from ragas.metrics import (faithfulness, answer_relevancy,
context_precision, context_recall, answer_correctness)
from rag_pipeline import answer
from fixtures.gold import load_gold
import json, os, time
rows = []
for g in load_gold():
r = answer(g["question"])
rows.append({
"user_input": g["question"],
"retrieved_contexts": r.contexts,
"response": r.answer,
"reference": g["expected"],
})
ds = Dataset.from_list(rows)
result = evaluate(ds, metrics=[faithfulness, answer_relevancy,
context_precision, context_recall,
answer_correctness])
df = result.to_pandas()
summary = {
"timestamp": int(time.time()),
"commit_sha": os.environ.get("GITHUB_SHA", "local"),
"metrics": {c: float(df[c].mean()) for c in df.select_dtypes("number").columns},
}
with open("eval/history.jsonl", "a") as f:
f.write(json.dumps(summary) + "\n")
# Regression check vs baseline
with open("eval/baseline.json") as f:
baseline = json.load(f)
for metric, value in summary["metrics"].items():
base = baseline.get(metric, 0.0)
if value < base - 0.03:
raise SystemExit(f"REGRESSION: {metric} {value:.3f} < baseline {base:.3f} - 0.03")
```
## GitHub Actions Workflow
```yaml
# .github/workflows/rag-eval.yml
name: RAG Evaluation
on:
pull_request:
paths:
- "src/rag/**"
- "prompts/**"
- "configs/retriever.yaml"
- "tests/fixtures/gold.jsonl"
schedule:
- cron: "0 3 * * *" # nightly 03:00 UTC
jobs:
pr-gate:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: "3.12"}
- run: pip install -r requirements-eval.txt
- run: pytest tests/test_rag_pr_gate.py -n 4 --maxfail=3 --junitxml=gate.xml
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: pr-gate-report
path: gate.xml
nightly:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: "3.12"}
- run: pip install -r requirements-eval.txt
- run: python eval/nightly.py
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- name: Commit history
run: |
git config user.name "rag-bot"
git config user.email "[email protected]"
git add eval/history.jsonl
git commit -m "chore(eval): nightly $(date -u +%F)" || exit 0
git push
```
## Branch Protection
Required checks to enable on `main`:
- `pr-gate` workflow success.
- At least one human review.
- Status from Langfuse / LangSmith eval run if using a managed platform.
## Baseline Management
Baseline drifts — monthly refresh:
```python
# eval/refresh_baseline.py
import json, statistics
with open("eval/history.jsonl") as f:
recent = [json.loads(l) for l in f.readlines()[-30:]]
baseline = {}
for m in recent[0]["metrics"]:
values = [r["metrics"][m] for r in recent]
baseline[m] = statistics.median(values)
with open("eval/baseline.json", "w") as f:
json.dump(baseline, f, indent=2)
```
Commit the refreshed baseline via PR, with a description of why it moved.
## Hermetic CI Considerations
- Pin model versions (`claude-sonnet-4-5-20250929`, `gpt-4o-mini-2024-07-18`).
- Use deterministic temperature (0) for judges.
- Cache embeddings for the gold set to avoid re-encoding in every run.
- Mock external data sources; rely only on the committed KB snapshot.
```python
# conftest.py
import pytest
@pytest.fixture(scope="session")
def frozen_kb():
from rag_pipeline import load_kb
return load_kb(snapshot="2026-04-01") # immutable snapshot
```
## LangSmith / Langfuse in CI
```python
# LangSmith
from langsmith import Client
from langsmith.evaluation import evaluate as ls_evaluate
client = Client()
experiment = ls_evaluate(
lambda inputs: answer(inputs["question"]).answer,
data="gold-v3",
evaluators=[faithfulness_evaluator, relevance_evaluator],
experiment_prefix=f"ci-{os.environ['GITHUB_SHA'][:7]}",
)
url = experiment.experiment_url
print(f"::notice::LangSmith run {url}")
```
```python
# Langfuse
from langfuse.decorators import observe
from langfuse import Langfuse
lf = Langfuse()
dataset = lf.get_dataset("gold-v3")
run_name = f"ci-{os.environ['GITHUB_SHA'][:7]}"
for item in dataset.items:
with item.observe(run_name=run_name) as trace_id:
r = answer(item.input["question"])
lf.score(trace_id=trace_id, name="faithfulness",
value=compute_faithfulness(r, item.expected_output))
```
## Regression Policy
Tiered thresholds:
| Metric | Warn | Block PR |
|---|---|---|
| Faithfulness | -1pp | -3pp |
| Answer relevancy | -1pp | -3pp |
| Context recall | -2pp | -5pp |
| Answer correctness | -2pp | -5pp |
Blocking thresholds are intentionally loose early; tighten as your baseline
stabilizes.
## Sampling Live Traffic Weekly
```python
# Sunday 02:00 — sample last week of prod logs
from rag_pipeline.telemetry import saRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.