Webhook icon
Schedule icon
Log icon
Commands icon
Docker icon
If icon
SlackIncomingWebhook icon
Fail icon

Continuous GenAI Evaluation and Hallucination Regression Gate with DeepEval

Automate LLM evaluation and hallucination regression testing with DeepEval in Kestra. Gate prompt releases and send Slack scorecards.

Categories
AIInfrastructure

Automate continuous evaluation, hallucination detection, and deployment regression gates for production LLM and RAG pipelines using DeepEval in Kestra.

What it does

In production Generative AI applications, promoting updated system prompts, fine-tuned models, or retrieval hyperparameters without systematic testing causes silent regressions: hallucinations, evasive answers, and context drift.

This blueprint implements an automated CI/CD and nightly evaluation gate that:

  1. Trigger on CI/CD or Schedule: Executes on demand via an authenticated Webhook when a new prompt or model version is tagged in Git, or on a recurring nightly Schedule.
  2. Benchmark Test Execution: Runs an automated DeepEval evaluation suite inside an isolated Docker container against golden reference datasets.
  3. Multi-Metric Scoring: Evaluates critical production metrics:
    • Faithfulness: Verifies that the model output is strictly grounded in the retrieved context without hallucinating ungrounded facts.
    • Answer Relevancy: Verifies that the response directly addresses the user query.
    • Hallucination Rate: Identifies ungrounded claims across test batches.
  4. Automated Quality Gate (If): Evaluates aggregate scores against user-defined Service Level Objectives (SLOs).
    • If targets are met, logs qualification and dispatches a scorecard to Slack.
    • If regressions are detected, quarantines the release and optionally fails the execution to halt downstream deployment pipelines.
  5. Team Telemetry: Sends structured Block Kit scorecards directly to Slack.

How it works

  1. Ingestion Triggers:
    • inbound_ci_eval_webhook (io.kestra.plugin.core.trigger.Webhook): Initiates evaluation runs automatically from GitHub Actions, GitLab CI, or Jenkins.
    • scheduled_nightly_regression_gate (io.kestra.plugin.core.trigger.Schedule): Runs nightly at 02:00 UTC to guard against model API drift.
  2. Test Suite Runner (execute_deepeval_suite):
    • Dispatches an isolated python:3.11-slim container using Kestra's Docker runner.
    • Evaluates golden test cases against faithfulness and relevancy criteria.
    • Emits metric averages and pass/fail state to Kestra outputs via the Kestra Python SDK.
  3. Quality Gate (evaluate_quality_gate):
    • Compares results against min_faithfulness_score, min_answer_relevancy_score, and max_hallucination_rate.
    • Routes execution to qualification or quarantine branches.
    • Enforces the fail_on_breach gate using io.kestra.plugin.core.execution.Fail.

What you get

  • Automated, reproducible quality gates protecting production LLM applications.
  • Zero manual evaluation effort for prompt and model upgrades.
  • Containerized Docker execution ensuring consistent Python dependencies.
  • Rich Slack scorecard notifications for engineering teams.

Who it's for

  • MLOps and AI Engineers managing production LLM and RAG pipelines.
  • Platform Engineers building CI/CD guardrails for Generative AI applications.
  • Product teams requiring verifiable accuracy before promoting model releases.

Why orchestrate this with Kestra

Kestra provides native Docker containerization, webhook triggers, conditional execution branching, execution failure gating, and secret management out of the box, making it the ideal orchestrator for continuous AI evaluation gates.

Prerequisites

  • Docker daemon accessible to Kestra.
  • Slack Incoming Webhook configured in Kestra secrets (if Slack notifications are enabled).

Secrets

  • DEEPEVAL_WEBHOOK_KEY: Secret authentication key for inbound webhook triggering.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for evaluation scorecards.

Inputs

Name Type Default Description
eval_run_name STRING v2.4.0-prompt-release Identifier or Git tag for the evaluation run.
model_name STRING gemini-2.5-flash Target model under evaluation.
min_faithfulness_score FLOAT 0.85 Minimum required faithfulness score (0.0 - 1.0).
min_answer_relevancy_score FLOAT 0.80 Minimum required answer relevancy score (0.0 - 1.0).
max_hallucination_rate FLOAT 0.05 Maximum allowable hallucination rate (0.0 - 1.0).
fail_on_breach BOOL true Whether to fail execution on metric breach.

Quick start runbook

  1. Configure secrets DEEPEVAL_WEBHOOK_KEY and SLACK_WEBHOOK_URL in your Kestra namespace.
  2. Trigger the flow manually from the Kestra UI to witness automated evaluation and Slack reporting.
  3. Connect your CI/CD pipeline to post to the inbound_ci_eval_webhook endpoint on every prompt pull request.

How to extend

  • Connect Langfuse, Arize Phoenix, or Comet Opik to push evaluation traces to external observabilities.
  • Add custom G-Eval criteria for domain-specific tone, compliance, or brand voice.
  • Pair with vector databases (Qdrant, Pinecone, pgvector) to dynamically evaluate retrieval chunks.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.