Skip to content

fix(agent): correct graph config reporting#1114

Merged
lyingbug merged 2 commits into
Tencent:mainfrom
Aphroq:fix/issue-1106
May 6, 2026
Merged

fix(agent): correct graph config reporting#1114
lyingbug merged 2 commits into
Tencent:mainfrom
Aphroq:fix/issue-1106

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 1, 2026

Pull Request

描述 (Description)

修复 query_knowledge_graph 在知识库已配置实体/关系类型时仍错误显示“未配置”的问题,并补齐前端当前结果组件需要的 graph_config 返回结构。

变更类型 (Type of Change)

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • 💥 破坏性变更 (Breaking change)
  • 📚 文档更新 (Documentation update)
  • 🎨 代码重构 (Code refactoring)
  • ⚡ 性能优化 (Performance improvement)
  • 🧪 测试相关 (Test related)
  • 🔧 配置变更 (Configuration change)
  • 🐳 Docker 相关 (Docker related)
  • 🎨 前端 UI/UX (Frontend UI/UX)

影响范围 (Scope)

  • 后端 API (Backend API)
  • 前端界面 (Frontend UI)
  • 数据库 (Database)
  • 文档解析服务 (Document Reader Service)
  • MCP 服务器 (MCP Server)
  • Docker 配置 (Docker Configuration)
  • 配置文件 (Configuration)
  • 其他 (Other):

测试 (Testing)

  • 单元测试 (Unit tests)
  • 集成测试 (Integration tests)
  • 手动测试 (Manual testing)
  • 前端测试 (Frontend testing)
  • API 测试 (API testing)

测试步骤 (Test Steps)

  1. 运行 go test ./internal/agent/tools -run '^TestQueryKnowledgeGraph_ReportsConfiguredEntityAndRelationTypes$' -v
  2. 确认终端输出中显示 Entity Types (3) / Relationship Types (3),且包含多个检索结果
  3. 确认输出中不再出现 No entity types configured / No relationship types configured

检查清单 (Checklist)

  • 代码遵循项目的编码规范
  • 已进行自我代码审查
  • 代码变更已添加适当的注释
  • 相关文档已更新
  • 变更不会产生新的警告
  • 已添加测试用例证明修复有效或功能正常
  • 新功能和变更已更新到相关文档
  • 破坏性变更已在描述中明确说明

相关 Issue

Fixes #1106

截图/录屏 (Screenshots/Recordings)

屏幕截图 2026-05-01 223924 屏幕截图 2026-05-01 224003

数据库迁移 (Database Migration)

  • 不需要数据库迁移

配置变更 (Configuration Changes)

部署说明 (Deployment Notes)

其他信息 (Additional Information)

本次修复聚焦于 #1106 中“图谱配置已存在但 tool 误报未配置、且返回结构与前端不兼容”的直接问题。query_knowledge_graph 目前仍主要是基于检索结果的包装输出,尚未升级为真正的 Neo4j 图查询工具;这一更深层的增强需求与 #799 中提到的“知识问答时不检索知识图谱”属于同一后续方向。

@lyingbug lyingbug merged commit e938f1c into Tencent:main May 6, 2026
1 check passed
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.

[Bug]: 知识图谱无法使用

2 participants