{
    "description": "Agent optimized for vector retrieval during conversation and answering questions based on previous dialogue.",
    "nodes": [
        {
            "width": 300,
            "height": 523,
            "id": "chatOpenAI_0",
            "position": {
                "x": 1381.867549919116,
                "y": 212.76900895393834
            },
            "type": "customNode",
            "data": {
                "id": "chatOpenAI_0",
                "label": "ChatOpenAI",
                "version": 2,
                "name": "chatOpenAI",
                "type": "ChatOpenAI",
                "baseClasses": ["ChatOpenAI", "BaseChatModel", "BaseLanguageModel"],
                "category": "Chat Models",
                "description": "Wrapper around OpenAI large language models that use the Chat endpoint",
                "inputParams": [
                    {
                        "label": "Connect Credential",
                        "name": "credential",
                        "type": "credential",
                        "credentialNames": ["openAIApi"],
                        "id": "chatOpenAI_0-input-credential-credential"
                    },
                    {
                        "label": "Model Name",
                        "name": "modelName",
                        "type": "options",
                        "options": [
                            {
                                "label": "gpt-4",
                                "name": "gpt-4"
                            },
                            {
                                "label": "gpt-4-0613",
                                "name": "gpt-4-0613"
                            },
                            {
                                "label": "gpt-4-32k",
                                "name": "gpt-4-32k"
                            },
                            {
                                "label": "gpt-4-32k-0613",
                                "name": "gpt-4-32k-0613"
                            },
                            {
                                "label": "gpt-3.5-turbo",
                                "name": "gpt-3.5-turbo"
                            },
                            {
                                "label": "gpt-3.5-turbo-0613",
                                "name": "gpt-3.5-turbo-0613"
                            },
                            {
                                "label": "gpt-3.5-turbo-16k",
                                "name": "gpt-3.5-turbo-16k"
                            },
                            {
                                "label": "gpt-3.5-turbo-16k-0613",
                                "name": "gpt-3.5-turbo-16k-0613"
                            }
                        ],
                        "default": "gpt-3.5-turbo",
                        "optional": true,
                        "id": "chatOpenAI_0-input-modelName-options"
                    },
                    {
                        "label": "Temperature",
                        "name": "temperature",
                        "type": "number",
                        "default": 0.9,
                        "optional": true,
                        "id": "chatOpenAI_0-input-temperature-number"
                    },
                    {
                        "label": "Max Tokens",
                        "name": "maxTokens",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-maxTokens-number"
                    },
                    {
                        "label": "Top Probability",
                        "name": "topP",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-topP-number"
                    },
                    {
                        "label": "Frequency Penalty",
                        "name": "frequencyPenalty",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-frequencyPenalty-number"
                    },
                    {
                        "label": "Presence Penalty",
                        "name": "presencePenalty",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-presencePenalty-number"
                    },
                    {
                        "label": "Timeout",
                        "name": "timeout",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-timeout-number"
                    },
                    {
                        "label": "BasePath",
                        "name": "basepath",
                        "type": "string",
                        "optional": true,
                        "additionalParams": true,
                        "id": "chatOpenAI_0-input-basepath-string"
                    }
                ],
                "inputAnchors": [
                    {
                        "label": "Cache",
                        "name": "cache",
                        "type": "BaseCache",
                        "optional": true,
                        "id": "chatOpenAI_0-input-cache-BaseCache"
                    }
                ],
                "inputs": {
                    "modelName": "gpt-3.5-turbo-16k",
                    "temperature": "0",
                    "maxTokens": "",
                    "topP": "",
                    "frequencyPenalty": "",
                    "presencePenalty": "",
                    "timeout": "",
                    "basepath": ""
                },
                "outputAnchors": [
                    {
                        "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
                        "name": "chatOpenAI",
                        "label": "ChatOpenAI",
                        "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "selected": false,
            "positionAbsolute": {
                "x": 1381.867549919116,
                "y": 212.76900895393834
            },
            "dragging": false
        },
        {
            "width": 300,
            "height": 329,
            "id": "openAIEmbeddings_0",
            "position": {
                "x": 954.0674802999345,
                "y": -196.7034956445692
            },
            "type": "customNode",
            "data": {
                "id": "openAIEmbeddings_0",
                "label": "OpenAI Embeddings",
                "version": 1,
                "name": "openAIEmbeddings",
                "type": "OpenAIEmbeddings",
                "baseClasses": ["OpenAIEmbeddings", "Embeddings"],
                "category": "Embeddings",
                "description": "OpenAI API to generate embeddings for a given text",
                "inputParams": [
                    {
                        "label": "Connect Credential",
                        "name": "credential",
                        "type": "credential",
                        "credentialNames": ["openAIApi"],
                        "id": "openAIEmbeddings_0-input-credential-credential"
                    },
                    {
                        "label": "Strip New Lines",
                        "name": "stripNewLines",
                        "type": "boolean",
                        "optional": true,
                        "additionalParams": true,
                        "id": "openAIEmbeddings_0-input-stripNewLines-boolean"
                    },
                    {
                        "label": "Batch Size",
                        "name": "batchSize",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "openAIEmbeddings_0-input-batchSize-number"
                    },
                    {
                        "label": "Timeout",
                        "name": "timeout",
                        "type": "number",
                        "optional": true,
                        "additionalParams": true,
                        "id": "openAIEmbeddings_0-input-timeout-number"
                    },
                    {
                        "label": "BasePath",
                        "name": "basepath",
                        "type": "string",
                        "optional": true,
                        "additionalParams": true,
                        "id": "openAIEmbeddings_0-input-basepath-string"
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "stripNewLines": "",
                    "batchSize": "",
                    "timeout": "",
                    "basepath": ""
                },
                "outputAnchors": [
                    {
                        "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
                        "name": "openAIEmbeddings",
                        "label": "OpenAIEmbeddings",
                        "type": "OpenAIEmbeddings | Embeddings"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "selected": false,
            "positionAbsolute": {
                "x": 954.0674802999345,
                "y": -196.7034956445692
            },
            "dragging": false
        },
        {
            "width": 300,
            "height": 505,
            "id": "pineconeExistingIndex_0",
            "position": {
                "x": 1362.0018461011314,
                "y": -334.0373537488481
            },
            "type": "customNode",
            "data": {
                "id": "pineconeExistingIndex_0",
                "label": "Pinecone Load Existing Index",
                "version": 1,
                "name": "pineconeExistingIndex",
                "type": "Pinecone",
                "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"],
                "category": "Vector Stores",
                "description": "Load existing index from Pinecone (i.e: Document has been upserted)",
                "inputParams": [
                    {
                        "label": "Connect Credential",
                        "name": "credential",
                        "type": "credential",
                        "credentialNames": ["pineconeApi"],
                        "id": "pineconeExistingIndex_0-input-credential-credential"
                    },
                    {
                        "label": "Pinecone Index",
                        "name": "pineconeIndex",
                        "type": "string",
                        "id": "pineconeExistingIndex_0-input-pineconeIndex-string"
                    },
                    {
                        "label": "Pinecone Namespace",
                        "name": "pineconeNamespace",
                        "type": "string",
                        "placeholder": "my-first-namespace",
                        "additionalParams": true,
                        "optional": true,
                        "id": "pineconeExistingIndex_0-input-pineconeNamespace-string"
                    },
                    {
                        "label": "Pinecone Metadata Filter",
                        "name": "pineconeMetadataFilter",
                        "type": "json",
                        "optional": true,
                        "additionalParams": true,
                        "id": "pineconeExistingIndex_0-input-pineconeMetadataFilter-json"
                    },
                    {
                        "label": "Top K",
                        "name": "topK",
                        "description": "Number of top results to fetch. Default to 4",
                        "placeholder": "4",
                        "type": "number",
                        "additionalParams": true,
                        "optional": true,
                        "id": "pineconeExistingIndex_0-input-topK-number"
                    }
                ],
                "inputAnchors": [
                    {
                        "label": "Embeddings",
                        "name": "embeddings",
                        "type": "Embeddings",
                        "id": "pineconeExistingIndex_0-input-embeddings-Embeddings"
                    }
                ],
                "inputs": {
                    "embeddings": "{{openAIEmbeddings_0.data.instance}}",
                    "pineconeIndex": "newindex",
                    "pineconeNamespace": "",
                    "pineconeMetadataFilter": "",
                    "topK": ""
                },
                "outputAnchors": [
                    {
                        "name": "output",
                        "label": "Output",
                        "type": "options",
                        "options": [
                            {
                                "id": "pineconeExistingIndex_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever",
                                "name": "retriever",
                                "label": "Pinecone Retriever",
                                "type": "Pinecone | VectorStoreRetriever | BaseRetriever"
                            },
                            {
                                "id": "pineconeExistingIndex_0-output-vectorStore-Pinecone|VectorStore",
                                "name": "vectorStore",
                                "label": "Pinecone Vector Store",
                                "type": "Pinecone | VectorStore"
                            }
                        ],
                        "default": "retriever"
                    }
                ],
                "outputs": {
                    "output": "retriever"
                },
                "selected": false
            },
            "selected": false,
            "positionAbsolute": {
                "x": 1362.0018461011314,
                "y": -334.0373537488481
            },
            "dragging": false
        },
        {
            "width": 300,
            "height": 383,
            "id": "conversationalRetrievalAgent_0",
            "position": {
                "x": 2345.912948267881,
                "y": 357.97363342258217
            },
            "type": "customNode",
            "data": {
                "id": "conversationalRetrievalAgent_0",
                "label": "Conversational Retrieval Agent",
                "version": 1,
                "name": "conversationalRetrievalAgent",
                "type": "AgentExecutor",
                "baseClasses": ["AgentExecutor", "BaseChain", "Runnable"],
                "category": "Agents",
                "description": "An agent optimized for retrieval during conversation, answering questions based on past dialogue, all using OpenAI's Function Calling",
                "inputParams": [
                    {
                        "label": "System Message",
                        "name": "systemMessage",
                        "type": "string",
                        "rows": 4,
                        "optional": true,
                        "additionalParams": true,
                        "id": "conversationalRetrievalAgent_0-input-systemMessage-string"
                    }
                ],
                "inputAnchors": [
                    {
                        "label": "Allowed Tools",
                        "name": "tools",
                        "type": "Tool",
                        "list": true,
                        "id": "conversationalRetrievalAgent_0-input-tools-Tool"
                    },
                    {
                        "label": "Memory",
                        "name": "memory",
                        "type": "BaseChatMemory",
                        "id": "conversationalRetrievalAgent_0-input-memory-BaseChatMemory"
                    },
                    {
                        "label": "OpenAI Chat Model",
                        "name": "model",
                        "type": "ChatOpenAI",
                        "id": "conversationalRetrievalAgent_0-input-model-ChatOpenAI"
                    }
                ],
                "inputs": {
                    "tools": ["{{retrieverTool_0.data.instance}}"],
                    "memory": "{{bufferMemory_0.data.instance}}",
                    "model": "{{chatOpenAI_0.data.instance}}",
                    "systemMessage": ""
                },
                "outputAnchors": [
                    {
                        "id": "conversationalRetrievalAgent_0-output-conversationalRetrievalAgent-AgentExecutor|BaseChain|Runnable",
                        "name": "conversationalRetrievalAgent",
                        "label": "AgentExecutor",
                        "type": "AgentExecutor | BaseChain | Runnable"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "selected": false,
            "positionAbsolute": {
                "x": 2345.912948267881,
                "y": 357.97363342258217
            },
            "dragging": false
        },
        {
            "width": 300,
            "height": 505,
            "id": "retrieverTool_0",
            "position": {
                "x": 1770.1485365275375,
                "y": -321.14473253480946
            },
            "type": "customNode",
            "data": {
                "id": "retrieverTool_0",
                "label": "Retriever Tool",
                "version": 1,
                "name": "retrieverTool",
                "type": "RetrieverTool",
                "baseClasses": ["RetrieverTool", "DynamicTool", "Tool", "StructuredTool", "Runnable"],
                "category": "Tools",
                "description": "Use a retriever as allowed tool for agent",
                "inputParams": [
                    {
                        "label": "Retriever Name",
                        "name": "name",
                        "type": "string",
                        "placeholder": "search_state_of_union",
                        "id": "retrieverTool_0-input-name-string"
                    },
                    {
                        "label": "Retriever Description",
                        "name": "description",
                        "type": "string",
                        "description": "When should agent uses to retrieve documents",
                        "rows": 3,
                        "placeholder": "Searches and returns documents regarding the state-of-the-union.",
                        "id": "retrieverTool_0-input-description-string"
                    }
                ],
                "inputAnchors": [
                    {
                        "label": "Retriever",
                        "name": "retriever",
                        "type": "BaseRetriever",
                        "id": "retrieverTool_0-input-retriever-BaseRetriever"
                    }
                ],
                "inputs": {
                    "name": "search_website",
                    "description": "Searches and return documents regarding Jane - a culinary institution that offers top quality coffee, pastries, breakfast, lunch, and a variety of baked goods. They have multiple locations, including Jane on Fillmore, Jane on Larkin, Jane the Bakery, Toy Boat By Jane, and Little Jane on Grant. They emphasize healthy eating with a focus on flavor and quality ingredients. They bake everything in-house and work with local suppliers to source ingredients directly from farmers. They also offer catering services and delivery options.",
                    "retriever": "{{pineconeExistingIndex_0.data.instance}}"
                },
                "outputAnchors": [
                    {
                        "id": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable",
                        "name": "retrieverTool",
                        "label": "RetrieverTool",
                        "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "selected": false,
            "dragging": false,
            "positionAbsolute": {
                "x": 1770.1485365275375,
                "y": -321.14473253480946
            }
        },
        {
            "width": 300,
            "height": 376,
            "id": "bufferMemory_0",
            "position": {
                "x": 1771.396291209036,
                "y": 216.94151328212496
            },
            "type": "customNode",
            "data": {
                "id": "bufferMemory_0",
                "label": "Buffer Memory",
                "version": 1,
                "name": "bufferMemory",
                "type": "BufferMemory",
                "baseClasses": ["BufferMemory", "BaseChatMemory", "BaseMemory"],
                "category": "Memory",
                "description": "Remembers previous conversational back and forths directly",
                "inputParams": [
                    {
                        "label": "Memory Key",
                        "name": "memoryKey",
                        "type": "string",
                        "default": "chat_history",
                        "id": "bufferMemory_0-input-memoryKey-string"
                    },
                    {
                        "label": "Input Key",
                        "name": "inputKey",
                        "type": "string",
                        "default": "input",
                        "id": "bufferMemory_0-input-inputKey-string"
                    }
                ],
                "inputAnchors": [],
                "inputs": {
                    "memoryKey": "chat_history",
                    "inputKey": "input"
                },
                "outputAnchors": [
                    {
                        "id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
                        "name": "bufferMemory",
                        "label": "BufferMemory",
                        "type": "BufferMemory | BaseChatMemory | BaseMemory"
                    }
                ],
                "outputs": {},
                "selected": false
            },
            "selected": false,
            "positionAbsolute": {
                "x": 1771.396291209036,
                "y": 216.94151328212496
            },
            "dragging": false
        }
    ],
    "edges": [
        {
            "source": "openAIEmbeddings_0",
            "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings",
            "target": "pineconeExistingIndex_0",
            "targetHandle": "pineconeExistingIndex_0-input-embeddings-Embeddings",
            "type": "buttonedge",
            "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pineconeExistingIndex_0-pineconeExistingIndex_0-input-embeddings-Embeddings",
            "data": {
                "label": ""
            }
        },
        {
            "source": "pineconeExistingIndex_0",
            "sourceHandle": "pineconeExistingIndex_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever",
            "target": "retrieverTool_0",
            "targetHandle": "retrieverTool_0-input-retriever-BaseRetriever",
            "type": "buttonedge",
            "id": "pineconeExistingIndex_0-pineconeExistingIndex_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_0-retrieverTool_0-input-retriever-BaseRetriever",
            "data": {
                "label": ""
            }
        },
        {
            "source": "retrieverTool_0",
            "sourceHandle": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable",
            "target": "conversationalRetrievalAgent_0",
            "targetHandle": "conversationalRetrievalAgent_0-input-tools-Tool",
            "type": "buttonedge",
            "id": "retrieverTool_0-retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-conversationalRetrievalAgent_0-conversationalRetrievalAgent_0-input-tools-Tool",
            "data": {
                "label": ""
            }
        },
        {
            "source": "chatOpenAI_0",
            "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel",
            "target": "conversationalRetrievalAgent_0",
            "targetHandle": "conversationalRetrievalAgent_0-input-model-ChatOpenAI",
            "type": "buttonedge",
            "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel-conversationalRetrievalAgent_0-conversationalRetrievalAgent_0-input-model-ChatOpenAI",
            "data": {
                "label": ""
            }
        },
        {
            "source": "bufferMemory_0",
            "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory",
            "target": "conversationalRetrievalAgent_0",
            "targetHandle": "conversationalRetrievalAgent_0-input-memory-BaseChatMemory",
            "type": "buttonedge",
            "id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-conversationalRetrievalAgent_0-conversationalRetrievalAgent_0-input-memory-BaseChatMemory",
            "data": {
                "label": ""
            }
        }
    ]
}
