π₯³ This week, we published a demo on combining @LangChainAI and #Weaviate
π https://t.co/sWAGGbvUIN
πΉ Or watch @ecardenas300's demo: https://t.co/GVRcPhwyQU
π§΅ Check out the 4 CombineDocument techniques implemented in #LangChain that solve the limited input token lengthsπ
@ecardenas300 π§Έ Stuffing is the simplest method
ποΈ All relevant documents from the database are stuffed into the prompt
@ecardenas300 π Map Reduce applies an initial prompt to each chunk of data, and it passed through the LLM to generate multiple responses
β¨ Another prompt is created to combine all of the initial outputs into one
@ecardenas300 π¬ Refine asks the language model to summarize the documents one by one
π§ It then uses its local memory with the summaries generated so far to influence the next output
π This is repeated until all documents have been processed
@ecardenas300 π Map-Rerank runs an initial prompt that asks the model to give a relevance score for each document
π― The language model then assigns a score based on the certainty of the answer and ranks them
π¬ The top two documents are stuffed into the model to generate a single response