Indexing was surprisingly fast. I indexed per sentence. For retrieval I surface the best 3 matches and the put each, together with the pre and post sentences (for more content) into a prompt that determines how to answer.
For long docs, this makes answering detailed questions work very well. But if I want to answer general questions pertaining to the entire doc (in the doc, how many times is XYZ mentioned) Iād need to look at more results, or also embed summaries.
I also indexed long speeches, company FAQs and other docs. This turns them into a Q&A bot with good results.
A lot of people have been playing with this (embeddings + dynamic prompts) to implement document Q&A for a while. GPTIndex @jerryjliu0 and LangChain @hwchase17 are two libraries that can help with this.
Try it hereā¦ sloppyjoe.com/summarize (the first question builds the index, so be prepared to wait or to retry if there is an error)