Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
Updates for PR
elijahbenizzyb4158b3c0ffd
diff --git a/burr/tracking/common/models.py b/burr/tracking/common/models.pyindex ebbe54a6..a06dfb4d 100644--- a/burr/tracking/common/models.py+++ b/burr/tracking/common/models.py@@ -83,6 +83,11 @@ class TransitionModel(IdentifyingModel):class PointerModel(IdentifyingModel):+ """Stores pointers to unique identifiers for an application.+ This is used by a few different places to, say, store parent references+ bewteen application instances.+ """+app_id: strsequence_id: Optional[int]partition_key: Optional[str]diff --git a/examples/conversational-rag/notebook.ipynb b/examples/conversational-rag/notebook.ipynbindex e0192b19..5a9c9099 100644--- a/examples/conversational-rag/notebook.ipynb+++ b/examples/conversational-rag/notebook.ipynb@@ -87,173 +87,173 @@"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n","<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n"," \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",- "<!-- Generated by graphviz version 8.1.0 (20230707.0739)\n",+ "<!-- Generated by graphviz version 10.0.1 (20240210.2158)\n"," -->\n","<!-- Pages: 1 -->\n",- "<svg width=\"1051pt\" height=\"352pt\"\n",- " viewBox=\"0.00 0.00 1050.60 352.30\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",- "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 348.3)\">\n",- "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-348.3 1046.6,-348.3 1046.6,4 -4,4\"/>\n",+ "<svg width=\"1051pt\" height=\"343pt\"\n",+ " viewBox=\"0.00 0.00 1050.60 342.80\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",+ "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 338.8)\">\n",+ "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-338.8 1046.6,-338.8 1046.6,4 -4,4\"/>\n","<g id=\"clust1\" class=\"cluster\">\n","<title>cluster__legend</title>\n",- "<polygon fill=\"#ffffff\" stroke=\"black\" points=\"19.38,-206.3 19.38,-336.3 104.23,-336.3 104.23,-206.3 19.38,-206.3\"/>\n",- "<text text-anchor=\"middle\" x=\"61.8\" y=\"-319\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">Legend</text>\n",+ "<polygon fill=\"#ffffff\" stroke=\"black\" points=\"19.38,-196.8 19.38,-326.8 104.23,-326.8 104.23,-196.8 19.38,-196.8\"/>\n",+ "<text text-anchor=\"middle\" x=\"61.8\" y=\"-309.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">Legend</text>\n","</g>\n",- "<!-- context -->\n",+ "<!-- vector_store -->\n","<g id=\"node1\" class=\"node\">\n",+ "<title>vector_store</title>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M533.05,-63.6C533.05,-63.6 409.45,-63.6 409.45,-63.6 403.45,-63.6 397.45,-57.6 397.45,-51.6 397.45,-51.6 397.45,-12 397.45,-12 397.45,-6 403.45,0 409.45,0 409.45,0 533.05,0 533.05,0 539.05,0 545.05,-6 545.05,-12 545.05,-12 545.05,-51.6 545.05,-51.6 545.05,-57.6 539.05,-63.6 533.05,-63.6\"/>\n",+ "<text text-anchor=\"start\" x=\"430.75\" y=\"-40.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">vector_store</text>\n",+ "<text text-anchor=\"start\" x=\"408.25\" y=\"-12.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">VectorStoreRetriever</text>\n",+ "</g>\n",+ "<!-- context -->\n",+ "<g id=\"node2\" class=\"node\">\n","<title>context</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M636.15,-137.1C636.15,-137.1 590.55,-137.1 590.55,-137.1 584.55,-137.1 578.55,-131.1 578.55,-125.1 578.55,-125.1 578.55,-85.5 578.55,-85.5 578.55,-79.5 584.55,-73.5 590.55,-73.5 590.55,-73.5 636.15,-73.5 636.15,-73.5 642.15,-73.5 648.15,-79.5 648.15,-85.5 648.15,-85.5 648.15,-125.1 648.15,-125.1 648.15,-131.1 642.15,-137.1 636.15,-137.1\"/>\n",- "<text text-anchor=\"start\" x=\"589.35\" y=\"-114\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">context</text>\n",- "<text text-anchor=\"start\" x=\"605.85\" y=\"-86\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M636.15,-141.6C636.15,-141.6 590.55,-141.6 590.55,-141.6 584.55,-141.6 578.55,-135.6 578.55,-129.6 578.55,-129.6 578.55,-90 578.55,-90 578.55,-84 584.55,-78 590.55,-78 590.55,-78 636.15,-78 636.15,-78 642.15,-78 648.15,-84 648.15,-90 648.15,-90 648.15,-129.6 648.15,-129.6 648.15,-135.6 642.15,-141.6 636.15,-141.6\"/>\n",+ "<text text-anchor=\"start\" x=\"589.35\" y=\"-118.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">context</text>\n",+ "<text text-anchor=\"start\" x=\"605.85\" y=\"-90.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "</g>\n",+ "<!-- vector_store->context -->\n",+ "<g id=\"edge3\" class=\"edge\">\n",+ "<title>vector_store->context</title>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M533.57,-64C538.99,-66.94 544.38,-69.91 549.55,-72.8 555.71,-76.25 562.17,-79.95 568.5,-83.63\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"566.58,-86.56 576.98,-88.59 570.12,-80.52 566.58,-86.56\"/>\n","</g>\n","<!-- answer_prompt -->\n",- "<g id=\"node5\" class=\"node\">\n",+ "<g id=\"node6\" class=\"node\">\n","<title>answer_prompt</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M788.75,-208.1C788.75,-208.1 689.15,-208.1 689.15,-208.1 683.15,-208.1 677.15,-202.1 677.15,-196.1 677.15,-196.1 677.15,-156.5 677.15,-156.5 677.15,-150.5 683.15,-144.5 689.15,-144.5 689.15,-144.5 788.75,-144.5 788.75,-144.5 794.75,-144.5 800.75,-150.5 800.75,-156.5 800.75,-156.5 800.75,-196.1 800.75,-196.1 800.75,-202.1 794.75,-208.1 788.75,-208.1\"/>\n",- "<text text-anchor=\"start\" x=\"687.95\" y=\"-185\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">answer_prompt</text>\n",- "<text text-anchor=\"start\" x=\"731.45\" y=\"-157\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M788.75,-207.6C788.75,-207.6 689.15,-207.6 689.15,-207.6 683.15,-207.6 677.15,-201.6 677.15,-195.6 677.15,-195.6 677.15,-156 677.15,-156 677.15,-150 683.15,-144 689.15,-144 689.15,-144 788.75,-144 788.75,-144 794.75,-144 800.75,-150 800.75,-156 800.75,-156 800.75,-195.6 800.75,-195.6 800.75,-201.6 794.75,-207.6 788.75,-207.6\"/>\n",+ "<text text-anchor=\"start\" x=\"687.95\" y=\"-184.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">answer_prompt</text>\n",+ "<text text-anchor=\"start\" x=\"731.45\" y=\"-156.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n","</g>\n","<!-- context->answer_prompt -->\n",- "<g id=\"edge8\" class=\"edge\">\n",+ "<g id=\"edge10\" class=\"edge\">\n","<title>context->answer_prompt</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M648.45,-124.89C656.03,-129.24 664.31,-134 672.68,-138.81\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"670.71,-142.29 681.13,-144.23 674.2,-136.22 670.71,-142.29\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M648.45,-128.01C654.6,-131.29 661.2,-134.82 667.94,-138.42\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"666.06,-141.38 676.53,-143.01 669.36,-135.21 666.06,-141.38\"/>\n","</g>\n","<!-- conversational_rag_response -->\n",- "<g id=\"node2\" class=\"node\">\n",- "<title>conversational_rag_response</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1030.6,-238.1C1030.6,-238.1 841.75,-238.1 841.75,-238.1 835.75,-238.1 829.75,-232.1 829.75,-226.1 829.75,-226.1 829.75,-186.5 829.75,-186.5 829.75,-180.5 835.75,-174.5 841.75,-174.5 841.75,-174.5 1030.6,-174.5 1030.6,-174.5 1036.6,-174.5 1042.6,-180.5 1042.6,-186.5 1042.6,-186.5 1042.6,-226.1 1042.6,-226.1 1042.6,-232.1 1036.6,-238.1 1030.6,-238.1\"/>\n",- "<text text-anchor=\"start\" x=\"840.55\" y=\"-215\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">conversational_rag_response</text>\n",- "<text text-anchor=\"start\" x=\"928.68\" y=\"-187\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",- "</g>\n",- "<!-- standalone_question_prompt -->\n","<g id=\"node3\" class=\"node\">\n",- "<title>standalone_question_prompt</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M351.95,-195.1C351.95,-195.1 164.6,-195.1 164.6,-195.1 158.6,-195.1 152.6,-189.1 152.6,-183.1 152.6,-183.1 152.6,-143.5 152.6,-143.5 152.6,-137.5 158.6,-131.5 164.6,-131.5 164.6,-131.5 351.95,-131.5 351.95,-131.5 357.95,-131.5 363.95,-137.5 363.95,-143.5 363.95,-143.5 363.95,-183.1 363.95,-183.1 363.95,-189.1 357.95,-195.1 351.95,-195.1\"/>\n",- "<text text-anchor=\"start\" x=\"163.4\" y=\"-172\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">standalone_question_prompt</text>\n",- "<text text-anchor=\"start\" x=\"250.78\" y=\"-144\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "<title>conversational_rag_response</title>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M1030.6,-237.6C1030.6,-237.6 841.75,-237.6 841.75,-237.6 835.75,-237.6 829.75,-231.6 829.75,-225.6 829.75,-225.6 829.75,-186 829.75,-186 829.75,-180 835.75,-174 841.75,-174 841.75,-174 1030.6,-174 1030.6,-174 1036.6,-174 1042.6,-180 1042.6,-186 1042.6,-186 1042.6,-225.6 1042.6,-225.6 1042.6,-231.6 1036.6,-237.6 1030.6,-237.6\"/>\n",+ "<text text-anchor=\"start\" x=\"840.55\" y=\"-214.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">conversational_rag_response</text>\n",+ "<text text-anchor=\"start\" x=\"928.68\" y=\"-186.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n","</g>\n","<!-- standalone_question -->\n",- "<g id=\"node7\" class=\"node\">\n",+ "<g id=\"node4\" class=\"node\">\n","<title>standalone_question</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M537.55,-208.1C537.55,-208.1 404.95,-208.1 404.95,-208.1 398.95,-208.1 392.95,-202.1 392.95,-196.1 392.95,-196.1 392.95,-156.5 392.95,-156.5 392.95,-150.5 398.95,-144.5 404.95,-144.5 404.95,-144.5 537.55,-144.5 537.55,-144.5 543.55,-144.5 549.55,-150.5 549.55,-156.5 549.55,-156.5 549.55,-196.1 549.55,-196.1 549.55,-202.1 543.55,-208.1 537.55,-208.1\"/>\n",- "<text text-anchor=\"start\" x=\"403.75\" y=\"-185\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">standalone_question</text>\n",- "<text text-anchor=\"start\" x=\"463.75\" y=\"-157\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M537.55,-207.6C537.55,-207.6 404.95,-207.6 404.95,-207.6 398.95,-207.6 392.95,-201.6 392.95,-195.6 392.95,-195.6 392.95,-156 392.95,-156 392.95,-150 398.95,-144 404.95,-144 404.95,-144 537.55,-144 537.55,-144 543.55,-144 549.55,-150 549.55,-156 549.55,-156 549.55,-195.6 549.55,-195.6 549.55,-201.6 543.55,-207.6 537.55,-207.6\"/>\n",+ "<text text-anchor=\"start\" x=\"403.75\" y=\"-184.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">standalone_question</text>\n",+ "<text text-anchor=\"start\" x=\"463.75\" y=\"-156.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n","</g>\n",- "<!-- standalone_question_prompt->standalone_question -->\n",- "<g id=\"edge10\" class=\"edge\">\n",- "<title>standalone_question_prompt->standalone_question</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M364.14,-169.76C370.16,-170.13 376.17,-170.5 382.11,-170.87\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"381.5,-174.4 391.7,-171.52 381.93,-167.41 381.5,-174.4\"/>\n",+ "<!-- standalone_question->context -->\n",+ "<g id=\"edge2\" class=\"edge\">\n",+ "<title>standalone_question->context</title>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M540.66,-143.57C549.94,-139.2 559.26,-134.81 567.97,-130.71\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"569.32,-133.94 576.88,-126.51 566.34,-127.61 569.32,-133.94\"/>\n","</g>\n",- "<!-- vector_store -->\n",- "<g id=\"node4\" class=\"node\">\n",- "<title>vector_store</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M533.05,-126.1C533.05,-126.1 409.45,-126.1 409.45,-126.1 403.45,-126.1 397.45,-120.1 397.45,-114.1 397.45,-114.1 397.45,-74.5 397.45,-74.5 397.45,-68.5 403.45,-62.5 409.45,-62.5 409.45,-62.5 533.05,-62.5 533.05,-62.5 539.05,-62.5 545.05,-68.5 545.05,-74.5 545.05,-74.5 545.05,-114.1 545.05,-114.1 545.05,-120.1 539.05,-126.1 533.05,-126.1\"/>\n",- "<text text-anchor=\"start\" x=\"430.75\" y=\"-103\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">vector_store</text>\n",- "<text text-anchor=\"start\" x=\"408.25\" y=\"-75\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">VectorStoreRetriever</text>\n",+ "<!-- standalone_question->answer_prompt -->\n",+ "<g id=\"edge11\" class=\"edge\">\n",+ "<title>standalone_question->answer_prompt</title>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M549.82,-175.8C586.3,-175.8 629.57,-175.8 665.4,-175.8\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"665.24,-179.3 675.24,-175.8 665.24,-172.3 665.24,-179.3\"/>\n","</g>\n",- "<!-- vector_store->context -->\n",- "<g id=\"edge2\" class=\"edge\">\n",- "<title>vector_store->context</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M545.17,-100.03C552.76,-100.62 560.31,-101.21 567.46,-101.78\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"567.06,-105.33 577.3,-102.63 567.6,-98.35 567.06,-105.33\"/>\n",+ "<!-- standalone_question_prompt -->\n",+ "<g id=\"node5\" class=\"node\">\n",+ "<title>standalone_question_prompt</title>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M351.95,-185.6C351.95,-185.6 164.6,-185.6 164.6,-185.6 158.6,-185.6 152.6,-179.6 152.6,-173.6 152.6,-173.6 152.6,-134 152.6,-134 152.6,-128 158.6,-122 164.6,-122 164.6,-122 351.95,-122 351.95,-122 357.95,-122 363.95,-128 363.95,-134 363.95,-134 363.95,-173.6 363.95,-173.6 363.95,-179.6 357.95,-185.6 351.95,-185.6\"/>\n",+ "<text text-anchor=\"start\" x=\"163.4\" y=\"-162.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">standalone_question_prompt</text>\n",+ "<text text-anchor=\"start\" x=\"250.78\" y=\"-134.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">str</text>\n",+ "</g>\n",+ "<!-- standalone_question_prompt->standalone_question -->\n",+ "<g id=\"edge7\" class=\"edge\">\n",+ "<title>standalone_question_prompt->standalone_question</title>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M364.14,-164.74C370.01,-165.35 375.87,-165.96 381.66,-166.56\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"380.88,-170 391.19,-167.56 381.61,-163.04 380.88,-170\"/>\n","</g>\n","<!-- answer_prompt->conversational_rag_response -->\n",- "<g id=\"edge4\" class=\"edge\">\n",+ "<g id=\"edge5\" class=\"edge\">\n","<title>answer_prompt->conversational_rag_response</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M801.18,-185.71C806.85,-186.58 812.7,-187.48 818.65,-188.39\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"818.02,-191.99 828.44,-190.05 819.09,-185.07 818.02,-191.99\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M801.18,-185.21C806.7,-186.06 812.4,-186.93 818.2,-187.82\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"817.53,-191.26 827.94,-189.32 818.59,-184.34 817.53,-191.26\"/>\n","</g>\n","<!-- llm_client -->\n",- "<g id=\"node6\" class=\"node\">\n",+ "<g id=\"node7\" class=\"node\">\n","<title>llm_client</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M288.58,-277.1C288.58,-277.1 227.98,-277.1 227.98,-277.1 221.98,-277.1 215.98,-271.1 215.98,-265.1 215.98,-265.1 215.98,-225.5 215.98,-225.5 215.98,-219.5 221.98,-213.5 227.98,-213.5 227.98,-213.5 288.58,-213.5 288.58,-213.5 294.58,-213.5 300.58,-219.5 300.58,-225.5 300.58,-225.5 300.58,-265.1 300.58,-265.1 300.58,-271.1 294.58,-277.1 288.58,-277.1\"/>\n",- "<text text-anchor=\"start\" x=\"226.78\" y=\"-254\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_client</text>\n",- "<text text-anchor=\"start\" x=\"235.03\" y=\"-226\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">OpenAI</text>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M288.58,-267.6C288.58,-267.6 227.98,-267.6 227.98,-267.6 221.98,-267.6 215.98,-261.6 215.98,-255.6 215.98,-255.6 215.98,-216 215.98,-216 215.98,-210 221.98,-204 227.98,-204 227.98,-204 288.58,-204 288.58,-204 294.58,-204 300.58,-210 300.58,-216 300.58,-216 300.58,-255.6 300.58,-255.6 300.58,-261.6 294.58,-267.6 288.58,-267.6\"/>\n",+ "<text text-anchor=\"start\" x=\"226.78\" y=\"-244.5\" font-family=\"Helvetica,sans-Serif\" font-weight=\"bold\" font-size=\"14.00\">llm_client</text>\n",+ "<text text-anchor=\"start\" x=\"235.03\" y=\"-216.5\" font-family=\"Helvetica,sans-Serif\" font-style=\"italic\" font-size=\"14.00\">OpenAI</text>\n","</g>\n","<!-- llm_client->conversational_rag_response -->\n",- "<g id=\"edge5\" class=\"edge\">\n",+ "<g id=\"edge6\" class=\"edge\">\n","<title>llm_client->conversational_rag_response</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M300.74,-243.58C391.45,-239.73 614.31,-229.75 800.75,-217.3 806.59,-216.91 812.57,-216.49 818.61,-216.05\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"818.81,-219.47 828.53,-215.25 818.3,-212.49 818.81,-219.47\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M300.74,-235C391.46,-233.12 614.35,-227.69 800.75,-216.8 806.45,-216.47 812.28,-216.1 818.17,-215.7\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"818.3,-219.2 828.03,-215.02 817.81,-212.22 818.3,-219.2\"/>\n","</g>\n","<!-- llm_client->standalone_question -->\n",- "<g id=\"edge11\" class=\"edge\">\n",+ "<g id=\"edge8\" class=\"edge\">\n","<title>llm_client->standalone_question</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M300.96,-231.67C324.27,-224.04 354.25,-214.24 382.48,-205\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"383.37,-208.07 391.79,-201.63 381.2,-201.42 383.37,-208.07\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M300.96,-223.95C324.07,-217.37 353.72,-208.94 381.74,-200.97\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"382.67,-204.35 391.33,-198.24 380.76,-197.61 382.67,-204.35\"/>\n","</g>\n",- "<!-- standalone_question->context -->\n",- "<g id=\"edge1\" class=\"edge\">\n",- "<title>standalone_question->context</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M535.74,-144.12C546.82,-138.51 558.13,-132.78 568.53,-127.51\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"569.85,-130.25 577.19,-122.61 566.69,-124.01 569.85,-130.25\"/>\n",+ "<!-- _vector_store_inputs -->\n",+ "<g id=\"node8\" class=\"node\">\n",+ "<title>_vector_store_inputs</title>\n",+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"316.95,-54.1 199.6,-54.1 199.6,-9.5 316.95,-9.5 316.95,-54.1\"/>\n",+ "<text text-anchor=\"start\" x=\"214.4\" y=\"-26\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input_texts</text>\n",+ "<text text-anchor=\"start\" x=\"285.65\" y=\"-26\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n","</g>\n",- "<!-- standalone_question->answer_prompt -->\n",- "<g id=\"edge9\" class=\"edge\">\n",- "<title>standalone_question->answer_prompt</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M549.82,-176.3C586.46,-176.3 629.94,-176.3 665.86,-176.3\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"665.75,-179.8 675.75,-176.3 665.75,-172.8 665.75,-179.8\"/>\n",+ "<!-- _vector_store_inputs->vector_store -->\n",+ "<g id=\"edge1\" class=\"edge\">\n",+ "<title>_vector_store_inputs->vector_store</title>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M317.2,-31.8C338.28,-31.8 362.57,-31.8 385.49,-31.8\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"385.46,-35.3 395.46,-31.8 385.46,-28.3 385.46,-35.3\"/>\n","</g>\n","<!-- _context_inputs -->\n",- "<g id=\"node8\" class=\"node\">\n",+ "<g id=\"node9\" class=\"node\">\n","<title>_context_inputs</title>\n",- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"512.68,-44.6 429.83,-44.6 429.83,0 512.68,0 512.68,-44.6\"/>\n",- "<text text-anchor=\"start\" x=\"444.63\" y=\"-16.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">top_k</text>\n",- "<text text-anchor=\"start\" x=\"483.63\" y=\"-16.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">int</text>\n",+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"512.68,-126.1 429.83,-126.1 429.83,-81.5 512.68,-81.5 512.68,-126.1\"/>\n",+ "<text text-anchor=\"start\" x=\"444.63\" y=\"-98\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">top_k</text>\n",+ "<text text-anchor=\"start\" x=\"483.63\" y=\"-98\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">int</text>\n","</g>\n","<!-- _context_inputs->context -->\n",- "<g id=\"edge3\" class=\"edge\">\n",+ "<g id=\"edge4\" class=\"edge\">\n","<title>_context_inputs->context</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M513.1,-35.95C525.2,-40.71 538.24,-46.57 549.55,-53.3 556.48,-57.42 563.43,-62.28 570.06,-67.35\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"567.24,-70.37 577.25,-73.84 571.58,-64.89 567.24,-70.37\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M513.15,-105.55C530.11,-106.28 549.85,-107.12 567.23,-107.87\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"566.6,-111.34 576.74,-108.28 566.9,-104.35 566.6,-111.34\"/>\n","</g>\n","<!-- _standalone_question_prompt_inputs -->\n",- "<g id=\"node9\" class=\"node\">\n",+ "<g id=\"node10\" class=\"node\">\n","<title>_standalone_question_prompt_inputs</title>\n",- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"123.6,-196.1 0,-196.1 0,-130.5 123.6,-130.5 123.6,-196.1\"/>\n",- "<text text-anchor=\"start\" x=\"14.43\" y=\"-168\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">chat_history</text>\n",- "<text text-anchor=\"start\" x=\"92.55\" y=\"-168\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",- "<text text-anchor=\"start\" x=\"25.3\" y=\"-147\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">question</text>\n",- "<text text-anchor=\"start\" x=\"93.3\" y=\"-147\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"123.6,-186.6 0,-186.6 0,-121 123.6,-121 123.6,-186.6\"/>\n",+ "<text text-anchor=\"start\" x=\"25.3\" y=\"-158.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">question</text>\n",+ "<text text-anchor=\"start\" x=\"93.3\" y=\"-158.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">str</text>\n",+ "<text text-anchor=\"start\" x=\"14.43\" y=\"-137.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">chat_history</text>\n",+ "<text text-anchor=\"start\" x=\"92.55\" y=\"-137.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n","</g>\n","<!-- _standalone_question_prompt_inputs->standalone_question_prompt -->\n",- "<g id=\"edge6\" class=\"edge\">\n",+ "<g id=\"edge9\" class=\"edge\">\n","<title>_standalone_question_prompt_inputs->standalone_question_prompt</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M124.07,-163.3C129.7,-163.3 135.53,-163.3 141.45,-163.3\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"141.18,-166.8 151.18,-163.3 141.18,-159.8 141.18,-166.8\"/>\n",- "</g>\n",- "<!-- _vector_store_inputs -->\n",- "<g id=\"node10\" class=\"node\">\n",- "<title>_vector_store_inputs</title>\n",- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"316.95,-113.6 199.6,-113.6 199.6,-69 316.95,-69 316.95,-113.6\"/>\n",- "<text text-anchor=\"start\" x=\"214.4\" y=\"-85.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input_texts</text>\n",- "<text text-anchor=\"start\" x=\"285.65\" y=\"-85.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">list</text>\n",- "</g>\n",- "<!-- _vector_store_inputs->vector_store -->\n",- "<g id=\"edge7\" class=\"edge\">\n",- "<title>_vector_store_inputs->vector_store</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M317.2,-92.12C338.48,-92.43 363.01,-92.78 386.12,-93.1\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"385.92,-96.62 395.97,-93.26 386.02,-89.62 385.92,-96.62\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M124.07,-153.8C129.56,-153.8 135.24,-153.8 141,-153.8\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"140.67,-157.3 150.67,-153.8 140.67,-150.3 140.67,-157.3\"/>\n","</g>\n","<!-- input -->\n","<g id=\"node11\" class=\"node\">\n","<title>input</title>\n",- "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"88.8,-305.6 34.8,-305.6 34.8,-269 88.8,-269 88.8,-305.6\"/>\n",- "<text text-anchor=\"middle\" x=\"61.8\" y=\"-281.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input</text>\n",+ "<polygon fill=\"#ffffff\" stroke=\"black\" stroke-dasharray=\"5,2\" points=\"88.8,-241.1 34.8,-241.1 34.8,-204.5 88.8,-204.5 88.8,-241.1\"/>\n",+ "<text text-anchor=\"middle\" x=\"61.8\" y=\"-217\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">input</text>\n","</g>\n","<!-- function -->\n","<g id=\"node12\" class=\"node\">\n","<title>function</title>\n",- "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M84.23,-250.6C84.23,-250.6 39.38,-250.6 39.38,-250.6 33.38,-250.6 27.38,-244.6 27.38,-238.6 27.38,-238.6 27.38,-226 27.38,-226 27.38,-220 33.38,-214 39.38,-214 39.38,-214 84.23,-214 84.23,-214 90.23,-214 96.23,-220 96.23,-226 96.23,-226 96.23,-238.6 96.23,-238.6 96.23,-244.6 90.23,-250.6 84.23,-250.6\"/>\n",- "<text text-anchor=\"middle\" x=\"61.8\" y=\"-226.5\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">function</text>\n",+ "<path fill=\"#b4d8e4\" stroke=\"black\" d=\"M84.23,-296.1C84.23,-296.1 39.38,-296.1 39.38,-296.1 33.38,-296.1 27.38,-290.1 27.38,-284.1 27.38,-284.1 27.38,-271.5 27.38,-271.5 27.38,-265.5 33.38,-259.5 39.38,-259.5 39.38,-259.5 84.23,-259.5 84.23,-259.5 90.23,-259.5 96.23,-265.5 96.23,-271.5 96.23,-271.5 96.23,-284.1 96.23,-284.1 96.23,-290.1 90.23,-296.1 84.23,-296.1\"/>\n",+ "<text text-anchor=\"middle\" x=\"61.8\" y=\"-272\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">function</text>\n","</g>\n","</g>\n","</svg>\n"],"text/plain": [- "<graphviz.graphs.Digraph at 0x29fede890>"+ "<graphviz.graphs.Digraph at 0x1255f0940>"]},"execution_count": 2,@@ -485,7 +485,7 @@"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n","<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n"," \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",- "<!-- Generated by graphviz version 8.1.0 (20230707.0739)\n",+ "<!-- Generated by graphviz version 10.0.1 (20240210.2158)\n"," -->\n","<!-- Pages: 1 -->\n","<svg width=\"292pt\" height=\"194pt\"\n",@@ -507,14 +507,14 @@"<!-- ai_converse->human_converse -->\n","<g id=\"edge2\" class=\"edge\">\n","<title>ai_converse->human_converse</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M48.07,-149.08C47.48,-143.11 47.26,-136.26 47.43,-129.65\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"50.96,-130.16 48.06,-119.97 43.98,-129.74 50.96,-130.16\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M48.07,-149.08C47.49,-143.25 47.27,-136.59 47.42,-130.14\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"50.89,-130.66 47.98,-120.48 43.9,-130.26 50.89,-130.66\"/>\n","</g>\n","<!-- human_converse->ai_converse -->\n","<g id=\"edge4\" class=\"edge\">\n","<title>human_converse->ai_converse</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M60.19,-118.97C60.78,-124.95 60.99,-131.8 60.82,-138.4\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"57.28,-137.89 60.18,-148.08 64.27,-138.31 57.28,-137.89\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M60.19,-118.97C60.76,-124.8 60.98,-131.46 60.83,-137.92\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"57.36,-137.38 60.27,-147.57 64.34,-137.79 57.36,-137.38\"/>\n","</g>\n","<!-- terminal -->\n","<g id=\"node4\" class=\"node\">\n",@@ -525,8 +525,8 @@"<!-- human_converse->terminal -->\n","<g id=\"edge3\" class=\"edge\">\n","<title>human_converse->terminal</title>\n",- "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M54.12,-82.03C54.12,-71.91 54.12,-58.91 54.12,-47.35\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"57.63,-47.43 54.12,-37.43 50.63,-47.43 57.63,-47.43\"/>\n",+ "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M54.12,-82.03C54.12,-72.01 54.12,-59.18 54.12,-47.71\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"57.63,-47.95 54.13,-37.95 50.63,-47.95 57.63,-47.95\"/>\n","<text text-anchor=\"middle\" x=\"98.38\" y=\"-54.2\" font-family=\"Times,serif\" font-size=\"14.00\">'exit' in question</text>\n","</g>\n","<!-- input__user_question -->\n",@@ -538,14 +538,14 @@"<!-- input__user_question->human_converse -->\n","<g id=\"edge1\" class=\"edge\">\n","<title>input__user_question->human_converse</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M162.9,-150.6C144.74,-142.4 122.3,-132.28 102.54,-123.35\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"104.34,-119.87 93.78,-118.95 101.46,-126.25 104.34,-119.87\"/>\n",+ "<path fill=\"none\" stroke=\"black\" d=\"M162.9,-150.6C144.9,-142.48 122.71,-132.46 103.08,-123.6\"/>\n",+ "<polygon fill=\"black\" stroke=\"black\" points=\"104.72,-120.5 94.16,-119.57 101.84,-126.88 104.72,-120.5\"/>\n","</g>\n","</g>\n","</svg>\n"],"text/plain": [- "<graphviz.graphs.Digraph at 0x29e999b90>"+ "<graphviz.graphs.Digraph at 0x130bc5ff0>"]},"execution_count": 6,@@ -575,7 +575,7 @@},{"cell_type": "code",- "execution_count": 8,+ "execution_count": 7,"id": "8bcfe9ca48f87618","metadata": {"ExecuteTime": {@@ -592,7 +592,7 @@"name": "stdin","output_type": "stream","text": [- "Ask something (or type exit to quit): elijah's favorite food\n"+ "Ask something (or type exit to quit): Who is Stefan? Please answer in English.\n"]},{@@ -600,16 +600,15 @@"output_type": "stream","text": ["⏳Processing input from user...\n",- "🎙💬 elijah's favorite food \n",+ "🎙💬 Who is Stefan? Please answer in English. \n","\n","Ran action human_converse with result:\n",- " {'question': \"elijah's favorite food\"} \n",+ " {'question': 'Who is Stefan? Please answer in English.'} \n"," and state:\n"," {'__PRIOR_STEP': 'human_converse',\n",- " '__SEQUENCE_ID': 1,\n",- " 'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\"],\n",- " 'question': \"elijah's favorite food\"}\n"+ " '__SEQUENCE_ID': 0,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.'],\n",+ " 'question': 'Who is Stefan? Please answer in English.'}\n"]}],@@ -624,7 +623,7 @@},{"cell_type": "code",- "execution_count": 9,+ "execution_count": 8,"id": "81940578d58fd602","metadata": {"ExecuteTime": {@@ -642,17 +641,19 @@"output_type": "stream","text": ["🤔 AI is thinking...\n",- "🤖💬 Mango \n",+ "🤖💬 Stefan is someone who likes tacos, used to work at IBM, worked at Stitch Fix, and likes to bake sourdough. \n","\n","Ran action ai_converse with result:\n",- " {'conversational_rag_response': 'Mango'} \n",+ " {'conversational_rag_response': 'Stefan is someone who likes tacos, used to '\n",+ " 'work at IBM, worked at Stitch Fix, and likes '\n",+ " 'to bake sourdough.'} \n"," and state:\n"," {'__PRIOR_STEP': 'ai_converse',\n",- " '__SEQUENCE_ID': 2,\n",- " 'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango'],\n",- " 'question': \"elijah's favorite food\"}\n"+ " '__SEQUENCE_ID': 1,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.'],\n",+ " 'question': 'Who is Stefan? Please answer in English.'}\n"]}],@@ -680,7 +681,7 @@},{"cell_type": "code",- "execution_count": 10,+ "execution_count": 9,"id": "be6c573158b65cb1","metadata": {"ExecuteTime": {@@ -699,18 +700,94 @@"text": ["Running RAG with initial state:\n"," {'__PRIOR_STEP': 'ai_converse',\n",- " '__SEQUENCE_ID': 2,\n",- " 'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango'],\n",- " 'question': \"elijah's favorite food\"}\n"+ " '__SEQUENCE_ID': 1,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.'],\n",+ " 'question': 'Who is Stefan? Please answer in English.'}\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): where does Elijah work?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 where does Elijah work? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Elijah works at TwoSigma. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): what should I buy him to eat?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 what should I buy him to eat? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 You should buy Elijah some mangoes to eat. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): What type of mangoes does he like?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 What type of mangoes does he like? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 It is not specified what type of mangoes Elijah likes in the given context. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): Who is the most likely person to like corn & beans?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 Who is the most likely person to like corn & beans? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Stefan is most likely to enjoy eating corn and beans. \n",+ "\n"]},{"name": "stdin","output_type": "stream","text": [- "Ask something (or type exit to quit): stefan's favorite food\n"+ "Ask something (or type exit to quit): Why?\n"]},{@@ -718,10 +795,10 @@"output_type": "stream","text": ["⏳Processing input from user...\n",- "🎙💬 stefan's favorite food \n",+ "🎙💬 Why? \n","\n","🤔 AI is thinking...\n",- "🤖💬 Tacos \n",+ "🤖💬 There is no clear indication in the context provided that Stefan would be the most likely person to enjoy eating corn and beans. The information suggests that Stefan enjoys tacos and baking sourdough, but there is nothing regarding his preferences for corn and beans specifically. \n","\n"]},@@ -739,11 +816,24 @@"⏳Processing input from user...\n","🎙💬 exit \n","\n",- "{'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango',\n",- " \"Human: stefan's favorite food\",\n",- " 'AI: Tacos',\n",+ "{'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.',\n"," 'Human: exit']}\n"]}@@ -794,7 +884,7 @@},{"cell_type": "code",- "execution_count": 11,+ "execution_count": 10,"id": "c7f4dd64f73ed2d8","metadata": {"ExecuteTime": {@@ -811,14 +901,27 @@"name": "stdout","output_type": "stream","text": [- "Loaded state from app_id:40043560-be53-4372-955e-3c7c725379b2, sequence_id:4::\n",- " {'__SEQUENCE_ID': 4,\n",- " 'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango',\n",- " \"Human: stefan's favorite food\",\n",- " 'AI: Tacos'],\n",- " 'question': \"stefan's favorite food\"}\n"+ "Loaded state from app_id:63fce731-8cc8-4de0-b8dc-0a5f1a057a11, sequence_id:11::\n",+ " {'__SEQUENCE_ID': 11,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.'],\n",+ " 'question': 'Why?'}\n"]}],@@ -843,7 +946,7 @@},{"cell_type": "code",- "execution_count": null,+ "execution_count": 11,"id": "5ee618e3-15c0-403b-bc96-3a2faaea457e","metadata": {},"outputs": [],@@ -881,7 +984,7 @@},{"cell_type": "code",- "execution_count": null,+ "execution_count": 12,"id": "34140c5864b940dc","metadata": {"ExecuteTime": {@@ -893,7 +996,134 @@"outputs_hidden": false}},- "outputs": [],+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "Running RAG with loaded state:\n",+ " {'__SEQUENCE_ID': 11,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.'],\n",+ " 'question': 'Why?'}\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): does Harrison like pizza?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 does Harrison like pizza? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 There is no information provided in the context to determine whether Harrison likes pizza or not. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): Who should I take to a Mexican restaurant?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 Who should I take to a Mexican restaurant? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Stefan \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): Who worked at TwoSigma?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 Who worked at TwoSigma? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Elijah worked at TwoSigma. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): exit\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 exit \n",+ "\n",+ "{'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.',\n",+ " 'Human: does Harrison like pizza?',\n",+ " 'AI: There is no information provided in the context to '\n",+ " 'determine whether Harrison likes pizza or not.',\n",+ " 'Human: Who should I take to a Mexican restaurant?',\n",+ " 'AI: Stefan',\n",+ " 'Human: Who worked at TwoSigma?',\n",+ " 'AI: Elijah worked at TwoSigma.',\n",+ " 'Human: exit']}\n"+ ]+ }+ ],"source": ["# We can now change test, debug, etc. from this prior state.\n","print(f\"Running RAG with loaded state:\\n {pprint.pformat(state_values)}\")\n",@@ -921,7 +1151,7 @@},{"cell_type": "code",- "execution_count": null,+ "execution_count": 13,"id": "fc62a033644c7b80","metadata": {"ExecuteTime": {@@ -978,7 +1208,7 @@},{"cell_type": "code",- "execution_count": null,+ "execution_count": 14,"id": "b6d23d6d6a6643d0","metadata": {"ExecuteTime": {@@ -990,7 +1220,160 @@"outputs_hidden": false}},- "outputs": [],+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "Running RAG with loaded state:\n",+ " {'__PRIOR_STEP': 'terminal',\n",+ " '__SEQUENCE_ID': 13,\n",+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.',\n",+ " 'Human: exit'],\n",+ " 'question': 'exit'}\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): Tell me what you know about Harrison?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 Tell me what you know about Harrison? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Based on the context provided, I know that Harrison worked at Kensho. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): What about Elijah?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 What about Elijah? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Elijah enjoys biking, likes mango, and has worked at TwoSigma. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): What can you tell me about TwoSigma?\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 What can you tell me about TwoSigma? \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 Elijah worked at TwoSigma. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): quit\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 quit \n",+ "\n",+ "🤔 AI is thinking...\n",+ "🤖💬 There is no information provided indicating whether or not the conversation was ended. \n",+ "\n"+ ]+ },+ {+ "name": "stdin",+ "output_type": "stream",+ "text": [+ "Ask something (or type exit to quit): exit\n"+ ]+ },+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "⏳Processing input from user...\n",+ "🎙💬 exit \n",+ "\n",+ "{'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: What type of mangoes does he like?',\n",+ " 'AI: It is not specified what type of mangoes Elijah likes '\n",+ " 'in the given context.',\n",+ " 'Human: Who is the most likely person to like corn & beans?',\n",+ " 'AI: Stefan is most likely to enjoy eating corn and beans.',\n",+ " 'Human: Why?',\n",+ " 'AI: There is no clear indication in the context provided '\n",+ " 'that Stefan would be the most likely person to enjoy eating '\n",+ " 'corn and beans. The information suggests that Stefan enjoys '\n",+ " 'tacos and baking sourdough, but there is nothing regarding '\n",+ " 'his preferences for corn and beans specifically.',\n",+ " 'Human: exit',\n",+ " 'Human: Tell me what you know about Harrison?',\n",+ " 'AI: Based on the context provided, I know that Harrison '\n",+ " 'worked at Kensho.',\n",+ " 'Human: What about Elijah?',\n",+ " 'AI: Elijah enjoys biking, likes mango, and has worked at '\n",+ " 'TwoSigma.',\n",+ " 'Human: What can you tell me about TwoSigma?',\n",+ " 'AI: Elijah worked at TwoSigma.',\n",+ " 'Human: quit',\n",+ " 'AI: There is no information provided indicating whether or '\n",+ " 'not the conversation was ended.',\n",+ " 'Human: exit']}\n"+ ]+ }+ ],"source": ["print(f\"Running RAG with loaded state:\\n {pprint.pformat(pick_up_where_we_left_off_app.state.get_all())}\")\n","while True:\n",@@ -1021,7 +1404,7 @@},{"cell_type": "code",- "execution_count": 12,+ "execution_count": 22,"id": "84d533ba-fd85-4b67-a6c3-30356cc9b048","metadata": {},"outputs": [],@@ -1073,7 +1456,7 @@},{"cell_type": "code",- "execution_count": 13,+ "execution_count": 23,"id": "a9086e58-eeaa-4886-a113-5c7fd5fe0af0","metadata": {},"outputs": [@@ -1083,20 +1466,21 @@"text": ["Running RAG with loaded state:\n"," {'__SEQUENCE_ID': 5,\n",- " 'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango',\n",- " \"Human: stefan's favorite food\",\n",- " 'AI: Tacos',\n",- " 'Human: exit'],\n",- " 'question': 'exit'}\n"+ " 'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.'],\n",+ " 'question': 'what should I buy him to eat?'}\n"]},{"name": "stdin","output_type": "stream","text": [- "Ask something (or type exit to quit): stefan's food\n"+ "Ask something (or type exit to quit): who should I go on a bike ride with?\n"]},{@@ -1104,10 +1488,10 @@"output_type": "stream","text": ["⏳Processing input from user...\n",- "🎙💬 stefan's food \n",+ "🎙💬 who should I go on a bike ride with? \n","\n","🤔 AI is thinking...\n",- "🤖💬 Tacos \n",+ "🤖💬 You should go on a bike ride with Elijah. \n","\n"]},@@ -1115,7 +1499,7 @@"name": "stdin","output_type": "stream","text": [- "Ask something (or type exit to quit): elijah's food\n"+ "Ask something (or type exit to quit): I have too much flour, who do you think I should gift it to?\n"]},{@@ -1123,10 +1507,10 @@"output_type": "stream","text": ["⏳Processing input from user...\n",- "🎙💬 elijah's food \n",+ "🎙💬 I have too much flour, who do you think I should gift it to? \n","\n","🤔 AI is thinking...\n",- "🤖💬 Mango \n",+ "🤖💬 Based on the context provided, Stefan seems like the best candidate to gift your excess flour to as he enjoys baking sourdough. \n","\n"]},@@ -1144,16 +1528,20 @@"⏳Processing input from user...\n","🎙💬 exit \n","\n",- "{'chat_history': [\"Human: harrison's favorite food\",\n",- " \"Human: elijah's favorite food\",\n",- " 'AI: Mango',\n",- " \"Human: stefan's favorite food\",\n",- " 'AI: Tacos',\n",- " 'Human: exit',\n",- " \"Human: stefan's food\",\n",- " 'AI: Tacos',\n",- " \"Human: elijah's food\",\n",- " 'AI: Mango',\n",+ "{'chat_history': ['Human: Who is Stefan? Please answer in English.',\n",+ " 'AI: Stefan is someone who likes tacos, used to work at IBM, '\n",+ " 'worked at Stitch Fix, and likes to bake sourdough.',\n",+ " 'Human: where does Elijah work?',\n",+ " 'AI: Elijah works at TwoSigma.',\n",+ " 'Human: what should I buy him to eat?',\n",+ " 'AI: You should buy Elijah some mangoes to eat.',\n",+ " 'Human: who should I go on a bike ride with?',\n",+ " 'AI: You should go on a bike ride with Elijah.',\n",+ " 'Human: I have too much flour, who do you think I should '\n",+ " 'gift it to?',\n",+ " 'AI: Based on the context provided, Stefan seems like the '\n",+ " 'best candidate to gift your excess flour to as he enjoys '\n",+ " 'baking sourdough.',\n"," 'Human: exit']}\n"]}@@ -1175,10 +1563,18 @@},{"cell_type": "code",- "execution_count": null,+ "execution_count": 5,"id": "d6523a54-e333-4d5e-941d-d3b28b940500","metadata": {},- "outputs": [],+ "outputs": [+ {+ "name": "stderr",+ "output_type": "stream",+ "text": [+ "LocalTrackingClient returned None while trying to fork from: partition_key:None, app_id:NO_SUCH_APP_ID, sequence_id:None. You explicitly requested to fork from a prior application run, but it does not exist. Defaulting to state defaults instead.\n"+ ]+ }+ ],"source": ["# this should print some warnings:\n","new_app_id = str(uuid.uuid4())\n",@@ -1244,7 +1640,7 @@"name": "python","nbconvert_exporter": "python","pygments_lexer": "ipython3",- "version": "3.11.6"+ "version": "3.10.4"}},"nbformat": 4,