langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
36.76k stars 4.98k forks source link

Problem classifier, cannot classify by context #5182

Open Geek-Bob opened 3 weeks ago

Geek-Bob commented 3 weeks ago

Self Checks

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

dosubot[bot] commented 3 weeks ago

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.

seamys commented 2 weeks ago

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

kun321 commented 6 days ago

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

JokerQyou commented 4 days ago

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