Skip to content

feat: 实现 AI 智能底座 Java 网关并裁剪 WeKnora 知识面 - #1

Draft
bmeAtnju wants to merge 1 commit into
mainfrom
cursor/ai-intelligent-base-84e1
Draft

feat: 实现 AI 智能底座 Java 网关并裁剪 WeKnora 知识面#1
bmeAtnju wants to merge 1 commit into
mainfrom
cursor/ai-intelligent-base-84e1

Conversation

@bmeAtnju

Copy link
Copy Markdown
Owner

Description

按「券商交易系统 AI 智能底座」设计落地 Phase 1/2:对外提供 OpenAI-compatible 虚拟专用大模型,对内把 WeKnora 裁剪为知识证据平台,由 Java 网关运行 Agentic 多轮反思/重检索控制环,输出可校验的 plan_json(字段名 + 来源,不含示例 body)。

Type of Change

  • ✨ New feature
  • 📚 Documentation update
  • 🔧 Configuration / Build / CI

Related Issue

实现设计文档《AI智能底座设计》中的端到端闭环。

What changed

Java 网关 ai-gateway/

  • POST /v1/chat/completions(鉴权、限流、观测)
  • 七模块控制环:Scenario Router / Ontology Adapter / Evidence Retriever / Planner / Reflector / Re-Retrieval Planner / Plan Validator
  • 三类场景本体:发布、排障、配置变更
  • 节点契约注册表校验(节点 / 协议 / endpoint alias / 参数字段来源)
  • WeKnora 不可用时回退到内置 Runbook

WeKnora 裁剪

  • WEKNORA_PROFILE=knowledge 时不注册 IM / Embed / Wiki / Agent / MCP / 会话聊天等产品路由
  • 新增 POST /api/v1/knowledge-bases/:id/ai-base/retrieve,把 hybrid-search 命中映射为带运营标签的 EvidenceChunk
  • docker-compose.ai-base.yml overlay:默认不启动前端

Testing

  • go test ./internal/aibase ./internal/config ./internal/handler ./internal/router 通过
  • cd ai-gateway && mvn test 通过(13 tests)
  • git diff --check origin/main...HEAD 通过

本地体验:

cd ai-gateway && mvn spring-boot:run
curl -s http://localhost:18080/v1/chat/completions \
  -H "Authorization: Bearer dev-key" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"生产环境发布版本 1.2.3"}]}'

更完整说明见 docs/AI智能底座.md

Checklist

  • git diff --check origin/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed packages/components pass
  • Self-reviewed the code
  • Added/updated tests covering the change
  • Updated related documentation (docs/AI智能底座.md, ai-gateway/README.md)
Open in Web Open in Cursor 

对外提供 OpenAI 兼容的 chat.completions,由 Java 控制环生成可校验的 plan_json;
WeKnora 在 knowledge profile 下只暴露 ingest/retrieve,并新增证据检索接口。

Co-authored-by: wfLi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants