AnkitG7/financial-document-rag — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a Python command line chat app that lets someone ask questions about a folder of HDFC financial PDF documents and get accurate answers with sources.

It should read the local PDFs, split them by page, build a searchable local index, and reuse the index on later runs so it starts quickly unless the PDFs changed. The search should work well for both normal wording and exact financial terms, then send the best context to an OpenRouter chat model and stream the answer back in the terminal.

Please include conversation memory so follow up questions work, but keep answers strictly based on the HDFC documents. For every answer, show the source document names, page numbers, short supporting excerpts, and a confidence score. Add simple terminal commands like clear chat, toggle debug, help, quit, plus startup flags to force rebuilding the index or show retrieval debug details.

Use a .env file for the OpenRouter key and model. Make it reliable on Windows terminals and handle API retries gracefully. Look up current docs online if you need to.

Want more depth? Deep Reverse