A better way would be to ask the LLM to generate keywords (or queries). And then use old school techniques to find a set of documents, and then filter those using another LLM.
That whole thing can be simplified to: compute and store embeddings for docs, compute embeddings for query, find most similar docs.