Skip to content

feat(kg): add dual-mode knowledge graph support#144

Open
huamingjie0815 wants to merge 12 commits into666ghj:mainfrom
huamingjie0815:feat/local-knowledge-graph
Open

feat(kg): add dual-mode knowledge graph support#144
huamingjie0815 wants to merge 12 commits into666ghj:mainfrom
huamingjie0815:feat/local-knowledge-graph

Conversation

@huamingjie0815
Copy link

Summary

  • Add kg_adapter for dual-mode knowledge graph (cloud/local)
  • Support switching between Zep Cloud and local Graphiti + Neo4j
  • Improve entity extraction and report agent robustness
  • Add test_kg_adapter.py with unit tests

Test plan

  • Test cloud mode with Zep Cloud
  • Test local mode with Graphiti + Neo4j
  • Run unit tests

🤖 Generated with Claude Code

- Add kg_adapter for dual-mode knowledge graph (cloud/local)
- Support switching between Zep Cloud and local Graphiti + Neo4j
- Improve entity extraction and report agent robustness
- Add test_kg_adapter.py with unit tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Memory Layer Any questions related to RAG, GraphRAG and LLM Memory. labels Mar 11, 2026
huamingjie0815 and others added 9 commits March 11, 2026 23:27
- Update prompt template to use XML format:
  <tool_call name="tool_name">
    <parameter name="param">value</parameter>
  </tool_call>
- Rewrite _parse_tool_calls to support new XML format
- Add fallback support for old JSON format
- Update response cleaning regex to handle new format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add title requirements section with clear guidelines:
  - Titles should be concise and directly reflect user needs
  - Avoid academic or abstract expressions
  - Add concrete examples of good vs bad titles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add style and theme constraints to PLAN_SYSTEM_PROMPT to ensure report titles
  are specific and relevant to prediction conditions
- Add "重新分析" (regenerate) button next to "进入深度互动" button in report page
- Button only shows when report generation is complete (isComplete = true)
- Reuses existing /api/report/generate endpoint with force_regenerate=true

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Make title constraints more generic and easier to follow
- Emphasize that titles should be direct prediction results like news headlines
- Add specific forbidden words: "变量", "注入", "模拟", "状态", "演化"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add download functionality to report page with button placed
left of regenerate button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add delete API endpoint (DELETE /api/simulation/<id>)
- Add deleteSimulation method to SimulationManager
- Add delete button to history cards (visible on hover)
- Add confirmation modal for delete action

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(history): add delete simulation functionality
@huamingjie0815
Copy link
Author

支持图谱的local 和cloud 双模式,local 是基于graphiti 改造,需要自己配置embedding模型 ,同时该提交增加一些功能优化,包括删除推演记录、导出报告、重新生成报告等功能,调整report_agent 的tool_call 的格式,从json改为xml 。

huamingjie0815 and others added 2 commits March 12, 2026 14:59
- Use entity_type as dynamic label (e.g., 人物, Person)
- Add Entity as base label for all entities to maintain query compatibility
- Handle edge cases: empty type, numeric-prefixed type

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(kg): add dynamic entity labels for local mode
@666ghj
Copy link
Owner

666ghj commented Mar 12, 2026

Wow, this is indeed a great approach to compatibility implementation. Give me some time to take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Memory Layer Any questions related to RAG, GraphRAG and LLM Memory. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants