Can the "Next Suggested Question" module return three questions based on QA knowledge base calculations? #6373

Closed
opened 2026-02-21 18:15:27 -05:00 by yindo · 7 comments
Owner

Originally created by @tigflanker on GitHub (Oct 28, 2024).

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

In the "Next Suggested Question" feature module, if it is possible to enable calculations related to the QA-type knowledge base and return the three most similar questions, it could be very useful.

For example, if the user's question is "annual card," the three questions with the highest sentence similarity in the knowledge base are: "What should be done with the annual card?", "How much does the annual card cost?", and "What is the annual card?".

They all come from the Questions in the QA knowledge base and/or the Questions in the annotated responses.

Thanks to the R&D experts in the project team.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @tigflanker on GitHub (Oct 28, 2024). ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. In the "Next Suggested Question" feature module, if it is possible to enable calculations related to the QA-type knowledge base and return the three most similar questions, it could be very useful. For example, if the user's question is "annual card," the three questions with the highest sentence similarity in the knowledge base are: "What should be done with the annual card?", "How much does the annual card cost?", and "What is the annual card?". They all come from the Questions in the QA knowledge base and/or the Questions in the annotated responses. Thanks to the R&D experts in the project team. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo closed this issue 2026-02-21 18:15:27 -05:00
Author
Owner

@crazywoola commented on GitHub (Oct 28, 2024):

Duplicated https://github.com/langgenius/dify/issues/9916

@crazywoola commented on GitHub (Oct 28, 2024): Duplicated https://github.com/langgenius/dify/issues/9916
Author
Owner

@tigflanker commented on GitHub (Jun 12, 2025):

@dosu Hi, dosu
我想咨询一个问题,在Dify中,一个应用的历史对话数据会存在什么地方?;例如doris、mysql或者其他dify附带的数据库,有没有办法(接口)导出当日、当月等历史会话数据?

@tigflanker commented on GitHub (Jun 12, 2025): @dosu Hi, dosu 我想咨询一个问题,在Dify中,一个应用的历史对话数据会存在什么地方?;例如doris、mysql或者其他dify附带的数据库,有没有办法(接口)导出当日、当月等历史会话数据?
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

Dify 的历史对话数据默认存储在后端配置的关系型数据库中(通常是 MySQL 或兼容数据库),表结构包括 Message、Conversation、App 等。你可以通过官方 API(如 /api/v1/console/app/{app_id}/logs)获取历史会话数据,这些接口支持按时间(如当日、当月)、用户、会话等条件筛选。虽然没有直接“导出为文件”的功能,但你可以用这些 API 拉取指定时间段的数据,然后自行导出或处理。如果需要更灵活的导出,也可以直接用 SQL 查询数据库。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 12, 2025): <!-- Answer --> Dify 的历史对话数据默认存储在后端配置的关系型数据库中(通常是 MySQL 或兼容数据库),表结构包括 Message、Conversation、App 等。你可以通过官方 API(如 /api/v1/console/app/{app_id}/logs)获取历史会话数据,这些接口支持按时间(如当日、当月)、用户、会话等条件筛选。虽然没有直接“导出为文件”的功能,但你可以用这些 API 拉取指定时间段的数据,然后自行导出或处理。如果需要更灵活的导出,也可以直接用 SQL 查询数据库。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e6908b63-f4b4-4d15-8b1c-12384f69e1db?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/9931)
Author
Owner

@tigflanker commented on GitHub (Jun 12, 2025):

@dosu 能否帮我找找具体的调用案例,或者任何描述这个接口(如 /api/v1/console/app/{app_id}/logs)的页面,我需要去查阅一下使用说明

@tigflanker commented on GitHub (Jun 12, 2025): @dosu 能否帮我找找具体的调用案例,或者任何描述这个接口(如 /api/v1/console/app/{app_id}/logs)的页面,我需要去查阅一下使用说明
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

目前没有找到官方文档中关于 /api/v1/console/app/{app_id}/logs 的详细说明或调用案例,但在代码实现中可以确认,Dify 实际上根据应用类型有不同的日志接口:

  • 工作流类应用(workflow app):/apps/{app_id}/workflow-app-logs
  • 智能体对话类应用(agent-chat app):/apps/{app_id}/agent/logs

以 workflow app 为例,接口支持如下参数:keyword(关键词)、status(succeeded/failed/stopped)、created_at__before、created_at__after(时间过滤)、page、limit。你可以用 GET 请求带这些参数筛选和分页获取日志数据,便于导出当日、当月等历史会话数据。具体实现和参数说明可参考源码

示例请求(以 workflow app 为例):

GET /apps/{app_id}/workflow-app-logs?created_at__after=2024-06-01T00:00:00Z&created_at__before=2024-06-30T23:59:59Z&page=1&limit=100

如需获取 agent-chat app 的日志,则用 /apps/{app_id}/agent/logs,需要传 conversation_id 和 message_id 参数,具体见实现

目前没有找到官方文档页面或现成的调用案例,建议直接参考上述接口和参数说明进行调用。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 12, 2025): <!-- Answer --> 目前没有找到官方文档中关于 /api/v1/console/app/{app_id}/logs 的详细说明或调用案例,但在代码实现中可以确认,Dify 实际上根据应用类型有不同的日志接口: - 工作流类应用(workflow app):/apps/{app_id}/workflow-app-logs - 智能体对话类应用(agent-chat app):/apps/{app_id}/agent/logs 以 workflow app 为例,接口支持如下参数:keyword(关键词)、status(succeeded/failed/stopped)、created_at__before、created_at__after(时间过滤)、page、limit。你可以用 GET 请求带这些参数筛选和分页获取日志数据,便于导出当日、当月等历史会话数据。具体实现和参数说明可参考[源码](https://github.com/langgenius/dify/blob/c05e47ebc0017caba71f1787a10523a96070a53f/api/controllers/console/app/workflow_app_log.py)。 示例请求(以 workflow app 为例): ``` GET /apps/{app_id}/workflow-app-logs?created_at__after=2024-06-01T00:00:00Z&created_at__before=2024-06-30T23:59:59Z&page=1&limit=100 ``` 如需获取 agent-chat app 的日志,则用 `/apps/{app_id}/agent/logs`,需要传 conversation_id 和 message_id 参数,具体见[实现](https://github.com/langgenius/dify/blob/c05e47ebc0017caba71f1787a10523a96070a53f/api/controllers/console/app/agent.py)。 目前没有找到官方文档页面或现成的调用案例,建议直接参考上述接口和参数说明进行调用。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/cc698ebd-fe80-4ab3-838a-0cae0d6e0b19?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/9931)
Author
Owner

@tigflanker commented on GitHub (Jun 13, 2025):

@dosu 请帮我查一下,在dify的容器组里面,用户历史对话数据,最有可能存在哪个数据库中,并且帮我找下相关的登录账号、密码

~$ docker ps | grep docker-
d075981f5d78   nginx:latest                                                    "sh -c 'cp /docker-e…"   20 hours ago   Up 20 hours             0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp                                                              docker-nginx-1
9e92b62c4cb8   langgenius/dify-api:1.4.1                                       "/bin/bash /entrypoi…"   20 hours ago   Up 20 hours             5001/tcp                                                                                                                              docker-api-1
15cae170e946   langgenius/dify-plugin-daemon:0.1.1-local                       "/bin/bash -c /app/e…"   20 hours ago   Up 20 hours             0.0.0.0:5003->5003/tcp, :::5003->5003/tcp                                                                                             docker-plugin_daemon-1
c447aa65ba5d   langgenius/dify-api:1.4.1                                       "/bin/bash /entrypoi…"   20 hours ago   Up 20 hours             5001/tcp                                                                                                                              docker-worker-1
2ff81a5153c8   langgenius/dify-web:1.4.1                                       "/bin/sh ./entrypoin…"   20 hours ago   Up 20 hours             3000/tcp                                                                                                                              docker-web-1
4d45c72b0cb5   postgres:15-alpine                                              "docker-entrypoint.s…"   20 hours ago   Up 20 hours (healthy)   5432/tcp                                                                                                                              docker-db-1
303d30a22bdf   redis:6-alpine                                                  "docker-entrypoint.s…"   20 hours ago   Up 20 hours (healthy)   6379/tcp                                                                                                                              docker-redis-1
681e97f33470   langgenius/dify-sandbox:0.2.12                                  "/main"                  20 hours ago   Up 20 hours (healthy)                                                                                                                                         docker-sandbox-1
2b946b9a9cce   ubuntu/squid:latest                                             "sh -c 'cp /docker-e…"   20 hours ago   Up 20 hours             3128/tcp                                                                                                                              docker-ssrf_proxy-1
d98e26df8e44   semitechnologies/weaviate:1.19.0                                "/bin/weaviate --hos…"   20 hours ago   Up 20 hours                                                                                                                                                   docker-weaviate-1
@tigflanker commented on GitHub (Jun 13, 2025): @dosu 请帮我查一下,在dify的容器组里面,用户历史对话数据,最有可能存在哪个数据库中,并且帮我找下相关的登录账号、密码 ``` ~$ docker ps | grep docker- d075981f5d78 nginx:latest "sh -c 'cp /docker-e…" 20 hours ago Up 20 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp docker-nginx-1 9e92b62c4cb8 langgenius/dify-api:1.4.1 "/bin/bash /entrypoi…" 20 hours ago Up 20 hours 5001/tcp docker-api-1 15cae170e946 langgenius/dify-plugin-daemon:0.1.1-local "/bin/bash -c /app/e…" 20 hours ago Up 20 hours 0.0.0.0:5003->5003/tcp, :::5003->5003/tcp docker-plugin_daemon-1 c447aa65ba5d langgenius/dify-api:1.4.1 "/bin/bash /entrypoi…" 20 hours ago Up 20 hours 5001/tcp docker-worker-1 2ff81a5153c8 langgenius/dify-web:1.4.1 "/bin/sh ./entrypoin…" 20 hours ago Up 20 hours 3000/tcp docker-web-1 4d45c72b0cb5 postgres:15-alpine "docker-entrypoint.s…" 20 hours ago Up 20 hours (healthy) 5432/tcp docker-db-1 303d30a22bdf redis:6-alpine "docker-entrypoint.s…" 20 hours ago Up 20 hours (healthy) 6379/tcp docker-redis-1 681e97f33470 langgenius/dify-sandbox:0.2.12 "/main" 20 hours ago Up 20 hours (healthy) docker-sandbox-1 2b946b9a9cce ubuntu/squid:latest "sh -c 'cp /docker-e…" 20 hours ago Up 20 hours 3128/tcp docker-ssrf_proxy-1 d98e26df8e44 semitechnologies/weaviate:1.19.0 "/bin/weaviate --hos…" 20 hours ago Up 20 hours docker-weaviate-1 ```
Author
Owner

@dosubot[bot] commented on GitHub (Jun 13, 2025):

Dify 的用户历史对话数据默认存储在 PostgreSQL 数据库中,你的容器组里就是 docker-db-1 这个 postgres:15-alpine 容器。默认数据库名是 dify,连接信息如下:

  • 主机:db(容器网络内)
  • 端口:5432
  • 用户名:postgres
  • 密码:difyai123456

这些配置可以在 Dify 的 .envdocker-compose.yaml 文件中找到,默认就是上述账号密码。如果你没有自定义过环境变量,直接用这些信息即可连接和导出数据。参考1 参考2

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 13, 2025): <!-- Answer --> Dify 的用户历史对话数据默认存储在 PostgreSQL 数据库中,你的容器组里就是 `docker-db-1` 这个 postgres:15-alpine 容器。默认数据库名是 `dify`,连接信息如下: - 主机:db(容器网络内) - 端口:5432 - 用户名:postgres - 密码:difyai123456 这些配置可以在 Dify 的 `.env` 或 `docker-compose.yaml` 文件中找到,默认就是上述账号密码。如果你没有自定义过环境变量,直接用这些信息即可连接和导出数据。[参考1](https://github.com/langgenius/dify/blob/c05e47ebc0017caba71f1787a10523a96070a53f/docker/.env.example) [参考2](https://github.com/langgenius/dify/blob/c05e47ebc0017caba71f1787a10523a96070a53f/docker/docker-compose.yaml) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c367da50-01fb-4135-9192-52afe76c9f78?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/9931)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6373