Open Sf-teacherspace opened 1 week ago
Hello, @Sf-teacherspace! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 🤖
I found a similar discussion that might be relevant to your issue: How to use Citation and Attribution in chatflow? [1]. This discussion is still open and might provide additional insights.
Regarding your issue, the chatbot has likely stopped making citations from the knowledge base because the citation attribution feature might not be enabled. To resolve this, you need to enable the citation attribution feature by going to Workspace -- Add Function -- Citation and Attribution.
Here are the steps to enable this feature:
For detailed instructions, you can refer to the Citation and Attribution guide [2].
After enabling this feature, the large language model will be able to cite content from the knowledge base, and you can view specific citation paragraph information below the response content.
To continue talking to Dosu, mention @dosu.
@dosu Well I have enable the function - but it stille doesn't work - is it something to do with my prompt? It seems like it takes citations from random sources and not my knowledge base. Maybe it my settings?
The issue with the chatbot not citing sources from your knowledge base, even after enabling the citation attribution feature, could indeed be related to your prompt configuration or retrieval settings.
Verify Retrieval Settings:
Test Retrieval:
Check Prompt Configuration:
Use the following context as your learned knowledge, inside <context></context> XML tags.
<context>
{{#context#}}
</context>
When answering the user:
- If you don't know, just say that you don't know.
- If you don't know when you are not sure, ask for clarification.
Avoid mentioning that you obtained the information from the context.
And answer according to the language of the user's question.
{{pre_prompt}}
{{Query}} // Input query variable here
""
By ensuring that both the retrieval settings and prompt configuration are correctly set up, you can improve the likelihood of the chatbot citing sources from your knowledge base [1][2][3][4].
To continue talking to Dosu, mention @dosu.
@dosu How could the settings look like: Verify Retrieval Settings:
Ensure that the retrieval method and parameters (TopK value and recall threshold) are appropriately configured. These settings significantly impact the recall of relevant segments from the knowledge base. Adjusting these parameters can improve the quality and relevance of the retrieved segments.
To verify and adjust the retrieval settings, you can follow these steps:
Retrieval Method:
TopK Value:
Score Threshold:
Rerank Model:
TopK: 5
Score Threshold: 0.6
Rerank Model: Enabled
TopK: 5
Score Threshold: 0.6
Rerank Model: Enabled
Weight Settings: Custom (e.g., Semantic: 0.7, Keyword: 0.3)
TopK: 5
Score Threshold: 0.6
Rerank Model: Enabled
Navigate to Retrieval Settings:
Select Retrieval Method:
Configure Parameters:
Test Retrieval:
By configuring these settings, you can enhance the retrieval process to ensure that the most relevant and high-quality segments are retrieved from the knowledge base [1][2].
To continue talking to Dosu, mention @dosu.
It still doesn't apply citations :/
Nothing happens in retrieval testing
@dosu
To resolve the issue with citation attribution and retrieval testing, follow these steps:
Navigate to Retrieval Settings:
Select Hybrid Search:
Enable Rerank Model:
Enter Common User Questions:
Test Retrieval:
Go to Workspace:
View Citation Information:
Check Logs:
Adjust Prompt Configuration:
By following these steps, you should be able to resolve the issues with citation attribution and retrieval testing [1][2].
This is a tough nut to crack, could really use your help on this, @takatost.
To continue talking to Dosu, mention @dosu.
@takatost please view the historic and help me solve the issue
@dosu I need more help! the testing doesnt work
To resolve the issues with retrieval testing and citation attribution, let's go through a detailed checklist to ensure everything is configured correctly.
Navigate to Retrieval Settings:
Select Hybrid Search:
Enable Rerank Model:
Enter Common User Questions:
Test Retrieval:
Go to Workspace:
View Citation Information:
Check Logs:
Adjust Prompt Configuration:
Incomplete Recall of Relevant Texts:
TopK
value to recall more segments.Low Quality of Recalled Segments:
TopK
value and the recall score threshold. Increase the threshold to improve the quality of recalled segments.Missing Relevant Segments:
Parameter Configuration Changes Not Taking Effect:
By following these steps and ensuring the settings are correctly configured, you should be able to resolve the issues with retrieval testing and citation attribution [1][2].
Additionally, a maintainer has already been looped in to assist further.
To continue talking to Dosu, mention @dosu.
It seems like it doesnt take knowledge from the base, put outside the base. What car I do to ensure it takes from the base?
@dosu
To ensure that the chatbot retrieves information exclusively from the knowledge base and not from outside sources, follow these steps:
Create and Upload Knowledge Base:
Create Chatbot Application:
Associate Knowledge Base with Chatbot:
Configure Retrieval Settings:
Enable Citation and Attribution:
Debug and Publish:
Weight Settings: Semantic: 0.7, Keyword: 0.3
TopK: 5
Score Threshold: 0.6
Rerank Model: Enabled
Check Logs:
Adjust Prompt Configuration:
By following these steps and ensuring the settings are correctly configured, you can ensure that the chatbot retrieves information exclusively from the knowledge base [1][2][3].
To continue talking to Dosu, mention @dosu.
It says 0 tokens at knowledge - thats the problem??
The issue with the "Indhent viden" (Retrieve Knowledge) step showing 0 tokens indicates that the retrieval process is not successfully fetching any relevant segments from the knowledge base. Here are some steps to troubleshoot and resolve this issue:
Verify Knowledge Base Association:
Check Retrieval Settings:
Test Retrieval:
Enable Citation and Attribution:
Check Logs and Debug:
Weight Settings: Semantic: 0.7, Keyword: 0.3
TopK: 5
Score Threshold: 0.6
Rerank Model: Enabled
Check Knowledge Base Content:
Adjust Prompt Configuration:
By following these steps and ensuring the settings are correctly configured, you should be able to resolve the issue with the retrieval process showing 0 tokens and ensure that the chatbot retrieves information exclusively from the knowledge base [1][2][3].
To continue talking to Dosu, mention @dosu.
I did - but it still says the same
Hello, can you make a minimal reproducable DSL, so we can take a look at.
Hi! Same issue as original poster with basic chatbot and agent. Still works well with Chatflow.
Self Checks
Dify version
Version 0.7.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Expected Behavior
I’m working on creating a chatbot in your program. I’ve built a knowledge base that the chatbot draws information from. Previously, it cited the sources it took from the knowledge base, but it no longer does that. Is this something I’ve done? I’ve been experimenting a bit with the prompt, but could that be where the issue lies? I would like the chatbot to indicate where it gets its information from. It should primarily take it from the knowledge base. What has gone wrong?
❌ Actual Behavior
It has stopped making citations from the knowledge base