complete ai kerne frame code

This commit is contained in:
Liu Zhicong
2023-08-20 22:53:35 -07:00
parent 6b39379d7c
commit 814f5cf481
21 changed files with 725 additions and 20 deletions
+76
View File
@@ -0,0 +1,76 @@
<mxfile host="Electron" modified="2023-08-20T20:43:16.356Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="kwtbDIrkPfCysRMj32zz" version="21.6.8" type="device">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="914" dy="806" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="ia-fclrWNqMUroYMcw65-37" value="" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="340" y="345" width="290" height="105" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-36" value="" style="rounded=0;whiteSpace=wrap;html=1;dashed=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="90" y="345" width="250" height="105" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-1" value="local compute &lt;br&gt;node" style="shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#6d8764;fontColor=#ffffff;strokeColor=#3A5431;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="90" y="380" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ia-fclrWNqMUroYMcw65-2" target="ia-fclrWNqMUroYMcw65-28">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-2" value="my device&lt;br&gt;&amp;nbsp;compute &lt;br&gt;node" style="shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#6d8764;fontColor=#ffffff;strokeColor=#3A5431;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="210" y="380" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-3" value="service compute&lt;br&gt;node" style="shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="370" y="380" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-4" value="untruest compute&lt;br&gt;node" style="shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;fillColor=#fa6800;fontColor=#000000;strokeColor=#C73500;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="490" y="380" width="130" height="50" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-18" value="TaskParams:json" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#60a917;fontColor=#ffffff;strokeColor=#2D7600;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="50" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-19" value="padding input:buffers" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#0050ef;fontColor=#ffffff;strokeColor=#001DBC;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="130" width="120" height="70" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-22" value="Refer:Name Data" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="90" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-23" value="aios_kernel&lt;br&gt;(scheduler)" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="250" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-24" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ia-fclrWNqMUroYMcw65-19" target="ia-fclrWNqMUroYMcw65-23">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="430" y="240" as="sourcePoint" />
<mxPoint x="480" y="190" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-25" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="ia-fclrWNqMUroYMcw65-23" target="ia-fclrWNqMUroYMcw65-2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="420" y="350" as="sourcePoint" />
<mxPoint x="470" y="300" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-26" value="Owne Nodes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="90" y="345" width="100" height="30" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-27" value="Rental Nodes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="505" y="345" width="100" height="30" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-28" value="ResultParams:json" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#60a917;fontColor=#ffffff;strokeColor=#2D7600;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="516" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-29" value="padding result:buffers" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#0050ef;fontColor=#ffffff;strokeColor=#001DBC;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="596" width="120" height="70" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-30" value="Refer:Name Data" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6a00ff;fontColor=#ffffff;strokeColor=#3700CC;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="280" y="556" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-34" value="有一些任务是可以分割的,这个既可以上层处理分割、合并。也可以由aios_kernel处理" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="450" y="80" width="170" height="70" as="geometry" />
</mxCell>
<mxCell id="ia-fclrWNqMUroYMcw65-35" value="调度器的核心是结合已知compute_node的状态,与Refer数据的距离,计算的成本,运行的速度等多种要素,选择一个compute_node完成计算任务。也可包含一定的迭代重试逻辑" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="450" y="240" width="170" height="70" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
+368
View File
@@ -0,0 +1,368 @@
<mxfile host="Electron" modified="2023-08-20T20:08:22.343Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.8 Chrome/114.0.5735.289 Electron/25.5.0 Safari/537.36" etag="SQBT5p79u9TgTP61At6q" version="21.6.8" type="device" pages="3">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="1421" dy="816" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-3" value="(chat) message" style="rounded=1;whiteSpace=wrap;html=1;fontSize=12;glass=0;strokeWidth=1;shadow=0;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="159" y="330" width="90" height="40" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-0" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="WIyWlLk6GJQsqaUBKTNV-3" target="RbYReh6FQah4Kl5oFyjJ-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="279" y="390" as="sourcePoint" />
<mxPoint x="309" y="350" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-8" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-1" target="RbYReh6FQah4Kl5oFyjJ-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-14" value="message" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-1" target="RbYReh6FQah4Kl5oFyjJ-13">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-1" value="Workflow" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6d8764;fontColor=#ffffff;strokeColor=#3A5431;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="304" y="320" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-2" value="Functions" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="514" y="320" width="130" height="60" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-3" target="RbYReh6FQah4Kl5oFyjJ-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-3" value="(phicyal / virtual)&lt;br&gt;environment" style="shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="304" y="120" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-4" target="RbYReh6FQah4Kl5oFyjJ-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-4" value="(event) message" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="304" y="240" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-9" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=120;entryDy=50;entryPerimeter=0;dashed=1;dashPattern=8 8;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-2" target="RbYReh6FQah4Kl5oFyjJ-3">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="564" y="290" as="sourcePoint" />
<mxPoint x="614" y="240" as="targetPoint" />
<Array as="points">
<mxPoint x="579" y="170" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-10" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.16;entryY=0.55;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-2" target="RbYReh6FQah4Kl5oFyjJ-11">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="684" y="320" as="sourcePoint" />
<mxPoint x="714" y="350" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-11" value="Exist Service" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="689" y="300" width="130" height="90" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-13" value="sub / other workflow" style="whiteSpace=wrap;html=1;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="304" y="480" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-15" value="response message" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-1" target="RbYReh6FQah4Kl5oFyjJ-17">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="129" y="480" as="sourcePoint" />
<mxPoint x="99" y="420" as="targetPoint" />
<Array as="points">
<mxPoint x="334" y="420" />
<mxPoint x="49" y="420" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-18" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-17" target="WIyWlLk6GJQsqaUBKTNV-3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-17" value="Personal" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="9" y="310" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-19" value="" style="shape=xor;whiteSpace=wrap;html=1;rotation=-90;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="309" y="67" width="20" height="20" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-21" value="" style="shape=xor;whiteSpace=wrap;html=1;rotation=-90;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="347" y="67" width="20" height="20" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-22" value="" style="shape=xor;whiteSpace=wrap;html=1;rotation=-90;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="386" y="67" width="20" height="20" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-23" value="IoT Devices" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="240" y="67" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-25" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.122;entryY=0.008;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-19" target="RbYReh6FQah4Kl5oFyjJ-3">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="240" y="170" as="sourcePoint" />
<mxPoint x="290" y="120" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-26" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0;entryDx=50;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-21">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="443" y="120" as="sourcePoint" />
<mxPoint x="357" y="120.00000000000011" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="RbYReh6FQah4Kl5oFyjJ-27" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.766;entryY=0.02;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="RbYReh6FQah4Kl5oFyjJ-22" target="RbYReh6FQah4Kl5oFyjJ-3">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="430" y="140" as="sourcePoint" />
<mxPoint x="480" y="90" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="HvRWRVSjofeyYJQyU3aa-0" value="Sub workflow is not visiable for others&lt;br&gt;&lt;br&gt;Sub worflow can share roles&amp;nbsp;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="160" y="480" width="140" height="70" as="geometry" />
</mxCell>
<mxCell id="HvRWRVSjofeyYJQyU3aa-1" value="Chat with AI Agent is like chat with a workflow which have only one agent and no rules" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="70" y="150" width="150" height="80" as="geometry" />
</mxCell>
<mxCell id="ed6Jjq-fMpksm2tlv9Oi-0" value="inner&amp;nbsp;&lt;br&gt;environment" style="shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;size=10;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="386" y="360" width="84" height="40" as="geometry" />
</mxCell>
<mxCell id="ed6Jjq-fMpksm2tlv9Oi-1" value="Environment could shared with workflows" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="440" y="120" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="ed6Jjq-fMpksm2tlv9Oi-2" value="Inner environment&amp;nbsp; could be used as Context(FileSystem)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="413" y="410" width="110" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="kWxfmPxtNxOAf0a73TCG" name="Page-2">
<mxGraphModel dx="1421" dy="816" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="VGzDL9xesOOnN_l_G2Ij-1" value="&lt;h1&gt;Workflow rules&lt;/h1&gt;&lt;p&gt;workflow rules(prompt)&lt;/p&gt;" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="70" y="800" width="190" height="120" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-2" value="&lt;h1&gt;Workflow roles&lt;/h1&gt;&lt;p&gt;AI Agent groups&lt;/p&gt;&lt;p&gt;Project Manager : Alex&lt;/p&gt;&lt;p&gt;Programer : Bobl&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="320" y="790" width="190" height="120" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-3" target="VGzDL9xesOOnN_l_G2Ij-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-3" target="VGzDL9xesOOnN_l_G2Ij-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-3" value="Message" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="340" y="170" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-4" value="inner filter&amp;nbsp;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
<mxGeometry x="150" y="260" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-5" value="roleA" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="80" y="350" width="110" height="60" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-6" target="VGzDL9xesOOnN_l_G2Ij-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-6" value="roleB" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="240" y="350" width="110" height="60" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-7">
<mxGeometry relative="1" as="geometry">
<mxPoint x="570.0344827586209" y="350" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-7" value="Workflow rules" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="520" y="260" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-8" value="Final Result of Message" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="340" y="590" width="100" height="50" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-9" target="VGzDL9xesOOnN_l_G2Ij-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-9" value="Result Merge" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="521" y="530" width="100" height="40" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-10" target="VGzDL9xesOOnN_l_G2Ij-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-10" value="roleC" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="435" y="350" width="110" height="60" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-11" target="41KxsEdFswCCPQnavNoU-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-11" value="roleD" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="595" y="350" width="110" height="60" as="geometry" />
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-12" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-4" target="VGzDL9xesOOnN_l_G2Ij-5">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="510" as="sourcePoint" />
<mxPoint x="210" y="460" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="VGzDL9xesOOnN_l_G2Ij-13" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="VGzDL9xesOOnN_l_G2Ij-4" target="VGzDL9xesOOnN_l_G2Ij-6">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="210" y="510" as="sourcePoint" />
<mxPoint x="260" y="460" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-1" value="" style="shape=cross;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="556" y="364" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="41KxsEdFswCCPQnavNoU-7" target="VGzDL9xesOOnN_l_G2Ij-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="41KxsEdFswCCPQnavNoU-7" value="call function or&amp;nbsp;&lt;br&gt;send message" style="shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
<mxGeometry x="592.5" y="460" width="115" height="30" as="geometry" />
</mxCell>
<mxCell id="q_eHDVuD3DBh6_VEKgap-2" value="message process by filter,select one role do LLM and get RESULT of input" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="90" y="190" width="165" height="30" as="geometry" />
</mxCell>
<mxCell id="q_eHDVuD3DBh6_VEKgap-3" value="message process by rules,select mutil role do LLM and merge RESULT of input" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="510" y="180" width="165" height="30" as="geometry" />
</mxCell>
<mxCell id="q_eHDVuD3DBh6_VEKgap-5" value="如果一个工作流有3个role参与,每个人都需要调用函数并分析结果,那么要进行至少6次推理" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="500" y="640" width="174" height="40" as="geometry" />
</mxCell>
<mxCell id="q_eHDVuD3DBh6_VEKgap-6" value="这里是基于规则的合并,给另一个Role合并是多输入Agent流程" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="635" y="570" width="160" height="30" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
<diagram id="7NYJTgo0U9cdVshLy85U" name="Page-3">
<mxGraphModel dx="1177" dy="676" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="zJVYyOSlNiCVBlA5jEf0-2" value="Agent Sessions&lt;br&gt;Data" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="110" y="533" width="80" height="70" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-2" value="Small LLM, Train With Personal Data" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="270" y="258" width="140" height="50" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-4" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="78" width="160" height="360" as="geometry" />
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="8StUH8aFnwlRlHm0zShF-1" target="SPnvrlBiOLhgEaWxmdK3-4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-1" value="LLM&lt;br&gt;(Common Sence)" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="250" y="218" width="140" height="50" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-3" value="ControlNet&lt;br&gt;base on Agent Memory" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="250" y="108" width="140" height="50" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-4" value="Agent人格助记词" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;size=0.25;" vertex="1" parent="1">
<mxGeometry x="40" y="108" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-5" value="Role助记词" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;size=0.25;" vertex="1" parent="1">
<mxGeometry x="40" y="168" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-6" value="Workflow Rules助记词" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;size=0.25;" vertex="1" parent="1">
<mxGeometry x="40" y="235.5" width="120" height="52.5" as="geometry" />
</mxCell>
<mxCell id="8StUH8aFnwlRlHm0zShF-7" value="访问Knowlegegou构造助记词" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;size=0.25;" vertex="1" parent="1">
<mxGeometry x="40" y="378" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="Tz-ThZOieDqqDBRXvXnh-1" value="Invoke the function and wait for the necessary response." style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="600" y="33" width="110" height="70" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-2" value="Send Message and wait for the necessary response." style="rounded=1;whiteSpace=wrap;html=1;fontSize=11;glass=0;strokeWidth=1;shadow=0;" vertex="1" parent="1">
<mxGeometry x="610" y="153" width="90" height="70" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-5" value="Input Prompts" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="60" y="78" width="80" height="30" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-7" value="Responce Prompts" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="740" y="103" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="awKuOLItvF_EOGf5wS2x-8" target="awKuOLItvF_EOGf5wS2x-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-8" value="LLM Competion" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" vertex="1" parent="1">
<mxGeometry x="720" y="226.75" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="awKuOLItvF_EOGf5wS2x-9" target="SPnvrlBiOLhgEaWxmdK3-1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="awKuOLItvF_EOGf5wS2x-9" value="Final Result&lt;br&gt;Of Message&lt;br&gt;(can be None)" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="450" y="363" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-1" value="Storage Result in agent session and workflow session" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="450" y="483" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-2" value="可用Function助记词" style="shape=document;whiteSpace=wrap;html=1;boundedLbl=1;size=0.25;" vertex="1" parent="1">
<mxGeometry x="40" y="308" width="120" height="50" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-7" value="Yes" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="SPnvrlBiOLhgEaWxmdK3-4" target="SPnvrlBiOLhgEaWxmdK3-6">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-8" value="No" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="SPnvrlBiOLhgEaWxmdK3-4" target="awKuOLItvF_EOGf5wS2x-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-4" value="推理结果&lt;br&gt;需要进一步处理?" style="rhombus;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="440" y="203" width="140" height="80" as="geometry" />
</mxCell>
<mxCell id="SPnvrlBiOLhgEaWxmdK3-6" value="Call Funstion or send message?" style="rhombus;whiteSpace=wrap;html=1;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="440" y="78" width="140" height="80" as="geometry" />
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-3" value="Call" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="SPnvrlBiOLhgEaWxmdK3-6" target="Tz-ThZOieDqqDBRXvXnh-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="410" y="113" as="sourcePoint" />
<mxPoint x="460" y="63" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-4" value="Send" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="SPnvrlBiOLhgEaWxmdK3-6" target="awKuOLItvF_EOGf5wS2x-2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="560" y="193" as="sourcePoint" />
<mxPoint x="610" y="143" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-5" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="awKuOLItvF_EOGf5wS2x-2" target="awKuOLItvF_EOGf5wS2x-7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="720" y="213" as="sourcePoint" />
<mxPoint x="770" y="163" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-6" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="Tz-ThZOieDqqDBRXvXnh-1" target="awKuOLItvF_EOGf5wS2x-7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="750" y="93" as="sourcePoint" />
<mxPoint x="800" y="43" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-7" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="awKuOLItvF_EOGf5wS2x-7" target="awKuOLItvF_EOGf5wS2x-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="750" y="213" as="sourcePoint" />
<mxPoint x="800" y="163" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-10" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="330" y="218" as="sourcePoint" />
<mxPoint x="330" y="158" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-12" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;fillColor=#6d8764;strokeColor=#3A5431;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="251.75" as="sourcePoint" />
<mxPoint x="240" y="252" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-15" value="Real Time Enviroment Knowlege" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="10" y="533" width="80" height="70" as="geometry" />
</mxCell>
<mxCell id="zJVYyOSlNiCVBlA5jEf0-1" value="Workflow Context Data" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="110" y="473" width="80" height="70" as="geometry" />
</mxCell>
<mxCell id="S5MjekdSblNa5itYb4Ee-14" value="OOD&#39;s KnowlegeBase" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;fontSize=11;" vertex="1" parent="1">
<mxGeometry x="10" y="473" width="80" height="70" as="geometry" />
</mxCell>
<mxCell id="zJVYyOSlNiCVBlA5jEf0-3" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;fillColor=#647687;strokeColor=#314354;" edge="1" parent="1" target="8StUH8aFnwlRlHm0zShF-7">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="100" y="463" as="sourcePoint" />
<mxPoint x="130" y="433" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="iPE2hx-tEKFiySbPAp22-1" value="&lt;font style=&quot;font-size: 11px;&quot;&gt;可用Function受到人格和Workflow的共同影响&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="190" y="318" width="130" height="30" as="geometry" />
</mxCell>
<mxCell id="iPE2hx-tEKFiySbPAp22-2" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="SPnvrlBiOLhgEaWxmdK3-2" target="iPE2hx-tEKFiySbPAp22-1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="230" y="433" as="sourcePoint" />
<mxPoint x="280" y="383" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
View File
+58
View File
@@ -0,0 +1,58 @@
from typing import Optional
import logging
import llm_kernel,llm_work_task
logger = logging.getLogger(__name__)
class agent_msg:
def __init__(self) -> None:
pass
class agent_prompt:
def __init__(self) -> None:
pass
def as_str()->str:
pass
class agent_chat_session:
def __init__(self) -> None:
self.llm_model_name = None
self.llm_instance = None
self.max_token_size = 0
self.chat_msg_list = None
self.enable_function = True
pass
def chat(self,message:str) -> None:
pass
# Key functions, let the AI Agent try to run.
def completion(self)->llm_work_task:
if self.llm_instance is None:
self.llm_instance = llm_kernel.craete(self.llm_model_name)
if self.llm_instance is None:
logger.fatal(f"cann't get llm_kerenel : {self.llm_model_name}")
return
llm_work_task = self.llm_instance.completion(self._get_prompt(),self.max_token_size)
return llm_work_task
def _get_prompt(str) -> str:
pass
class ai_agent:
def __init__(self) -> None:
pass
def get_chat_session(self,chat_user_name:str,session_id:Optional[str]) -> agent_chat_session:
pass
#chat_session = agent.get_default_chat_session("master");
#chat_session.chat("给我讲一个英文笑话!");
#chat_session.completion();
#print(chat_session.last_msg());
+20
View File
@@ -0,0 +1,20 @@
from abc import ABC, abstractmethod
from typing import Any
from .agent import agent,agent_msg
class ai_role:
def __init__(self) -> None:
pass
class agent_group:
def __init__(self) -> None:
self.roles = None
pass
def add_role(self,role_name:str,agent_id:str) -> None:
pass
def send_msg(self,role_name:str,msg:agent_msg) -> None:
pass
+6
View File
@@ -0,0 +1,6 @@
from .workflow import ai_workflow
from agent import agent_msg
class aios_shell:
def send_msg(self,msg:agent_msg,target:ai_workflow) -> None:
pass
+29
View File
@@ -0,0 +1,29 @@
from compute_node import compute_node
from abc import ABC, abstractmethod
# How to dispatch different computing tasks (some tasks may contain a large amount of state for correct execution)
# to suitable computing nodes, achieving a balance of speed, cost, and power consumption,
# is the CORE GOAL of the entire computing task schedule system (aios_kernel).
class compute_task(ABC):
@abstractmethod
def display(self) -> str:
pass
class compute_kernel:
def __init__(self) -> None:
pass
def run(self,task:compute_task) -> None:
# check there is compute node can support this task
# add task to working_queue
pass
def start(self):
pass
def add_compute_node(self,node:compute_node):
pass
def disable_compute_node(self,):
pass
+13
View File
@@ -0,0 +1,13 @@
from abc import ABC, abstractmethod
class compute_node(ABC):
@abstractmethod
def display(self) -> str:
pass
class local_compute_node(compute_node):
def display(self) -> str:
return super().display()
+12
View File
@@ -0,0 +1,12 @@
class environment_event(ABC):
@abstractmethod
def display(self) -> str:
pass
class environment:
def __init__(self) -> None:
pass
def event_to_msg(self,) -> environment_event:
pass
+14
View File
@@ -0,0 +1,14 @@
class llm_work_task:
def __init__(self) -> None:
pass
class llm_kernel:
def __init__(self) -> None:
pass
def completion(self,prompt:str,max_token:int) -> llm_work_task:
# craete a llm_work_task ,push on queue's end
# then task_schedule would run this task.(might schedule some work_task to another host)
pass
+6
View File
@@ -0,0 +1,6 @@
from compute_node import compute_node
class open_ai_compute_node(compute_node):
def display(self) -> str:
return super().display()
+38
View File
@@ -0,0 +1,38 @@
import environment
import agent_prompt,agent_msg
class ai_workflow:
def __init__(self) -> None:
self.rule_prompt : agent_prompt = None
self.workflow_config = None
self.context = None
def load_from_disk(self,config_path:str,context_dir_path) -> int:
pass
def send_msg(self,msg:agent_msg,target_group:str = None) -> None:
if target_group is None:
target_group = self.get_default_group()
pass
def run(self):
pass
def _pop_msg(self) -> Tuple[agent_msg,str]:
pass
def get_default_group(self) -> agent_group:
pass
def get_group(self,group_name:str) -> agent_group:
pass
def get_workflow_rule_prompt(self) -> agent_prompt:
return self.rule_prompt
def get_inner_environment(self) -> environment:
pass
def connect_to_environment(self,env:environment) -> None:
pass
-3
View File
@@ -1,3 +0,0 @@
class ai_agent:
def __init__(self) -> None:
pass
+46 -9
View File
@@ -1,11 +1,19 @@
import logging
import toml
from .agent import ai_agent from .agent import ai_agent
from .templete import ai_agent_templete from .templete import ai_agent_templete
from package_manager import pkg_env,pkg_env_mgr,pkg_media_info,media_reader,pkg_install_task
logger = logging.getLogger(__name__)
class agent_manager: class agent_manager:
_instance = None _instance = None
def __init__(self) -> None: def __init__(self) -> None:
self.loaded_agent_instance = {}
pass pass
def __new__(cls): def __new__(cls):
@@ -15,22 +23,51 @@ class agent_manager:
def initial(self,root_dir:str) -> None: def initial(self,root_dir:str) -> None:
pass self.agent_templete_env : pkg_env = pkg_env_mgr().get_env(f"{root_dir}templetes/agent_templetes.cfg")
self.agent_env : pkg_env = pkg_env_mgr().get_env(f"{root_dir}agents/agents.cfg")
if self.agent_templete_env is None:
raise Exception("agent_manager initial failed")
def get(self,agent_id:str) -> ai_agent:
def get(self,agent_id) -> ai_agent: the_agent = self.loaded_agent_instance.get(agent_id)
pass if the_agent:
return the_agent
# try load from disk
agent_media_info = self.agent_env.load(agent_id)
if agent_media_info is None:
return None
the_agent = self._load_agent_from_media(agent_media_info)
if the_agent is None:
logger.warn(f"load agent {agent_id} from media failed!")
return the_agent
def remove(self,agent_id:str)->int:
pass
def get_templete(self,templete_id) -> ai_agent_templete: def get_templete(self,templete_id) -> ai_agent_templete:
template_media_info = self.agent_templete_env.get(templete_id)
if template_media_info is None:
return None
return self._load_templete_from_media(template_media_info)
def install(self,templete_id) -> pkg_install_task:
installer = self.agent_templete_env.get_installer()
return installer.install(templete_id)
def uninstall(self,templete_id) -> int:
pass
def _load_templete_from_media(self,templete_media:pkg_media_info) -> ai_agent_templete:
pass pass
def install(self,templete_id) -> int: def _load_agent_from_media(self,agent_media:pkg_media_info) -> ai_agent:
installer = None
#installer.install(templete_id)
pass pass
def create(self,template,agent_name,agent_last_name,agent_introduce) -> ai_agent: def create(self,template,agent_name,agent_last_name,agent_introduce) -> ai_agent:
pass pass
@@ -0,0 +1,3 @@
from .env import pkg_env_mgr,pkg_env
from .pkg import pkg_info,pkg_media_info
from .installer import pkg_install_task
+4 -4
View File
@@ -19,7 +19,7 @@ INSTALL_TASK_STATE_DOWNLOADING = 3
INSTALL_TASK_STATE_INSTALLING = 4 INSTALL_TASK_STATE_INSTALLING = 4
INSTALL_TAKS_STATE_ERROR = 5 INSTALL_TAKS_STATE_ERROR = 5
class install_task: class pkg_install_task:
def __init__(self,owner:pkg_env) -> None: def __init__(self,owner:pkg_env) -> None:
self.owner = owner self.owner = owner
self.state = INSTALL_TASK_STATE_CHECK_DEPENDENCY self.state = INSTALL_TASK_STATE_CHECK_DEPENDENCY
@@ -35,7 +35,7 @@ class pkg_installer:
self.owner_env = owner_env self.owner_env = owner_env
def install(self,pkg_name:str, def install(self,pkg_name:str,
install_from_dependency = False, can_upgrade = True,skip_depends = False,options = None)->Tuple[install_task,str]: install_from_dependency = False, can_upgrade = True,skip_depends = False,options = None)->Tuple[pkg_install_task,str]:
the_pkg_info : pkg_info = None the_pkg_info : pkg_info = None
is_upgrade : bool = False is_upgrade : bool = False
@@ -74,7 +74,7 @@ class pkg_installer:
return result_task,"already installing" return result_task,"already installing"
logger.info(f"start download&install {pkg_name},install_from_dependency={install_from_dependency},upgrade={is_upgrade},backup={need_backup},target_pkg_info={the_pkg_info}") logger.info(f"start download&install {pkg_name},install_from_dependency={install_from_dependency},upgrade={is_upgrade},backup={need_backup},target_pkg_info={the_pkg_info}")
result_task = install_task() result_task = pkg_install_task()
self.all_tasks[the_pkg_info.cid] = result_task self.all_tasks[the_pkg_info.cid] = result_task
async def download_and_install_pkg()->int: async def download_and_install_pkg()->int:
# check dependency # check dependency
@@ -149,7 +149,7 @@ class pkg_installer:
if depend_task is not None: if depend_task is not None:
logger.debug(f"{pkg.name}'s depend pkg {depend_pkg_name} already in task list") logger.debug(f"{pkg.name}'s depend pkg {depend_pkg_name} already in task list")
continue continue
depend_task = install_task() depend_task = pkg_install_task()
task_list[depend_pkg_name] = depend_task task_list[depend_pkg_name] = depend_task
depend_pkg_info = self.owner_env.lookup(depend_pkg_name) depend_pkg_info = self.owner_env.lookup(depend_pkg_name)
@@ -0,0 +1,9 @@
class media_reader:
def __init__(self):
pass
def load_from_media(self,media_info:str) -> int:
pass
def read(self, inner_path:str):
raise NotImplementedError
+5 -4
View File
@@ -9,12 +9,13 @@ class pkg_info:
self.target_media_type = "dir" self.target_media_type = "dir"
self.source_media_type = "7z" self.source_media_type = "7z"
@classmethod
def parse_pkg_name(cls,pkg_name:str) -> Tuple[str, str, str]:
def parse_pkg_name(pkg_name:str) -> Tuple[str, str, str]: """parse pkg name like test-pkg#nightly#>0.2.31#sha1:323423423 to test-pkg,nightly#>0.2.31,sha1:323423423"""
#return pkg_id,version_str,cid
pass pass
@property @property
def cid(self) -> str: def cid(self) -> str:
return self.cid return self.cid
+12
View File
@@ -0,0 +1,12 @@
import asyncio
async def test_llm_completion_task():
# compute task have engouh meta info to make sure compute_kernel can run it in most suitable compute container
test_task = llm_completion_task()
# add tset_task to compute_kernel's execute queue
compute_kernel.run(test_task)
# wait for test_task
if __name__ == "__main__":
asyncio.run(test_llm_completion_task())
+6
View File
@@ -0,0 +1,6 @@
def test_workflow():
pass