← All lessons
Working with financial documents · Lesson 6 of 7

Questionnaire automation

Funds, lenders and service companies answer the same questions again and again. Investors send due diligence questionnaires (DDQs) about the firm, its team, its process and its controls; customers send requests for proposals (RFPs); and almost everyone sends security questionnaires. Each one is a few hundred questions in a spreadsheet or document, worded a little differently from the last, and mostly answered before.

The core is an answer library: every past answer that someone approved, stored with the question it answered, who owns it (legal, compliance, IT security, investor relations), when it was approved, what it applies to (the firm, one fund, one product) and when it needs reviewing again. It's a RAG system where the documents are your own approved answers.

For each new question the system retrieves the closest library entries (keyword and embedding search, as in the RAG course), drafts an answer adapted to the new wording and scope, and cites the entries it used. Where nothing in the library is close, it says so and routes the question to the owner. It shouldn't invent a policy or a number.

Then it flags trouble. Stale answers: anything past its review date, and anything with a number or date that changes (assets under management, headcount, the date of the last audit or penetration test). Contradictions: two library answers that disagree, or a draft that disagrees with another answer in the same questionnaire. These are what a careful person catches, and what an unchecked system gets wrong.

from datetime import date
library = [
    {"q": "Do you have a business continuity plan?", "approved": date(2025, 11, 3)},
    {"q": "Assets under management", "approved": date(2024, 6, 30)},
]
today = date(2026, 10, 1)
stale = [a["q"] for a in library if (today - a["approved"]).days > 365]
print(stale)
Prints
['Assets under management']

Nothing is sent without approval. Each answer goes to its owner, the whole questionnaire gets a final sign-off, and the approved answers go back into the library with the new date, so it gets better with each round. A year is a common review period, but use your firm's own policy.

Practice

Which of these belongs with every entry in the answer library?

More info

Quick reference

DDQDue diligence questionnaire, usually from an investor.
RFPRequest for proposal, usually from a customer.
Answer libraryApproved past answers with owner, date and scope.
StalePast its review date, or a figure that changes over time.
ContradictionTwo answers that can't both be true.
Approval gateNothing goes out until the right people sign off.

The other AI and data engineering courses