Multiple rounds of conversation cannot work properly using 'conversation_id' #6029

Closed
opened 2026-02-21 18:13:45 -05:00 by yindo · 2 comments
Owner

Originally created by @ZBuer507 on GitHub (Oct 11, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

using conversation_id to start multiple rounds of conversation, history conversation messages connot be used properly in chats, and cannot see the history conversation messages in the background

✔️ Expected Behavior

while using conversation_id, use history conversation messages to answer question

Actual Behavior

cannot

Originally created by @ZBuer507 on GitHub (Oct 11, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.9.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce using conversation_id to start multiple rounds of conversation, history conversation messages connot be used properly in chats, and cannot see the history conversation messages in the background ### ✔️ Expected Behavior while using conversation_id, use history conversation messages to answer question ### ❌ Actual Behavior cannot
yindo added the 🐞 bug label 2026-02-21 18:13:45 -05:00
yindo closed this issue 2026-02-21 18:13:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 11, 2024):

Hello @ZBuer507! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue.

I found some similar discussions and issues related to your problem:

  1. i have problem with messages on conversationID. My agent does not have memory - This discussion is unsolved and might provide insights into similar issues [1].

  2. Loss of multi round dialogue function - This closed issue suggests checking memory settings, ensuring model provider compatibility, and reviewing logs for insights [2].

To ensure multiple rounds of conversation work properly using conversation_id in Dify version 0.9.1:

  • Start a New Conversation: Leave conversation_id empty to generate a new one.
  • Continue a Conversation: Use the existing conversation_id in subsequent calls to maintain history.

Here's a basic example:

import requests
import json

url = 'https://api.dify.ai/v1/chat-messages'
headers = {
    'Authorization': 'Bearer ENTER-YOUR-SECRET-KEY',
    'Content-Type': 'application/json',
}

# Start a new conversation
data_start = {
    "inputs": {},
    "query": "Hello, how are you?",
    "response_mode": "streaming",
    "user": "abc-123"
}

response_start = requests.post(url, headers=headers, data=json.dumps(data_start))
conversation_id = response_start.json().get('conversation_id')

# Continue the conversation
data_continue = {
    "inputs": {},
    "query": "What can you do?",
    "response_mode": "streaming",
    "conversation_id": conversation_id,
    "user": "abc-123"
}

response_continue = requests.post(url, headers=headers, data=json.dumps(data_continue))
print(response_continue.json())

Ensure that the conversation_id is correctly used to maintain the conversation state [3][4].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 11, 2024): <!-- Greeting --> Hello @ZBuer507! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve your issue. <!-- Answer --> I found some similar discussions and issues related to your problem: 1. [i have problem with messages on conversationID. My agent does not have memory](https://github.com/langgenius/dify/discussions/8974) - This discussion is unsolved and might provide insights into similar issues <sup>[[1]](https://github.com/langgenius/dify/discussions/8974)</sup>. 2. [Loss of multi round dialogue function](https://github.com/langgenius/dify/issues/4236) - This closed issue suggests checking memory settings, ensuring model provider compatibility, and reviewing logs for insights <sup>[[2]](https://github.com/langgenius/dify/issues/4236)</sup>. To ensure multiple rounds of conversation work properly using `conversation_id` in Dify version 0.9.1: - **Start a New Conversation**: Leave `conversation_id` empty to generate a new one. - **Continue a Conversation**: Use the existing `conversation_id` in subsequent calls to maintain history. Here's a basic example: ```python import requests import json url = 'https://api.dify.ai/v1/chat-messages' headers = { 'Authorization': 'Bearer ENTER-YOUR-SECRET-KEY', 'Content-Type': 'application/json', } # Start a new conversation data_start = { "inputs": {}, "query": "Hello, how are you?", "response_mode": "streaming", "user": "abc-123" } response_start = requests.post(url, headers=headers, data=json.dumps(data_start)) conversation_id = response_start.json().get('conversation_id') # Continue the conversation data_continue = { "inputs": {}, "query": "What can you do?", "response_mode": "streaming", "conversation_id": conversation_id, "user": "abc-123" } response_continue = requests.post(url, headers=headers, data=json.dumps(data_continue)) print(response_continue.json()) ``` Ensure that the `conversation_id` is correctly used to maintain the conversation state <sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/application-publishing/developing-with-apis.md)</sup><sup>[[4]](https://github.com/langgenius/dify-docs/blob/main/en/guides/application-publishing/developing-with-apis.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@ZBuer507 commented on GitHub (Oct 11, 2024):

#9179 same problem

@ZBuer507 commented on GitHub (Oct 11, 2024): #9179 same problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6029