ModifyDocumentsChain adds additional context to docs retrieved from vectorstore based on the metadata and runs before StuffDocumentChain. This helps us #buildinpublic
In many use cases, we would want to add more context to retrieved chunks from vectorstore such as @pinecone before passing to OpenAI to improve the GPT's accuracy.
ModifyDocumentsChain contains chunkModifier method that modifies the doc's content based on the metadata.