Problem classifier, cannot classify by context #4083

Closed
opened 2026-02-21 18:04:40 -05:00 by yindo · 8 comments
Owner

Originally created by @Geek-Bob on GitHub (Jun 13, 2024).

Originally assigned to: @VincePotato on GitHub.

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.5

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Create two categories and turn on memory:

  1. Timing function
  2. Other

Steps to reproduce:
The first time you say: "I say minutes, you help me to uniformly convert to seconds", chatflow will classify to "other".
The second time you say "5 minutes", chatflow classifies to "timing function".

✔️ Expected Behavior

Comprehensive classification based on historical dialogue and context, rather than simply based on current text. Because it would lose the charm of the LLM.

Actual Behavior

On the conversation alone, the experience is very poor

Originally created by @Geek-Bob on GitHub (Jun 13, 2024). Originally assigned to: @VincePotato on GitHub. ### 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] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.5 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Create two categories and turn on memory: 1. Timing function 2. Other Steps to reproduce: The first time you say: "I say minutes, you help me to uniformly convert to seconds", chatflow will classify to "other". The second time you say "5 minutes", chatflow classifies to "timing function". ### ✔️ Expected Behavior Comprehensive classification based on historical dialogue and context, rather than simply based on current text. Because it would lose the charm of the LLM. ### ❌ Actual Behavior On the conversation alone, the experience is very poor
yindo added the 💪 enhancement label 2026-02-21 18:04:40 -05:00
yindo closed this issue 2026-02-21 18:04:40 -05:00
Author
Owner

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

To resolve the issue where the problem classifier in Dify version 0.6.5, self-hosted using Docker, is not classifying by context as expected, ensure that the vector store configuration is correctly set up. Here are the key configurations you need to verify:

  1. VECTOR_STORE Configuration:
    Ensure that the VECTOR_STORE environment variable is set to weaviate in both the api and worker services.

  2. Weaviate Endpoint and API Key:
    Verify that the WEAVIATE_ENDPOINT and WEAVIATE_API_KEY are correctly set in both the api and worker services.

Here is the relevant part of the docker-compose.yaml file for reference:

services:
  api:
    image: langgenius/dify-api:0.6.10
    restart: always
    environment:
      ...
      VECTOR_STORE: weaviate
      WEAVIATE_ENDPOINT: http://weaviate:8080
      WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
      ...
  worker:
    image: langgenius/dify-api:0.6.10
    restart: always
    environment:
      ...
      VECTOR_STORE: weaviate
      WEAVIATE_ENDPOINT: http://weaviate:8080
      WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
      ...

Ensure that these configurations are correctly set and that the Weaviate service is running and accessible at the specified endpoint.

Additionally, make sure that the Question Classifier node is properly configured. This involves:

  1. Selecting the Input Variable:
    Use the user input variable from the "Start Node" (sys.query) as the input for the question classifier.

  2. Configuring the Inference Model:
    Ensure that the inference model for the classifier is correctly set up. This may involve completing the model setup in "System Settings - Model Provider" and configuring its parameters.

  3. Writing Classification Conditions:
    Manually add multiple classifications by composing keywords or descriptive sentences that fit each classification. This helps the question classifier route the dialogue to the appropriate process path according to the semantics of the user's input.

If the issue persists, check the logs for the api, worker, and weaviate services for any errors or warnings that could provide more insight into the problem [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jun 13, 2024): <!-- Answer --> To resolve the issue where the problem classifier in Dify version 0.6.5, self-hosted using Docker, is not classifying by context as expected, ensure that the vector store configuration is correctly set up. Here are the key configurations you need to verify: 1. **VECTOR_STORE Configuration**: Ensure that the `VECTOR_STORE` environment variable is set to `weaviate` in both the `api` and `worker` services. 2. **Weaviate Endpoint and API Key**: Verify that the `WEAVIATE_ENDPOINT` and `WEAVIATE_API_KEY` are correctly set in both the `api` and `worker` services. Here is the relevant part of the `docker-compose.yaml` file for reference: ```yaml services: api: image: langgenius/dify-api:0.6.10 restart: always environment: ... VECTOR_STORE: weaviate WEAVIATE_ENDPOINT: http://weaviate:8080 WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih ... worker: image: langgenius/dify-api:0.6.10 restart: always environment: ... VECTOR_STORE: weaviate WEAVIATE_ENDPOINT: http://weaviate:8080 WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih ... ``` Ensure that these configurations are correctly set and that the Weaviate service is running and accessible at the specified endpoint. Additionally, make sure that the Question Classifier node is properly configured. This involves: 1. **Selecting the Input Variable**: Use the user input variable from the "Start Node" (sys.query) as the input for the question classifier. 2. **Configuring the Inference Model**: Ensure that the inference model for the classifier is correctly set up. This may involve completing the model setup in "System Settings - Model Provider" and configuring its parameters. 3. **Writing Classification Conditions**: Manually add multiple classifications by composing keywords or descriptive sentences that fit each classification. This helps the question classifier route the dialogue to the appropriate process path according to the semantics of the user's input. If the issue persists, check the logs for the `api`, `worker`, and `weaviate` services for any errors or warnings that could provide more insight into the problem <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/features/workflow/nodes/question-classifier.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@seamys commented on GitHub (Jun 21, 2024):

This component only takes last mesage with zore context. it needs to get an enhancement

@seamys commented on GitHub (Jun 21, 2024): This component only takes last mesage with zore context. it needs to get an enhancement
Author
Owner

@kun321 commented on GitHub (Jul 2, 2024):

image
you can find the memory option, visit https://docs.dify.ai/v/zh-hans/guides/workflow/node/question_classifier

@kun321 commented on GitHub (Jul 2, 2024): ![image](https://github.com/langgenius/dify/assets/124553455/7a32c72f-fb1c-44a7-84bc-2224e4cf3348) you can find the memory option, visit https://docs.dify.ai/v/zh-hans/guides/workflow/node/question_classifier
Author
Owner

@JokerQyou commented on GitHub (Jul 5, 2024):

What are you talking about? There's no memory option in advanced settings, also there is no sys.query variable for workflows' start block. This is from latest (main branch on 00b4cc3cd44439d933a38d0ca28fde9b5c350a05) and using latest images (langgenius/dify-web:0.6.12-fix1).

image

Update: apparently I've misunderstood the documentation. It says "Chatflow" but on the UI there's no mentioning of "Chatflow" anywhere, so I'm constantly confused by "Chatflow" and "Workflow".

image

@JokerQyou commented on GitHub (Jul 5, 2024): What are you talking about? There's no memory option in advanced settings, also there is no `sys.query` variable for workflows' start block. This is from latest (`main` branch on `00b4cc3cd44439d933a38d0ca28fde9b5c350a05`) and using latest images (`langgenius/dify-web:0.6.12-fix1`). ![image](https://github.com/langgenius/dify/assets/1465267/b0cb94d7-8ad2-4415-b890-3a4ccdd01c97) **Update**: apparently I've misunderstood the documentation. It says "Chatflow" but on the UI there's no mentioning of "Chatflow" anywhere, so I'm constantly confused by "Chatflow" and "Workflow". ![image](https://github.com/langgenius/dify/assets/1465267/d30c8185-6131-4677-965a-17f64becf013)
Author
Owner

@crazywoola commented on GitHub (Jul 16, 2024):

Is this issue resolved? @JokerQyou @Geek-Bob

@crazywoola commented on GitHub (Jul 16, 2024): Is this issue resolved? @JokerQyou @Geek-Bob
Author
Owner

@JokerQyou commented on GitHub (Jul 16, 2024):

I think so.

@JokerQyou commented on GitHub (Jul 16, 2024): I think so.
Author
Owner

@Geek-Bob commented on GitHub (Jul 17, 2024):

这个问题解决了吗?

@crazywoola This problem still exists, even though I write prompt words and turn on memory in the advanced level, requiring classification based on historical conversations, it still doesn't work

@Geek-Bob commented on GitHub (Jul 17, 2024): > 这个问题解决了吗? @crazywoola This problem still exists, even though I write prompt words and turn on memory in the advanced level, requiring classification based on historical conversations, it still doesn't work
Author
Owner

@Geek-Bob commented on GitHub (Jul 17, 2024):

I guess the reason is that the classifier only classifies based on the most recent tasks and doesn't refer to the history of the conversation within the XML tags

@Geek-Bob commented on GitHub (Jul 17, 2024): I guess the reason is that the classifier only classifies based on the most recent tasks and doesn't refer to the history of the conversation within the <histories>XML tags
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4083