gkamradt / langchain-tutorials

Overview and tutorial of the LangChain Library
6.63k stars 1.92k forks source link

Ask question that can retrieve answer from multiple chunks #63

Open Swathi-k-hiremath opened 6 months ago

Swathi-k-hiremath commented 6 months ago

Suppose i have multiple chunks and I want to build an application where I ask questions that require it to fetch across multiple chunks. For example, I have detailed experience reports of a trek from 100 people and i want to query how many of them went prepared with a first aid kit and how many of them needed to use it. What type of chunking and retrieval is the most appropriate for it?

gkamradt commented 6 months ago

This is one of those tough questions for an LLM because it requires planning and a lot of tokens.

If it were me (and latency and cost weren't too much of an issue), I would ask that question to each trip report, get the answer, then consolidate them in the end.

It'll be a bit manual but you'll get your answer

Swathi-k-hiremath commented 6 months ago

Is there any creative way to utilize chains to achieve the same result without having to query each trip report?