-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmanual-REMO-langflow.json
1 lines (1 loc) · 17 KB
/
manual-REMO-langflow.json
1
{"description":"This is an attempt to use REMO.\nFunctioning saving and searching.\nTree maintenance also implemented.\nrebuild_tree added and runs after every save.","name":"REMO v7 public manual","id":"15","data":{"nodes":[{"width":384,"height":351,"id":"dndnode_18","type":"genericNode","position":{"x":2219.912410645471,"y":411.2558951435733},"data":{"type":"ZeroShotAgent","node":{"template":{"llm_chain":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm_chain","type":"LLMChain","list":false},"allowed_tools":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"allowed_tools","type":"Tool","list":true},"_type":"ZeroShotAgent"},"description":"Agent for the MRKL chain.","base_classes":["BaseSingleActionAgent","Agent","ZeroShotAgent","function"]},"id":"dndnode_18","value":null},"positionAbsolute":{"x":2219.912410645471,"y":411.2558951435733},"selected":false,"dragging":false},{"width":384,"height":443,"id":"dndnode_19","type":"genericNode","position":{"x":393.09014178327106,"y":-42.887695736870455},"data":{"type":"ZeroShotPrompt","node":{"template":{"prefix":{"required":false,"placeholder":"","show":true,"multiline":true,"value":"Handle the user input as best you can with the tools provided. \n\nALWAYS save every message with the saveMemory tool. Never try to store a memory as a key-value pair or in a dictionary format.\n\nIf you are missing information, ALWAYS use the searchMemory tool. \n\nIf the user says to organize or maintain your memories, use maintainTree. \n\nIf the user says to rebuild your tree, use rebuildTree.","password":false,"name":"prefix","type":"str","list":false},"suffix":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"Always respond in the following format. Begin!\n\nInput: {input}\n\nThought: {agent_scratchpad}","password":false,"name":"suffix","type":"str","list":false},"format_instructions":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"Use the following format:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question","password":false,"name":"format_instructions","type":"str","list":false},"_type":"zero_shot"},"description":"Prompt template for Zero Shot Agent.","base_classes":["BasePromptTemplate"]},"id":"dndnode_19","value":null},"selected":false,"positionAbsolute":{"x":393.09014178327106,"y":-42.887695736870455},"dragging":false},{"width":384,"height":715,"id":"dndnode_20","type":"genericNode","position":{"x":343.7699264883603,"y":450.4597920954975},"data":{"type":"ChatOpenAI","node":{"template":{"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"verbose","type":"bool","list":false},"client":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"client","type":"Any","list":false},"model_name":{"required":false,"placeholder":"","show":true,"multiline":false,"value":"gpt-4","password":false,"options":["gpt-3.5-turbo","gpt-4","gpt-4-32k"],"name":"model_name","type":"str","list":true},"temperature":{"required":false,"placeholder":"","show":true,"multiline":false,"value":0.7,"password":false,"name":"temperature","type":"float","list":false},"model_kwargs":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"model_kwargs","type":"code","list":false},"openai_api_key":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"","password":true,"name":"openai_api_key","display_name":"OpenAI API Key","type":"str","list":false},"openai_organization":{"required":false,"placeholder":"","show":false,"multiline":false,"password":false,"name":"openai_organization","type":"str","list":false},"request_timeout":{"required":false,"placeholder":"","show":false,"multiline":false,"value":60,"password":false,"name":"request_timeout","type":"int","list":false},"max_retries":{"required":false,"placeholder":"","show":false,"multiline":false,"value":6,"password":false,"name":"max_retries","type":"int","list":false},"streaming":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"streaming","type":"bool","list":false},"n":{"required":false,"placeholder":"","show":false,"multiline":false,"value":1,"password":false,"name":"n","type":"int","list":false},"max_tokens":{"required":false,"placeholder":"","show":true,"multiline":false,"password":true,"name":"max_tokens","type":"int","list":false,"value":""},"_type":"ChatOpenAI"},"description":"Wrapper around OpenAI Chat large language models.To use, you should have the ``openai`` python package installed, and theenvironment variable ``OPENAI_API_KEY`` set with your API key.Any parameters that are valid to be passed to the openai.create call can be passedin, even if not explicitly saved on this class.","base_classes":["ChatOpenAI","BaseLanguageModel","BaseChatModel"]},"id":"dndnode_20","value":null},"selected":false,"positionAbsolute":{"x":343.7699264883603,"y":450.4597920954975},"dragging":false},{"width":384,"height":349,"id":"dndnode_25","type":"genericNode","position":{"x":1270.385068858966,"y":336.3913446161787},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# use this method to save a memory with a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: format the memory for url encoding\n from urllib.parse import quote\n formatted_memory = quote(memory)\n \n # Step 2: create an integer timestamp\n import time\n timestamp = int(time.time())\n \n # Step 3: Send the POST request to REMO to save the memory\n import requests\n response = requests.post(f\"http://localhost:8000/add_message?message={formatted_memory}&speaker=User×tamp={timestamp}\")\n \n # Step 4: report that the memory has been successfully saved\n return f\"The following memory has been saved with REMO: {memory}.\"","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_25","value":null},"selected":true,"positionAbsolute":{"x":1270.385068858966,"y":336.3913446161787},"dragging":false},{"width":384,"height":391,"id":"dndnode_28","type":"genericNode","position":{"x":815.2910433183426,"y":466.4908096550795},"data":{"type":"LLMChain","node":{"template":{"memory":{"required":false,"placeholder":"","show":true,"multiline":false,"password":false,"name":"memory","type":"BaseMemory","list":false},"verbose":{"required":false,"placeholder":"","show":false,"multiline":false,"value":false,"password":false,"name":"verbose","type":"bool","list":false},"prompt":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"prompt","type":"BasePromptTemplate","list":false},"llm":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"llm","type":"BaseLanguageModel","list":false},"output_key":{"required":false,"placeholder":"","show":false,"multiline":false,"value":"text","password":false,"name":"output_key","type":"str","list":false},"_type":"LLMChain"},"description":"Chain to run queries against LLMs.","base_classes":["LLMChain","Chain"]},"id":"dndnode_28","value":null},"selected":false,"positionAbsolute":{"x":815.2910433183426,"y":466.4908096550795},"dragging":false},{"width":384,"height":463,"id":"dndnode_29","type":"genericNode","position":{"x":1681.5685577633392,"y":298.31613146083293},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"saveREMO","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Saves messages into the AI assistant's permanent memory.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_29","value":null},"selected":false,"positionAbsolute":{"x":1681.5685577633392,"y":298.31613146083293},"dragging":false},{"width":384,"height":463,"id":"dndnode_30","type":"genericNode","position":{"x":1685.5006312831342,"y":1268.5985117314463},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"searchREMO","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Searches for information saved in the AI assistant's permanent memory.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_30","value":null},"selected":false,"positionAbsolute":{"x":1685.5006312831342,"y":1268.5985117314463},"dragging":false},{"width":384,"height":349,"id":"dndnode_31","type":"genericNode","position":{"x":1276.581719217875,"y":1307.9643132760382},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# use this method to search for a memory with a GET request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: format the memory for url encoding\n from urllib.parse import quote\n formatted_memory = quote(memory)\n \n # Step 2: Send the GET request to REMO to search for the memory\n import requests\n response = requests.get(f\"http://localhost:8000/search?query={formatted_memory}\")\n \n # Step 3: Return the found memory\n return f'I have found this memory in REMO: {response.json()[\"results\"][0]}'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_31","value":null},"selected":false,"positionAbsolute":{"x":1276.581719217875,"y":1307.9643132760382},"dragging":false},{"width":384,"height":463,"id":"dndnode_48","type":"genericNode","position":{"x":1685.145026862405,"y":778.5263089298232},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"maintainTree","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Maintains and organizes the AI assistant's permanent memories","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_48","value":null},"selected":false,"positionAbsolute":{"x":1685.145026862405,"y":778.5263089298232},"dragging":false},{"width":384,"height":349,"id":"dndnode_49","type":"genericNode","position":{"x":1273.337293140082,"y":825.0056456888752},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# Maintain memories by making a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: Send POST request to the REMO API to organize memories\n import requests \n requests.post(\"http://localhost:8000/maintain_tree\")\n \n # Step 2: Report that maintain_tree has been triggered successfully\n return 'Memories in REMO have been successfully organized.'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_49","value":null},"selected":false,"positionAbsolute":{"x":1273.337293140082,"y":825.0056456888752},"dragging":false},{"width":384,"height":463,"id":"dndnode_50","type":"genericNode","position":{"x":1690.717285794281,"y":-182.31846101901237},"data":{"type":"Tool","node":{"template":{"name":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"rebuildTree","password":false,"name":"name","type":"str","list":false},"description":{"required":true,"placeholder":"","show":true,"multiline":false,"value":"Recrreates the memory tree of the AI assistant's permanent memory.","password":false,"name":"description","type":"str","list":false},"func":{"required":true,"placeholder":"","show":true,"multiline":false,"password":false,"name":"func","type":"function","list":false},"_type":"Tool"},"description":"","base_classes":["Tool"]},"id":"dndnode_50","value":null},"selected":false,"positionAbsolute":{"x":1690.717285794281,"y":-182.31846101901237},"dragging":false},{"width":384,"height":349,"id":"dndnode_51","type":"genericNode","position":{"x":1271.4087077228264,"y":-158.29310615192855},"data":{"type":"PythonFunction","node":{"template":{"code":{"required":true,"placeholder":"","show":true,"multiline":true,"value":"# Use this method to rebuild memories by making a POST request to the REMO API\ndef python_function(memory: str) -> str:\n \n # Step 1: Send POST request to the REMO API to rebuild memories\n import requests \n requests.post(\"http://localhost:8000/rebuild_tree\")\n \n # Step 2: Report that rebuild_tree has been triggered successfully\n return 'Memory tree in REMO has been successfully rebuilt.'","password":false,"name":"code","type":"code","list":false},"_type":"python_function"},"description":"Python function to be executed.","base_classes":["function"]},"id":"dndnode_51","value":null},"selected":false,"positionAbsolute":{"x":1271.4087077228264,"y":-158.29310615192855},"dragging":false}],"edges":[{"source":"dndnode_19","sourceHandle":"ZeroShotPrompt|dndnode_19|BasePromptTemplate","target":"dndnode_28","targetHandle":"BasePromptTemplate|prompt|dndnode_28","className":"animate-pulse","id":"reactflow__edge-dndnode_19ZeroShotPrompt|dndnode_19|BasePromptTemplate-dndnode_28BasePromptTemplate|prompt|dndnode_28"},{"source":"dndnode_20","sourceHandle":"ChatOpenAI|dndnode_20|ChatOpenAI|BaseLanguageModel|BaseChatModel","target":"dndnode_28","targetHandle":"BaseLanguageModel|llm|dndnode_28","className":"animate-pulse","id":"reactflow__edge-dndnode_20ChatOpenAI|dndnode_20|ChatOpenAI|BaseLanguageModel|BaseChatModel-dndnode_28BaseLanguageModel|llm|dndnode_28"},{"source":"dndnode_28","sourceHandle":"LLMChain|dndnode_28|LLMChain|Chain","target":"dndnode_18","targetHandle":"LLMChain|llm_chain|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_28LLMChain|dndnode_28|LLMChain|Chain-dndnode_18LLMChain|llm_chain|dndnode_18"},{"source":"dndnode_25","sourceHandle":"PythonFunction|dndnode_25|function","target":"dndnode_29","targetHandle":"function|func|dndnode_29","className":"animate-pulse","id":"reactflow__edge-dndnode_25PythonFunction|dndnode_25|function-dndnode_29function|func|dndnode_29"},{"source":"dndnode_31","sourceHandle":"PythonFunction|dndnode_31|function","target":"dndnode_30","targetHandle":"function|func|dndnode_30","className":"animate-pulse","id":"reactflow__edge-dndnode_31PythonFunction|dndnode_31|function-dndnode_30function|func|dndnode_30"},{"source":"dndnode_29","sourceHandle":"Tool|dndnode_29|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_29Tool|dndnode_29|Tool-dndnode_18Tool|allowed_tools|dndnode_18"},{"source":"dndnode_30","sourceHandle":"Tool|dndnode_30|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_30Tool|dndnode_30|Tool-dndnode_18Tool|allowed_tools|dndnode_18","selected":false},{"source":"dndnode_48","sourceHandle":"Tool|dndnode_48|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_48Tool|dndnode_48|Tool-dndnode_18Tool|allowed_tools|dndnode_18"},{"source":"dndnode_49","sourceHandle":"PythonFunction|dndnode_49|function","target":"dndnode_48","targetHandle":"function|func|dndnode_48","className":"animate-pulse","id":"reactflow__edge-dndnode_49PythonFunction|dndnode_49|function-dndnode_48function|func|dndnode_48"},{"source":"dndnode_51","sourceHandle":"PythonFunction|dndnode_51|function","target":"dndnode_50","targetHandle":"function|func|dndnode_50","className":"animate-pulse","id":"reactflow__edge-dndnode_51PythonFunction|dndnode_51|function-dndnode_50function|func|dndnode_50"},{"source":"dndnode_50","sourceHandle":"Tool|dndnode_50|Tool","target":"dndnode_18","targetHandle":"Tool|allowed_tools|dndnode_18","className":"animate-pulse","id":"reactflow__edge-dndnode_50Tool|dndnode_50|Tool-dndnode_18Tool|allowed_tools|dndnode_18"}],"viewport":{"x":89.34239447914001,"y":90.59388014025944,"zoom":0.7641882603825831}},"chat":[]}