feat(kg): add dual-mode knowledge graph support#144
Open
huamingjie0815 wants to merge 22 commits into666ghj:mainfrom
Open
feat(kg): add dual-mode knowledge graph support#144huamingjie0815 wants to merge 22 commits into666ghj:mainfrom
huamingjie0815 wants to merge 22 commits into666ghj:mainfrom
Conversation
- 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>
- 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>
This reverts commit 48ff659.
- 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>
Feat/project optimization
- 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
Author
|
支持图谱的local 和cloud 双模式,local 是基于graphiti 改造,需要自己配置embedding模型 ,同时该提交增加一些功能优化,包括删除推演记录、导出报告、重新生成报告等功能,调整report_agent 的tool_call 的格式,从json改为xml 。 |
- 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
Owner
|
Wow, this is indeed a great approach to compatibility implementation. Give me some time to take a look! |
- Add database index for trace table to speed up interview result queries - Optimize interview question generation to 1-3 questions (was 3-5) - Increase default interview_all_agents timeout from 180s to 240s Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add LLM_MAX_TOKENS config option to make max_tokens configurable via environment variable. Defaults to 4096 if not specified. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 添加 EMBEDDING_BATCH_SIZE 配置项(默认 5) - 新增 SingleEmbeddingEmbedder 支持自定义批处理大小 - Graphiti 适配器使用类级别 event loop - 添加异步超时保护(默认 300 秒) - 重构 add_episodes_batch 使用 Graphiti 原生 API - 添加 set_ontology 方法支持 entity_types - 增强 search 方法支持 scope 和 reranker 参数 - 优化 get_nodes 使用 group_id 属性 - 减少日志噪音(info 改为 debug) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 删除 _call_llm_for_entities 手动实体提取方法 - delete 方法统一使用 group_id 属性查询 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
使ZepCloudAdapter.search返回与GraphitiAdapter一致的 对象格式(带.edges和.nodes属性),修复检索返回0条的问题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
问题原因: - simulation.py 中 OasisProfileGenerator 初始化时未传入 graph_id - kg_adapter.py 中 ZepCloudAdapter.search 检查了不存在的 .results 属性 修复内容: - simulation.py: 传入 graph_id 参数 - kg_adapter.py: 直接返回原始 GraphSearchResults 对象 - oasis_profile_generator.py: 使用实体名作为查询(中文描述搜索效果差) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 补充缺失的 config 参数 (EMBEDDING_BATCH_SIZE, OASIS_* , REPORT_AGENT_*) - 新增 KNOWLEDGE_GRAPH_MODE.md (中文双模式说明文档) - 新增 KNOWLEDGE_GRAPH_MODE_EN.md (英文双模式说明文档) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(kg): 优化嵌入批处理和Graphiti适配器
Author
上一个版本local 模式并不是真的使用自定义的embedding 模型提取实体信息,这是一个bug。最新提交已经修复了该问题,并解决了一些过程中的其他问题。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code