gkamradt / langchain-tutorials

Overview and tutorial of the LangChain Library
6.76k stars 1.95k forks source link

Ask question that can retrieve answer from multiple chunks #63

Open Swathi-k-hiremath opened 8 months ago

Swathi-k-hiremath commented 8 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 8 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 8 months ago

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