Skip to content

feat(rag): autonomous rag index drift detection and auto-reindexing scheduler #81

Closed

Description

@dan-petty

Problem or Motivation

As git branches evolve, the Qdrant vector index can become stale or drift from active files, degrading retrieval relevance without clear operator visibility.

Proposed Solution & Architectural Design

  • Implement devops ai rag drift [OPTIONS] comparing vector metadata timestamps and git commit hashes against the working tree.
  • Provide auto-reindexing option (--auto-sync) to incrementally embed modified or new files.
  • Track drift metrics in Prometheus counters and OTel spans.

Acceptance Criteria

  • Stale vector detection based on git mtime and commit hash.
  • Incremental re-indexing of modified files.
  • Unit tests in tests/test_rag_drift.py pass with >= 90% coverage.

Activity

  1. added this to the v0.2.14 milestone on Sep 9, 2026
  2. added
    type/feature
    scope/ai
    priority/p2-medium
    on Sep 9, 2026
  3. added a commit that references this issue on Sep 9, 2026
    c273463
  4. dan-petty commented on Sep 9, 2026

    @dan-petty
    OwnerAuthor

    Implemented in commit c273463.

    Implementation Summary

    • Added RAGDriftDetector and RAGDriftReport in src/devops_cli/ai/rag/drift.py comparing working tree file hashes and git commit HEAD divergence against the vector index cache.
    • Tracks stale modified files (hash divergence), new unindexed files, and deleted files with normalized drift scoring (1.$).
    • Integrated OpenTelemetry distributed tracing (rag.drift_detection) and Prometheus metrics (devops_cli_rag_drift_detected_total, devops_cli_rag_drift_score).
    • Added CLI command devops ai rag drift [path] [--auto-sync] [--fail-on-drift] [--json].
    • Registered FastMCP tool rag_drift(path, auto_sync) and exported 117 FastMCP tool schemas.
    • Verified with 9 unit tests in tests/test_rag_drift.py and FastMCP contract test in tests/test_fastmcp_contracts.py.
    • All 10/10 quality gates passed cleanly in devops ci.
  5. added a commit that references this issue on Sep 10, 2026
    ee87b4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p2-mediumscope/aitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions