Skip to main content

The CI/CD Pipeline for RAG - Detect semantic conflicts before they become hallucinations

Project description

ChunkOps CLI

The CI/CD Pipeline for RAG. Detect conflicts before they become hallucinations.

Installation

pip install chunkops

Quick Start

1. Initialize ChunkOps

chunkops init

This creates a chunkops.yaml config file in your project root.

2. Scan Your Documents

chunkops scan

Level 1 (Free): Detects exact duplicates and empty files
Level 2 (Cloud): Semantic conflict detection (requires authentication)

3. Enable Cloud Features

chunkops login

Opens browser for authentication. Enables semantic conflict detection.

4. Add to CI/CD

Add to your .github/workflows/rag-test.yml:

- name: Run ChunkOps CI Check
  run: chunkops ci
  env:
    CHUNKOPS_API_KEY: ${{ secrets.CHUNKOPS_API_KEY }}

Commands

chunkops init

Initialize ChunkOps in your project. Creates chunkops.yaml config file.

chunkops init --docs-path ./data --output-path ./reports

chunkops scan

Scan documents for duplicates and conflicts.

chunkops scan                    # Use config defaults
chunkops scan ./docs            # Scan specific directory
chunkops scan -o report.json    # Custom output file
chunkops scan --verbose         # Verbose output

Output:

  • ✅ Valid chunks count
  • ⚠️ Exact duplicates (with estimated space saved)
  • 🟡 Near duplicates
  • 🚨 Semantic conflicts (requires authentication)

chunkops login / chunkops auth

Authenticate with ChunkOps Cloud to enable semantic conflict detection.

chunkops login                  # Opens browser
chunkops auth --api-key chk_... # Use API key directly

chunkops ci

CI/CD mode: Runs silently, outputs JSON, exits with error code on failures.

chunkops ci                     # Use config defaults
chunkops ci ./docs              # Scan specific directory
chunkops ci --no-fail-on-critical  # Don't exit on critical conflicts

Exit Codes:

  • 0: No critical conflicts
  • 1: Critical conflicts detected (blocks PR merge)

Configuration

The chunkops.yaml file:

docs_path: ./data
output_path: ./chunkops-reports
exact_threshold: 1.0
near_threshold: 0.90
enable_cloud: false
api_url: https://console.chunkops.ai

CI/CD Integration

GitHub Actions

name: RAG Quality Check

on:
  pull_request:
    paths:
      - 'docs/**'
      - 'data/**'

jobs:
  chunkops-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - run: pip install chunkops
      - run: chunkops ci
        env:
          CHUNKOPS_API_KEY: ${{ secrets.CHUNKOPS_API_KEY }}

GitLab CI

chunkops-check:
  image: python:3.11
  script:
    - pip install chunkops
    - chunkops ci
  variables:
    CHUNKOPS_API_KEY: $CHUNKOPS_API_KEY

Output Format

Interactive Mode (chunkops scan)

Beautiful terminal output with colors, progress bars, and summary tables.

CI Mode (chunkops ci)

JSON output only:

{
  "scan_date": "2024-01-15T10:30:00Z",
  "total_files": 14,
  "total_chunks": 245,
  "exact_duplicates": 2,
  "near_duplicates": 5,
  "semantic_conflicts": 3,
  "critical_conflicts": 1,
  "summary": {
    "valid_chunks": 240,
    "exact_duplicates": 2,
    "near_duplicates": 5,
    "conflicts": 3
  }
}

The Two-Tier Model

Level 1 (Free/Local):

  • Exact duplicate detection (MD5 hash)
  • Empty file detection
  • Fast, runs entirely locally

Level 2 (Cloud/Upsell):

  • Semantic conflict detection
  • Policy contradiction detection
  • Requires authentication (chunkops login)

License

MIT

Support

Visit chunkops.ai for more information.

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

chunkops-0.3.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

chunkops-0.3.0-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file chunkops-0.3.0.tar.gz.

File metadata

  • Download URL: chunkops-0.3.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for chunkops-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4986457c7d9f76337f966c0e52b63aaaea8451c21060ef73b83733f293523120
MD5 c94c04df0b4c3e2ad4091cf754822fa9
BLAKE2b-256 eedb54ba02e1b6223641c718b384d424083403af13786b85e2cae94f4b63f585

See more details on using hashes here.

File details

Details for the file chunkops-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: chunkops-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for chunkops-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6b0a86d22c19cd91ef2029cce5a6a5d074eec87ed255777ef7b39612cfc5140
MD5 86f3702694dd6379f98a08afbb319e3f
BLAKE2b-256 97c281a5f284c27930baa418be0c3b1507ac0ceda4cb4807799cb2c44fba9e01

See more details on using hashes here.

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