It's interesting to see that this example takes the simplest approach possible, and it seems to provide pretty decent results:
> Third, each word of the list cleaned up above is searched inside the information paragraph. When a word is found, the whole sentence that includes it is extracted. All the sentences found for each and all of the relevant words are put together into a paragraph that is then fed to GPT-3 for few-shot learning.
This is stripping punctuation and stopwords and then doing a straight string match to find the relevant sentences to include in the prompt!
A lot of people - myself included - have been trying semantic search using embeddings to solve this. I wrote about my approach here: https://simonwillison.net/2023/Jan/13/semantic-search-answer...
My version dumps in entire truncated blog entries, but from this piece I'm thinking that breaking down to much smaller snippets (maybe even at the sentence level) is worth investigating further.