ragflow/graphrag/general
liuzhenghua af770c5ced
perf: Optimize GraphRAG’s LOOP_PROMPT (#7356)
### What problem does this PR solve?

当前graphrag的LOOP_PROMPT,会导致模型输出Y之后,继续补充了实体和关系,比较浪费时间。参照[graph
rag](https://github.com/microsoft/graphrag/blob/main/graphrag/prompts/index/extract_graph.py)最新的代码,修改了LOOP_PROMPT,经过验证,修改后可以稳定的输出Y停止。

Currently, GraphRAG’s LOOP_PROMPT causes the model to keep appending
entities and relationships even after outputting “Y,” which wastes time.
Referring to the latest code in
[graphRAG](https://github.com/microsoft/graphrag/blob/main/graphrag/prompts/index/extract_graph.py),
I modified the LOOP_PROMPT, and after verification the updated prompt
reliably outputs “Y” and stops.

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [x] Performance Improvement
- [ ] Other (please describe):

Co-authored-by: liuzhenghua-jk <liuzhenghua-jk@360shuke.com>
2025-04-28 13:31:04 +08:00
..
__init__.py Light GraphRAG (#4585) 2025-01-22 19:43:14 +08:00
community_report_prompt.py Optimize graphrag again (#6513) 2025-03-26 15:34:42 +08:00
community_reports_extractor.py fix(nursery): Fix Closure Trap Issues in Trio Concurrent Tasks (#7106) 2025-04-18 18:00:20 +08:00
entity_embedding.py Light GraphRAG (#4585) 2025-01-22 19:43:14 +08:00
extractor.py <think> tag is missing. (#7256) 2025-04-24 11:44:10 +08:00
graph_extractor.py perf: Optimize GraphRAG’s LOOP_PROMPT (#7356) 2025-04-28 13:31:04 +08:00
graph_prompt.py perf: Optimize GraphRAG’s LOOP_PROMPT (#7356) 2025-04-28 13:31:04 +08:00
index.py Fix: handle sometimes graph index will miss explanation (#7127) 2025-04-18 14:24:36 +08:00
leiden.py Optimize graphrag again (#6513) 2025-03-26 15:34:42 +08:00
mind_map_extractor.py fix(nursery): Fix Closure Trap Issues in Trio Concurrent Tasks (#7106) 2025-04-18 18:00:20 +08:00
mind_map_prompt.py Light GraphRAG (#4585) 2025-01-22 19:43:14 +08:00
smoke.py Refactor graphrag to remove redis lock (#5828) 2025-03-10 15:15:06 +08:00