behitek/simple-rag ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Python package that lets me ask questions about PDF files using a simple RAG setup.

I want it to read one or more PDFs, turn the text into chunks, find the most relevant chunks for a question, rerank those results, and then send the best context to a local Ollama model to generate the answer. It should feel easy to use from a short script, with a clean pipeline object and a few small helper classes for reading PDFs, retrieval, reranking, and the LLM.

Please include a working example that shows how to load a sample PDF, ask a question, and keep chatting with follow up questions in a loop. Use sensible defaults so I can get it running quickly, and make sure it works well with BM25 style retrieval and a cross encoder reranker. If anything depends on setup details, add a simple README style explanation and example config file too.