first commit
This commit is contained in:
229
AIEC-RAG/retriver/langgraph_mermaid_flow.drawio
Normal file
229
AIEC-RAG/retriver/langgraph_mermaid_flow.drawio
Normal file
@ -0,0 +1,229 @@
|
||||
<mxfile host="app.diagrams.net" modified="2024-01-01T00:00:00.000Z" agent="Mozilla/5.0" etag="langgraph-flow" version="21.1.2" type="device">
|
||||
<diagram name="LangGraph工作流" id="langgraph-workflow">
|
||||
<mxGraphModel dx="1422" dy="794" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1920" pageHeight="1080" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
|
||||
<!-- 标题 -->
|
||||
<mxCell id="title" value="LangGraph RAG 工作流程图" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=24;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="760" y="20" width="400" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 开始节点 -->
|
||||
<mxCell id="start" value="__start__" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="890" y="80" width="100" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 查询复杂度检查 -->
|
||||
<mxCell id="query_complexity_check" value="query_complexity_check<br>查询复杂度检查" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
|
||||
<mxGeometry x="850" y="160" width="180" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 调试模式节点 -->
|
||||
<mxCell id="debug_mode_node" value="debug_mode_node<br>调试模式判断" style="rhombus;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
|
||||
<mxGeometry x="860" y="260" width="160" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 简单路径分支 -->
|
||||
<mxCell id="simple_path_group" value="简单检索路径" style="swimlane;fillColor=#e1ffe1;strokeColor=#82b366;fontSize=14;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="480" y="380" width="280" height="200" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="simple_vector_retrieval" value="simple_vector_retrieval<br>简单向量检索" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="simple_path_group" vertex="1">
|
||||
<mxGeometry x="50" y="40" width="180" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="simple_answer_generation" value="simple_answer_generation<br>简单答案生成" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="simple_path_group" vertex="1">
|
||||
<mxGeometry x="50" y="120" width="180" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 复杂路径分支 -->
|
||||
<mxCell id="complex_path_group" value="复杂迭代推理路径" style="swimlane;fillColor=#e1f5ff;strokeColor=#6c8ebf;fontSize=14;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="1120" y="380" width="680" height="320" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="query_decomposition" value="query_decomposition<br>查询分解" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="30" y="40" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="initial_retrieval" value="initial_retrieval<br>初始检索" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="220" y="40" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="sufficiency_check" value="sufficiency_check<br>充分性检查" style="rhombus;whiteSpace=wrap;html=1;fillColor=#cce5ff;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="410" y="30" width="140" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="sub_query_generation" value="sub_query_generation<br>子查询生成" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="390" y="140" width="180" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="parallel_retrieval" value="parallel_retrieval<br>并行检索" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="390" y="230" width="180" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="next_iteration" value="next_iteration<br>下次迭代" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="complex_path_group" vertex="1">
|
||||
<mxGeometry x="220" y="230" width="140" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 最终答案节点 -->
|
||||
<mxCell id="final_answer" value="final_answer<br>最终答案生成" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" parent="1" vertex="1">
|
||||
<mxGeometry x="860" y="760" width="160" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 结束节点 -->
|
||||
<mxCell id="end" value="__end__" style="ellipse;whiteSpace=wrap;html=1;fillColor=#bfb6fc;strokeColor=#9673a6;fontStyle=1" parent="1" vertex="1">
|
||||
<mxGeometry x="890" y="860" width="100" height="50" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 连接线 -->
|
||||
<!-- start到query_complexity_check -->
|
||||
<mxCell id="e1" edge="1" parent="1" source="start" target="query_complexity_check">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- query_complexity_check到debug_mode_node -->
|
||||
<mxCell id="e2" edge="1" parent="1" source="query_complexity_check" target="debug_mode_node">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- debug_mode_node到simple_vector_retrieval -->
|
||||
<mxCell id="e3" value="简单" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1" edge="1" parent="1" source="debug_mode_node" target="simple_vector_retrieval">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="620" y="300" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- debug_mode_node到query_decomposition (initial_retrieval标签) -->
|
||||
<mxCell id="e4" value="复杂<br>(initial_retrieval)" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1" edge="1" parent="1" source="debug_mode_node" target="query_decomposition">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="1150" y="300" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- simple_vector_retrieval到simple_answer_generation -->
|
||||
<mxCell id="e5" edge="1" parent="simple_path_group" source="simple_vector_retrieval" target="simple_answer_generation">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- query_decomposition到initial_retrieval -->
|
||||
<mxCell id="e6" edge="1" parent="complex_path_group" source="query_decomposition" target="initial_retrieval">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- initial_retrieval到sufficiency_check -->
|
||||
<mxCell id="e7" edge="1" parent="complex_path_group" source="initial_retrieval" target="sufficiency_check">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- sufficiency_check到sub_query_generation (parallel_retrieval标签) -->
|
||||
<mxCell id="e8" value="不充分<br>(parallel_retrieval)" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1" edge="1" parent="complex_path_group" source="sufficiency_check" target="sub_query_generation">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- sub_query_generation到parallel_retrieval -->
|
||||
<mxCell id="e9" edge="1" parent="complex_path_group" source="sub_query_generation" target="parallel_retrieval">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- parallel_retrieval到next_iteration -->
|
||||
<mxCell id="e10" edge="1" parent="complex_path_group" source="parallel_retrieval" target="next_iteration">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- next_iteration到sufficiency_check (循环) -->
|
||||
<mxCell id="e11" value="继续迭代" edge="1" parent="complex_path_group" source="next_iteration" target="sufficiency_check">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="290" y="160" />
|
||||
<mxPoint x="290" y="70" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- sufficiency_check到next_iteration (条件) -->
|
||||
<mxCell id="e12" value="需要更多信息" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1" edge="1" parent="complex_path_group" source="sufficiency_check" target="next_iteration">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="480" y="120" />
|
||||
<mxPoint x="290" y="120" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- sufficiency_check到final_answer -->
|
||||
<mxCell id="e13" value="充分" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1" edge="1" parent="1" source="sufficiency_check" target="final_answer">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="1600" y="730" />
|
||||
<mxPoint x="940" y="730" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- simple_answer_generation到end -->
|
||||
<mxCell id="e14" edge="1" parent="1" source="simple_answer_generation" target="end">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<Array as="points">
|
||||
<mxPoint x="620" y="885" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
|
||||
<!-- final_answer到end -->
|
||||
<mxCell id="e15" edge="1" parent="1" source="final_answer" target="end">
|
||||
<mxGeometry relative="1" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 图例 -->
|
||||
<mxCell id="legend" value="图例" style="swimlane;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" vertex="1">
|
||||
<mxGeometry x="80" y="760" width="320" height="150" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="legend_solid" value="━━ 确定路径(实线)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;" parent="legend" vertex="1">
|
||||
<mxGeometry x="10" y="30" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="legend_dashed" value="┅┅ 条件路径(虚线)" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;" parent="legend" vertex="1">
|
||||
<mxGeometry x="10" y="60" width="150" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="legend_simple" value="绿色:简单检索路径" style="text;html=1;strokeColor=none;fillColor=#d5e8d4;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;" parent="legend" vertex="1">
|
||||
<mxGeometry x="170" y="30" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="legend_complex" value="蓝色:复杂迭代路径" style="text;html=1;strokeColor=none;fillColor=#dae8fc;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;" parent="legend" vertex="1">
|
||||
<mxGeometry x="170" y="60" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="legend_decision" value="菱形:决策节点" style="text;html=1;strokeColor=none;fillColor=#ffe6cc;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=12;" parent="legend" vertex="1">
|
||||
<mxGeometry x="170" y="90" width="140" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 流程说明 -->
|
||||
<mxCell id="description" value="流程说明" style="swimlane;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" vertex="1">
|
||||
<mxGeometry x="80" y="80" width="680" height="240" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="desc_text" value="1. 查询复杂度检查:分析用户查询的复杂程度<br><br>2. 调试模式判断:根据复杂度或调试设置选择路径<br><br>3. 简单路径:<br> • 直接进行向量检索<br> • 生成简单答案<br><br>4. 复杂路径(HippoDeep迭代推理):<br> • 查询分解:将复杂查询分解为子问题<br> • 初始检索:执行第一轮检索<br> • 充分性检查:判断检索结果是否充分<br> • 子查询生成:如不充分,生成补充查询<br> • 并行检索:并行执行多个子查询<br> • 迭代循环:重复直到信息充分或达到限制<br><br>5. 最终答案生成:基于所有检索结果生成完整答案" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=11;" parent="description" vertex="1">
|
||||
<mxGeometry x="10" y="30" width="660" height="200" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<!-- 关键特性 -->
|
||||
<mxCell id="features" value="关键特性" style="swimlane;fillColor=#f5f5f5;strokeColor=#666666;" parent="1" vertex="1">
|
||||
<mxGeometry x="80" y="340" width="320" height="120" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
<mxCell id="features_text" value="• 智能路由:自动判断查询复杂度<br>• 迭代推理:支持多轮信息获取<br>• 并行处理:同时执行多个子查询<br>• 充分性验证:确保答案质量<br>• 灵活切换:支持调试模式强制路径" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontSize=11;" parent="features" vertex="1">
|
||||
<mxGeometry x="10" y="30" width="300" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
Reference in New Issue
Block a user