Types of Chains in LangChain
1. STUFF
The stuff method is really nice because it’s pretty simple. We just put all of it into one prompt and send that to the language model and get back one response.
So it’s quite simple to understand what’s going on. It’s quite cheap and it works pretty well. But that doesn’t always work. What if we are dealing with a lots of different types of chunks? Then there are a few different methods that we can use.
The first is “Map_reduce”.
2. MAP REDUCE
This takes all the chunks, passes them along with the query to a language model, gets back a response, and then uses another language model call to summarize all of the individual responses into a final answer.
This is really powerful because it can operate over any number of documents, and also because we can process the individual queries in parallel.