Regulatory compliance

A compliance line that answers from the documentation, or says it cannot

A PIN-gated voice agent answering regulatory questions from verified documentation only, sitting on a knowledge base that keeps itself current without a developer.

Client: A disability-sector compliance advisory

System flow and narrative

Caller PIN
Retrieval
A compliance line that answers from the documentation, or says it cannot: system flowCaller PIN: Valid. Retrieval: Match found. Path: Inbound call, then Document changed, then Weekly source crawl, then PIN collected, then Downloaded, chunked, then Checksum compared, then PIN validated, then Vector store updated, then Bridged to the agent, then Spoken question, then Semantic retrieval, then Answered from docs.Inbound callTwilioDocument changedGoogle DriveWeekly source crawlFirecrawlPIN collectedTwilio webhookDownloaded, chunkedn8nChecksum comparedn8nPIN validatedCompany registryVector store updatedPineconeBridged to the agentRetell AICall ends cleanlyTwilioSpoken questionRetell AISemantic retrievalPineconeAnswered from docsOpenAIFallback returnedRetell AI

Caller PIN: Valid. Retrieval: Match found. Path: Inbound call, then Document changed, then Weekly source crawl, then PIN collected, then Downloaded, chunked, then Checksum compared, then PIN validated, then Vector store updated, then Bridged to the agent, then Spoken question, then Semantic retrieval, then Answered from docs.

A compliance line that answers from the documentation, or says it cannot: system flow

Edges: live is a thicker, full-opacity, travelling dashed line; not taken is a thinner, dimmed, solid line. Nodes: live is a thicker, full-opacity outline; not taken is a thinner, dimmed outline. Color is never the only signal.

01

The call is authenticated before it is a conversation

An inbound call hits a Twilio webhook, which returns instructions to collect a PIN. That PIN is validated against a company registry before anything else happens. A valid PIN bridges the caller to the voice agent. An invalid one ends the call cleanly rather than dropping it mid-flow or leaving a half-open session behind. Authentication sits at the front because the system speaks to callers about regulatory obligations, and who is asking is part of the answer being appropriate.

02

Answering strictly from what is on file

Spoken questions route to an agent that retrieves exclusively from a vector store built out of verified compliance documentation. When retrieval finds something relevant, the caller gets an answer grounded in it. When nothing relevant is found, the agent returns a defined fallback rather than inventing a plausible one. That second path is the point of the whole design: in a compliance context a confident wrong answer is worse than no answer, so the system is built to be able to say it does not know.

03

The knowledge base maintains itself

The requirement was that the system stay accurate without developer intervention, so two workflows keep the store current and run independently of any call. A Drive webhook syncs the knowledge base as documents are created, updated or deleted, and a deletion removes the corresponding vectors, so withdrawn guidance cannot be quoted back to a caller weeks later. It is the same Pinecone store the retrieval step reads, which is why a withdrawn document stops being answerable the moment it is deleted. These run on their own trigger, which is why they sit beside the call path on this diagram rather than inside it.

04

Crawling without re-reading the whole web

A fourth workflow crawls a maintained list of compliance URLs weekly, checksums each page against what it stored last time, and skips anything unchanged. Most regulatory pages do not change from week to week, so the checksum step is what keeps a weekly crawl from becoming a weekly reprocessing of the entire corpus. It is a small decision that decides whether the maintenance workflow is sustainable or merely possible.

The branch logic, as a table.

Every conditional branch and every always-on step in the A compliance line that answers from the documentation, or says it cannot system: the condition or trigger that fires it, the step it leads to, and, where there is one, a note on why that branch exists
ConditionThenWhy
Caller PIN is ValidBridged to the agent
Caller PIN is InvalidCall ends cleanlyno partial session is left open
Caller PIN is ValidSpoken question
Caller PIN is ValidSemantic retrieval
Caller PIN is Valid, and Retrieval is Match foundAnswered from docs
Caller PIN is Valid, and Retrieval is Nothing relevantFallback returnedno relevant document, so no answer is invented
created, updated or deletedDownloaded, chunked

The stack.

Every layer of the A compliance line that answers from the documentation, or says it cannot stack and the tools used at each layer
LayerTools
TelephonyTwilio
Voice AIRetell AI
Orchestrationn8n
Language modelOpenAI
Vector storePinecone
Source crawlingFirecrawl
DocumentsGoogle Workspace, Google Drive
Access controlCompany PIN registry

Compliance notes.

  • Authentication sits at every external boundary, with credentials held in a credential store rather than hardcoded into the workflow.
  • Retrieval is restricted to verified documentation, with a defined fallback instead of a guess when nothing relevant is found.
  • A deletion in Drive removes the corresponding vectors in the same sync, so withdrawn guidance cannot be quoted back to a caller.
  • Deliberate pauses precede every download and every batch upsert, keeping the system inside published rate limits.
  • Failure paths are explicit rather than incidental: clean exits on bad PINs, fallback routing when retrieval finds nothing, and null-safety in the parsing code.

Before and after.

Knowledge base currency
Before: Updated by a developer when someone noticed it had driftedAfter: Drive changes and a weekly crawl keep it current with no developer involved
Answer discipline
Before: General model knowledge, unverifiable by the callerAfter: Verified documentation only, with a defined fallback when nothing matches
Caller access
Before: Questions answered by staff, during office hoursAfter: A PIN-gated line answering from the same documentation, at any hour
Crawl cost
Before: Every listed page refetched and reprocessed on every runAfter: Pages checksummed and skipped when nothing has changed
Withdrawn guidance
Before: Superseded documents stayed answerable until someone cleaned upAfter: A deletion removes its vectors in the same sync

This is one delivered system, published in full. See how we build AI automation

Want this on your own stack? See our n8n automation agency page.

Start a conversation

Tell us what you’re building.

Share the essentials and we’ll reply within 4 hours with a real next step, not an auto-responder.

What happens next

  1. We reply within 4 hours, from a real person, not an auto-responder.
  2. A short scoping call to understand the goal, constraints, and timeline.
  3. A fixed-scope discovery sprint: a working prototype and a written estimate.
Office
Austin, TX, United States
Hours
Mon–Fri · Async + scheduled calls

Fields marked are required. By sending you agree to our Privacy Policy.