Skip to main content

Regression tests and explainable release gates for RAG and AI agents

Project description

RAGOps

Regression tests and explainable release gates for RAG and AI agents.

PyPI Python 3.11+ License: MIT

RAGOps answers one release question: after changing a prompt, retriever, embedding model, dataset, or evaluator, is the candidate still good enough to ship?

It compares recorded candidate behavior with an accepted baseline, applies a versioned policy, and returns an explainable PASS or BLOCK. The core is dependency-free, offline, and provider-independent.

Open the product showcase →

Five-minute proof

python -m venv .venv
source .venv/bin/activate
pip install ragops==1.0.0
ragops demo --output ragops-demo

Open ragops-demo/release-report.html. The accepted baseline passes; the intentionally regressed candidate is blocked with named reasons. The generated bundle contains portable JSON, Markdown, and standalone HTML evidence and needs no model API or hosted service.

Try the other credential-free scenarios:

ragops demo --scenario support-triage --output support-triage-demo
ragops demo --scenario proposal-review --output proposal-review-demo

Release workflow

RAGOps workflow: record portable evidence, evaluate it against versioned checks, compare candidate with baseline, then return an explainable pass or block decision

  1. Record responses or traces from the application you already operate.
  2. Evaluate quality, safety, operational budgets, and optional external metrics against a versioned scenario and policy.
  3. Compare the candidate with an accepted baseline using explicit tolerances or uncertainty-aware repeated-run bounds.
  4. Gate the release with named reasons and case-level evidence.

RAGOps evaluates your system. It does not replace LangChain, LlamaIndex, your model, retriever, observability stack, or application.

What the core provides

  • Citation coverage and precision, lexical groundedness, retrieval, latency, cost, answer-length, and red-team checks.
  • Baseline-aware regression comparison with critical findings that fail closed.
  • Fixed and predeclared sequential statistical gates for repeated metric observations, plus evaluator-drift and provenance diagnostics.
  • Content-addressed accepted-baseline manifests with optional offline SSH signature verification.
  • JSON, Markdown, and standalone HTML reports for local review and CI.
  • Portable scenarios, response fixtures, JSONL traces, policies, and schemas.
  • A Python API, CLI, evaluator plugins, and optional adapters outside the core.
  • A provider-neutral envelope for scores exported by Ragas, DeepEval, Langfuse, or internal judges.

Recorded evidence

The included Japanese troubleshooting reference deployment compares an ACL-first, graph-assisted baseline with a lexical-only candidate under the same four questions and release contract.

Recorded metric Graph + ACL Lexical only Delta
Citation coverage 100% 75% −25.00%
Citation precision 100% 75% −25.00%
Lexical groundedness 100% 78.12% −21.88%
Release decision Pass Block Hold release

The separate 30-case synthetic benchmark covers nine failure families, including stale evidence, permission leakage, prompt injection, abstention, and consequential actions.

RAGOps evidence stack: quality, safety, operational budgets, and regression comparison support one release decision

These fixtures validate the harness and the recorded architecture comparison. They do not establish Japanese semantic quality, production security, customer adoption, or ROI.

Evaluate your own evidence

Requires Python 3.11 or newer.

python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev,api]'

ragops evaluate \
  --scenario scenarios/japanese_troubleshooting/benchmark-v0.2.json \
  --responses scenarios/japanese_troubleshooting/benchmark-baseline.json \
  --evaluator citation_correctness \
  --evaluator claim_support

Compare a candidate with a baseline:

ragops compare \
  --scenario path/to/scenario.json \
  --baseline path/to/baseline.json \
  --candidate path/to/candidate.json \
  --evaluation-policy path/to/evaluation-policy.toml \
  --format html \
  --output release-report.html
  • Exit 0: evaluation completed and the candidate passes.
  • Exit 2: evaluation completed and policy blocks the candidate.
  • Any other non-zero exit: invalid input, configuration, or contract.

Use --traces instead of --responses when your application exports portable JSONL trace 0.4 records. Imported provider metrics keep the meaning defined by their producer and your reviewed policy.

For repeated metric observations:

ragops compare-runs \
  --baseline-bundle scenarios/statistical_gate/baseline.json \
  --candidate-bundle scenarios/statistical_gate/candidate-pass.json \
  --policy scenarios/statistical_gate/policy.toml

The statistical path remains opt-in; deterministic evaluation contracts are unchanged. See the evaluation strategy for sampling units, sequential error control, drift isolation, and limitations.

Architecture

%%{init: {"theme":"base","fontFamily":"system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif","flowchart":{"curve":"basis","htmlLabels":true},"themeVariables":{"background":"#f8f6f0","primaryColor":"#ffdc7c","primaryTextColor":"#17152f","primaryBorderColor":"#17152f","secondaryColor":"#bfe8ff","tertiaryColor":"#d8ceff","lineColor":"#756f84","edgeLabelBackground":"#fffef9","clusterBkg":"#fffef9","clusterBorder":"#b9b4aa"}}}%%
flowchart LR
    APP["RAG / AI agent<br/>existing application"]
    TRACE["Portable evidence<br/>responses · traces · metrics"]

    subgraph CORE["LOCAL OPEN-SOURCE CORE"]
        LOAD["Load<br/>scenario · policy"]
        CHECK["Evaluate<br/>checks · findings"]
        COMPARE["Compare<br/>baseline · candidate"]
        REPORT["Evidence<br/>JSON · Markdown · HTML"]
        LOAD --> CHECK --> COMPARE --> REPORT
    end

    GATE{"Release gate"}
    PASS["PASS<br/>continue"]
    BLOCK["BLOCK<br/>fix and re-run"]
    REVIEW["Engineer · CI · pull request"]

    APP -->|records| TRACE --> LOAD
    REPORT --> GATE
    GATE -->|meets policy| PASS
    GATE -->|named gates fail| BLOCK
    REPORT --> REVIEW

    classDef source fill:#bfe8ff,stroke:#17152f,color:#17152f,stroke-width:2px;
    classDef core fill:#ffdc7c,stroke:#17152f,color:#17152f,stroke-width:2px;
    classDef report fill:#d8ceff,stroke:#17152f,color:#17152f,stroke-width:2px;
    classDef pass fill:#aee8c9,stroke:#17152f,color:#17152f,stroke-width:2px;
    classDef block fill:#ffc0dd,stroke:#17152f,color:#8d2037,stroke-width:2px;

    class APP,TRACE source;
    class LOAD,CHECK,COMPARE core;
    class REPORT,GATE,REVIEW report;
    class PASS pass;
    class BLOCK block;
src/ragops/    Dependency-free evaluation core
apps/          Optional API and browser adapters
scenarios/     Portable fixtures, policies, and expected evidence
examples/      Reference deployments outside the core
schemas/       Public JSON Schema contracts
docs/          Current guides and immutable project records

Solid arrows are the required offline path. Optional providers, external evaluators, and hosted integrations remain adapters; the core can make a complete release decision without them.

Product boundary

RAGOps provides RAGOps does not claim
Local, repeatable release evidence Semantic correctness from lexical overlap
Portable scenarios, traces, and reports Proof of production security or compliance
Baseline-aware regression gates Customer adoption or business ROI
Extensible deterministic evaluators A production multi-tenant hosted service

The reference ACL is a role-list simulation. The local control plane is a single-workspace development surface. Consequential actions still require human approval.

Documentation

Git history and the changelog preserve released evolution. Repository HEAD keeps one current source per topic so milestone snapshots are not mistaken for active requirements.

License

MIT. See LICENSE. Previously published Apache-2.0 releases retain their original license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragops-1.0.0.tar.gz (312.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragops-1.0.0-py3-none-any.whl (62.3 kB view details)

Uploaded Python 3

File details

Details for the file ragops-1.0.0.tar.gz.

File metadata

  • Download URL: ragops-1.0.0.tar.gz
  • Upload date:
  • Size: 312.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragops-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1d6ac31e29f2e3688dd9b7f6a56790548a342706199fa2ec22bae1ff93988257
MD5 4440f2b853c9281ee9777fe353c234bb
BLAKE2b-256 d610da5d47f844b84dbfb70f016b7b2c170abc5ff56153c444c3d25b425b6d74

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragops-1.0.0.tar.gz:

Publisher: publish-pypi.yml on thangldw/ragops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ragops-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ragops-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 62.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ragops-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 148de9215e7dd2a411f3b980a0eb3bed4e87e93a2d5a41b02c3d7a0bd8e1423e
MD5 e610a79bc2fae5e6cc774fb7e9bb200a
BLAKE2b-256 e92795fdaf3ed9bb63a254a66a6b89b7cb664d18b9383ad630241ae04b419c6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ragops-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on thangldw/ragops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page