Build with AI

Try a small document question-answering exercise and estimate its API costs at a larger scale.

Your outcome

Write a prompt, check one supported answer and one abstention, then price a stated workload.

Start path →

Read the linked material and try the exercise where provided, then mark the stop complete. Estimated section times exclude exercises. Progress stays in this browser.

  1. Write useful instructions

    Start with a prompt and decide how to judge it before asking a model.

    About 3 min for the linked section and its subsections

    Use this prompt for the fictional room-booking example in the next stop. Save the prompt with the model name so you can repeat the exercise.

    Answer the question using only the supplied passages. Give a short answer and cite the passage ID that supports it. If the passages do not answer the question, reply: Insufficient evidence.
    Expected result

    A supported answer gives both the requested fact and its passage ID. An unsupported answer says 'Insufficient evidence'.

    Check your understanding: How will you check that the answer follows from the passage it cites?

  2. Connect a model to information

    Do the retrieval step by hand with a three-passage collection so you can see exactly what the model receives.

    About 6 min for the linked section and its subsections

    Select the two passages that mention the reading room. In two separate chats, paste the prompt from stop 1, the selected passages, and one question each. Use any chat model you already have, or work through both answers on paper.

    [A] The reading room can be booked for up to 90 minutes.
    [B] The reading room is open Monday through Friday.
    [C] The print desk accepts PDF files.
    
    Question 1: What is the longest reading-room booking?
    Question 2: What does it cost to book the reading room?
    Expected result

    Question 1: 90 minutes [A]. Question 2: Insufficient evidence. Check each answer against the passages, even if the model supplies a citation.

    Check your understanding: If the model guesses a fee, did retrieval find evidence for it or did generation add a claim?

  3. Estimate a workload

    Use the cost planner for a hypothetical larger version of the document assistant.

    Select a priced model in the prefilled planner. The example assumes 2,000 input tokens including retrieved text and 200 output tokens per request, 50 requests per working day, 20 working days, standard pricing and zero cached input. Estimate retrieval, storage and retries separately.

    Expected result

    The monthly workload is 1,000 requests, 2 million input tokens and 200,000 output tokens. The dollar estimate depends on the selected model and its pricing terms.

    Check your understanding: How much does the estimate change if you double only the output tokens?

    Open tool →