thangldw/ragops

GitHub: thangldw/ragops

一款为零依赖本地环境设计的 RAG 与 Agent 系统评估工具,通过版本化检查和基线对比提供发布门禁决策。

Stars: 0 | Forks: 0

# RAGOps **针对 RAG 和 agent 系统的评估与红队发布门禁。** [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/ad/ad5834178f7599af9fdda11629d49cae07f2997beec49821b2920eff5bfd50e7.svg)](https://github.com/thangldw/ragops/actions/workflows/ci.yml) [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-3776AB)](pyproject.toml) [![License: MIT](https://img.shields.io/badge/License-MIT-5DA2FF.svg)](LICENSE) RAGOps 将 AI 质量要求转化为版本化的场景、可重复的 检查、机器可读的报告,以及有理有据的发布决策。无 依赖的核心在本地运行;provider 和托管集成仍保持为 可选。

RAGOps product screen showing a recorded blocked regression and local release evidence

产品展示 · 参考部署 · 基准测试证据

## RAGOps 的功能 - 评估引用、groundedness、检索、延迟、成本和自定义指标。 - 在可选的基于模型的评判器之前运行确定性的红队检查。 - 将候选版本与已接受的基线进行比较,并阻止回归。 - 导出 JSON、Markdown 和独立 HTML 证据,供审查和 CI 使用。 - 支持 Python、CLI、可选的 FastAPI 适配器以及可移植的 JSONL trace。 - 保持场景、策略和报告的版本化,并独立于 provider。 ## 发布门禁的工作原理

RAGOps workflow: application output becomes a portable trace, runs through versioned checks, is compared with a baseline, and receives a pass or block decision

RAGOps 置于应用程序和模型堆栈之外。它接收可移植的 证据,对基线和候选应用相同的版本化契约,并 返回带有具体原因的决策,而不是孤立的仪表盘评分。 ## 五分钟验证 克隆仓库并生成一个完整、无需凭据的发布包: ``` git clone https://github.com/thangldw/ragops.git cd ragops python -m venv .venv source .venv/bin/activate pip install -e . ragops demo --output ragops-demo ``` 打开 `ragops-demo/release-report.html`。已接受的基线通过; 故意制造回归的候选被带有具体原因的门禁拦截。该文件夹还 包含可移植的场景、基线、候选和 Markdown 证据。 默认情况下,该命令拒绝重用现有的输出目录;仅当您 打算替换该目录中的常规文件时,才传递 `--force`。 ## 是证据,而非演示声明 包含的日本企业参考部署在相同的 问题和发布契约下,比较了 ACL 优先、graph 辅助检索的基线与纯 lexical 候选。 | 记录的指标 | Graph + ACL | 纯 Lexical | 差异 | | --- | ---: | ---: | ---: | | 引用覆盖率 | 100% | 75% | -25.00% | | 引用精确度 | 100% | 75% | -25.00% | | Lexical groundedness | 100% | 78.12% | -21.88% | | 发布决策 | 通过 | **拦截** | 暂停发布 | 该基准测试包含 30 个日文案例,涵盖九个失败类别, 包括陈旧证据、模型歧义消除、权限泄露、prompt 注入、弃权以及后果性操作。这些合成结果 验证了测试框架和架构比较;它们并不声称代表客户的 采用情况或生产 ROI。 该仓库目前通过 80 个自动化测试验证了其核心、 适配器、参考部署、展示和演示路径。

RAGOps evidence stack combining quality, safety, operational budgets, and regression comparison into a release decision

## 主要产品界面 | 记录的发布决策 | 已知限制与推出建议 | | --- | --- | | RAGOps 桌面发布决策界面 | RAGOps 已知限制与推出建议界面 |

RAGOps responsive mobile product screen

这些界面展示了公开的参考体验和记录在案的合成 证据。它们并不声称具备生产安全性、客户采用率或 ROI。 ## 评估您自己的 fixture 需要 Python 3.11+。 ``` 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 ``` 当响应长度至关重要时,添加一个确定性的 Unicode code-point 预算: ``` ragops evaluate \ --scenario scenarios/japanese_troubleshooting/scenario.json \ --responses scenarios/japanese_troubleshooting/sample_responses.json \ --evaluator answer_length_budget \ --answer-length-limit 500 ``` 运行无需凭据的参考部署: ``` PYTHONPATH=src:. python -m examples.japanese_troubleshooting_agent.cli \ --suite examples/japanese_troubleshooting_agent/suite.json \ --retriever graph \ --output /tmp/graph-traces.jsonl ragops evaluate \ --scenario examples/japanese_troubleshooting_agent/scenario.json \ --traces /tmp/graph-traces.jsonl \ --evaluator citation_correctness \ --evaluator claim_support ``` ## 架构 ``` RAG / agent application │ portable traces ▼ Scenario loader → deterministic checks → evaluator plugins │ │ └──────── evidence + policy ────────────┘ │ ▼ report → baseline comparison → release gate ``` ``` 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/ Product, architecture, evaluation, and project evidence ``` ## 设计原则 1. 评估是一份发布契约,而不是仪表盘的装饰。 2. 确定性检查在基于模型的评判器之前运行。 3. 每个评分都可以追溯到具体的案例、证据集和策略版本。 4. 开源核心在没有托管服务的情况下依然保持其价值。 5. Agent 提出后果性操作的建议;由人类进行审批。 ## RAGOps 是什么——以及不是什么 | RAGOps 提供 | RAGOps 不声称 | | --- | --- | | 本地、可重复的发布证据 | 从 lexical 重叠中得出的语义正确性 | | 可移植的场景、trace 和报告 | 生产安全性或合规性证明 | | 感知基线的回归门禁 | 客户采用或业务 ROI | | 可扩展的确定性评估器 | 生产级多租户托管控制平面 | 参考 ACL 是一个角色列表模拟,其 graph 是显式且 微小的。在将示例调整 用于生产环境之前,请参阅 [展示限制](https://thangldw.github.io/ragops/#limits)。 ## 文档 - [快速入门](docs/getting-started.md) - [产品理念](docs/product/product_thesis.md) - [系统架构](docs/architecture/system-overview.md) - [评估策略](docs/evaluation/strategy.md) - [回答长度预算评估器](docs/evaluation/answer-length-budget.md) - [可重用的 GitHub PR 门禁](docs/engineering/github-pr-gate.md) - [导出您的第一个可移植 trace](docs/engineering/export-your-first-trace.md) - [OpenTelemetry span 到 trace 示例](examples/opentelemetry_trace_adapter/README.md) - [PyPI Trusted Publishing 操作手册](docs/engineering/pypi-publishing.md) - [参考基准报告](docs/evaluation/benchmark-report-v0.2.md) - [路线图](docs/product/roadmap.md) - [贡献](CONTRIBUTING.md)、[支持](SUPPORT.md)和 [安全策略](SECURITY.md) 可选的 provider 集成位于核心之外。本地历史记录和 控制平面 alpha 版本是单工作区的开发工具,而非生产级 多租户服务。在将 它们改编用于部署之前,请参阅 [控制平面限制](docs/architecture/control-plane-alpha.md)。 ## 许可证 MIT。请参阅 [LICENSE](LICENSE)。之前发布的 Apache-2.0 版本保留 其原始许可证。
标签:AI安全, Chat Copilot, DLL 劫持, Python, RAG系统, 大语言模型, 文档结构分析, 无后门, 时序数据库, 红队评估, 逆向工具