deepset-ai / haystack

:mag: AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
17.67k stars 1.91k forks source link

Modify existing chat + RAG cookbook to include previous user chat messages #7868

Closed mrm1001 closed 2 months ago

mrm1001 commented 5 months ago

Modify the demo colab to support memory for user messages.

TuanaCelik commented 4 months ago

For context: https://github.com/deepset-ai/haystack-cookbook/pull/90

This is the PR that we were about to merge in the cookbooks repo. But we didn't because of the user messages not being saved in memory.

julian-risch commented 4 months ago

@vblagoje Let's talk about this issue when you start working on it.

vblagoje commented 4 months ago

For increased visibility: @annthurium @TuanaCelik I have updated the proposed notebook to include user's questions. The main change is the direct question injection into OutputAdapter which in turn saves both question and answer (we already saved that one). I adjusted prompt a bit and used gpt-4 to get fewer "wrong" answers.

I suggest to devrel team to take the notebook referenced above, run it yourself, adjust it where needed (perhaps reduce verbosity etc) and LMK if there is anything else needed for it.

TuanaCelik commented 4 months ago

@vblagoje - thanks for creating this. However this leaves me with the question about the output adaptor. I thought there was some work by you and @julian-risch to remove the output adaptor? In this scenario we need to have it in here because it's the only way we have the user messages correct?

TuanaCelik commented 4 months ago

May I suggest a solution similar to this: https://colab.research.google.com/drive/1kJqMWRrP96YoXek6WIZNlnh-fW1fRvKe?usp=sharing

This means users do not have to worry about output adapters etc as it's all wrapped up in a Memory component. AND, since Vlad is working on a message writer, we may also not even need that!

vblagoje commented 2 months ago

Can we also close this one @julian-risch ?

julian-risch commented 2 months ago

Yes, closed by https://github.com/deepset-ai/haystack-cookbook/pull/110