Run the Finished App

Execute app.py against a PDF and see the answer in your terminal

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

Running your app

Pass two arguments to app.py:

  1. The path to any PDF on your computer
  2. Your question, in quotes

python app.py invoice.pdf "What is the total amount due?"

On the first run, the app embeds all chunks and saves them to invoice.pdf.cache.json. On every subsequent run, it loads from that file — no API calls, no waiting.

Instructions

Run the following command in your terminal from inside the pdf-rag folder.

  1. Run app.py with invoice.pdf and a question as arguments.