POST /us/statutes/search (retrieve), GET /us/statutes/section/{actId}/body (full text).
Vaquill AI supplies the text and links. Your LLM does the reasoning. Vaquill AI does not replace a lawyer, so carry the official link on every answer.
The pattern in four steps
- Retrieve.
Call
POST /us/statutes/searchwith the user question. SetcorpusTypeandstatewhen you know them (USCfor federal statutes, orSTATEwithstate: "ca"). Take the top few results. - Fetch full text.
Search returns a short
excerpt(500 characters by default, up to 600 withexcerptChars). That ranks results but is too short to ground on. CallGET /us/statutes/section/{actId}/bodyfor each result you cite and use theplaintext. - Build a grounded prompt.
Label each section with its
citationand official source URL. Tell the model to answer only from those sources, cite each claim, and say so when the sources do not answer. - Answer with links.
Return the answer and the cited sources, each linked through
sourceUrl.
includeBody combines steps 1 and 2 in one call. See the one-call tab below.
Step 1 and 2: retrieve, then fetch full text
limit.
Use the two-call version when you rank more candidates than you ground on.
See What a search costs for includeBody billing.
A trimmed search result for that query:
results is cut to its first entry.
Step 3 and 4: build the grounded prompt and answer
Give the model the retrieved text and a label per source. Set three rules: answer only from the sources, cite by citation and link, and refuse when the text does not answer.Python
Scope
Narrow the scope for better retrieval
Narrow the scope for better retrieval
For a federal question, pass
corpusType: "USC" or "CFR".
For one state, pass corpusType: "STATE" with the two-letter state code.
Omit both to search everything.Related
- Grounding LLMs: the concepts behind grounding.
- Pick the best source URL: the full preference order.
- Statute lookup chatbot and Vaquill MCP server: the same loop as a chatbot, or as tools for an AI agent.

