Maybe I'm not getting it, but I see this as an indexing problem. The goal shouldn't be to fit the entire document in the prompt, we should include relevant part of the doc when we query it.
Edit: I'm thinking of something like LlamaIndex
Edit: I'm thinking of something like LlamaIndex