运行部署技术方案
# 运行部署技术方案
1. 覆盖范围
运行部署方案负责把 GitHub、控制面、Docusaurus、RAGFlow、Meilisearch 和商业 LLM API 组合成可运行 MVP。
| 能力 | 技术产品 |
|---|---|
| 定时任务 | GitHub Actions |
| PR 自动化 | GitHub Actions + token/App |
| 文档站 | Docusaurus + 静态托管 |
| 智能体/RAG | 已部署 RAGFlow |
| RAG 检索 | RAGFlow dataset / RAG 索引(向量存储优先评估 pgvector) |
| 全文搜索 | Meilisearch |
| 问答 API | LLM-WIKI wrapper + RAGFlow |
| 智能体访问 API | LLM-WIKI Agent Access API/tool adapter |
2. 如何购买或获取
MVP 购买/获取清单:
| 项目 | 方式 |
|---|---|
| GitHub | Free/Team 起步,私有仓库和团队治理建议 Team |
| RAGFlow | 已部署,复用现有环境 |
| Docusaurus | 开源,无需购买 |
| Meilisearch | 自建或 Cloud,MVP 可自建 |
| 商业 LLM API | 按 token 付费 |
| 静态托管 | GitHub Pages 或其他静态托管 |
2.1 MVP 默认部署组合
默认组合用于把方案落到可执行实施,不影响后续替换。
| 能力 | 默认实施 |
|---|---|
| 自动化 | GitHub Actions |
| 文档站 | Docusaurus build + GitHub Pages 或等价静态托管 |
| Answer API / Agent Access API | 轻量容器服务,部署在能访问 RAGFlow 的网络内 |
| RAG/Agent | 已部署 RAGFlow |
| 全文搜索 | 自建 Meilisearch Docker 或托管 Meilisearch |
| 模型 | RAGFlow-managed commercial LLM,优先 OpenAI-compatible endpoint |
| Secrets | GitHub Actions Secrets + 服务运行环境变量 |
如果 RAGFlow 在内网,默认采用“API 服务靠近 RAGFlow”的部署方式:外部只访问 Answer API / Agent Access API,不直接访问 RAGFlow。
3. 如何开发
MVP 运行形态:
GitHub Actions
-> sync_sources.py
-> validate_docs.py
-> generate_impact_report.py
-> publish_docusaurus.py
-> index_meilisearch.py
-> ragflow_adapter.py
-> agent_access_api.py
Long-running services
-> RAGFlow existing deployment
-> Meilisearch
-> optional LLM-WIKI Answer API / Agent Access API
如果早期不建设长驻 Answer API 和 Agent Access API,可以先由 Docusaurus 前端或内部智能体调用一个轻量 serverless/API wrapper,再由 wrapper 调 RAGFlow、Meilisearch 和 GitHub Issues。
4. 如何部署
4.1 GitHub Actions 部署
工作流部署在 .github/workflows/。
必须包含:
- 同步 workflow。
- 发布校验 workflow。
- 索引更新 workflow。
- 手动触发 Agent workflow。
默认 workflow:
| Workflow | 触发 | 运行位置 | 关键输出 |
|---|---|---|---|
docs-sync.yml | schedule / workflow_dispatch | GitHub Actions | Sync PR、source-changes.json |
docs-publish.yml | PR / main | GitHub Actions | Docusaurus build、impact report、site manifest |
docs-index.yml | main 发布成功后 | GitHub Actions 或 self-hosted runner | RAGFlow / Meilisearch index manifest |
docs-agent.yml | workflow_dispatch / Issue label | GitHub Actions 或内网 runner | Release PR |