Update docs/integrations/builtin/app-nodes/n8n-nodes-langchain.openai.md

This commit is contained in:
Deborah 2024-05-16 14:42:21 +01:00 committed by GitHub
parent 07a93b3c87
commit 69c447ac59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,4 +76,6 @@ Once you add a tool connection, the OpenAI node becomes a root node, allowing it
## Using memory with OpenAI assistants
For the **Assistant** > **Message Assistant** operation, you can connect a memory sub-node to preserve and retrieve chat history. This allows the assistant to maintain context across multiple messages. The connected memory sub-node is the source of truth for the assistant's memory. This means that n8n creates a new thread on each run and pre-populates it with messages from the memory sub-node. After the run finishes, n8n updates the memory sub-node with the new messages, and deletes the thread from OpenAI.
For the **Message Assistant** operation, you can connect a memory sub-node to preserve and retrieve chat history. The assistant uses this to maintain context across multiple messages. The connected memory sub-node is the source of truth for the assistant's memory.
To do this, n8n uses OpenAI's [threads](https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages){:target=_blank .external-link}. n8n creates a new thread on each time the node executes, and pre-populates it with messages from the memory sub-node. After the run finishes, n8n updates the memory sub-node with the new messages, and deletes the thread from OpenAI.