Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: When uploading files in a chat, should the chat scope be narrowed down? #4929

Open
kuschzzp opened this issue Feb 13, 2025 · 3 comments
Labels
question Further information is requested

Comments

@kuschzzp
Copy link
Contributor

Describe your problem

I upload files while chatting, and when I ask questions about what's in the files, the answers aren't accurate.

My idea of this phenomenon is that if I upload files, then the scope of my conversation should be limited to the current file, rather than the entire knowledge base.

What do you think of this?
Image

@kuschzzp kuschzzp added the question Further information is requested label Feb 13, 2025
@KevinHuSh
Copy link
Collaborator

Good suggestion.

@alliecatowo
Copy link

Maybe there could be a config option to assign a weight to more recent files, or weight the chat files heavier than the knowledge base? So between 2 files with the same similarity score, one from the knowledge base, and one from the chat history, it would prefer the chat file.

A ui element to toggle retrieval from the knowledgebase could be a nice and elegant solution as well.

@kuschzzp
Copy link
Contributor Author

@KevinHuSh @alliecatowo Thanks for reply.

The current performance of the main branch code is:

  • Create A knowledge base and upload a file.
  • Create dialog and conversation to ask questions about the content in A. 【 Can get the correct answer 】
  • Upload a file B in conversation and ask questions in B. 【 Get the right answer 】
  • Upload a file C in conversation and ask questions in C. 【 Get the right answer 】
  • Direct questions to B without attachments. 【Can get correct reply】
  • Direct questions to C without attachments. 【Can get correct reply】
  • In this case, ask questions in file A in the knowledge base without attachments. 【 Did not get a correct reply 】

Once the file is uploaded, the original knowledge in the knowledge base is lost.


I think the better phenomenon is this:

When I include attachments in this conversation, the answer should be based only on this attachments.

When I do not include attachments in this conversation, the answer should be based on the contents of the knowledge base and the contents of the attachments previously uploaded.


To implement the phenomenon I mentioned, you simply need to remove the following code:

for m in messages[:-1]:
if "doc_ids" in m:
attachments.extend(m["doc_ids"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants