Skip to main content
Answer legal questions from statute text instead of the model’s memory. Each claim carries a citation and an official source link. Retrieve the governing sections and get their full text. Pass it to your LLM with strict rules: answer only from the sources, cite every claim, and link to the official source. Endpoints: 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

  1. Retrieve. Call POST /us/statutes/search with the user question. Set corpusType and state when you know them (USC for federal statutes, or STATE with state: "ca"). Take the top few results.
  2. Fetch full text. Search returns a short excerpt (500 characters by default, up to 600 with excerptChars). That ranks results but is too short to ground on. Call GET /us/statutes/section/{actId}/body for each result you cite and use the plain text.
  3. Build a grounded prompt. Label each section with its citation and official source URL. Tell the model to answer only from those sources, cite each claim, and say so when the sources do not answer.
  4. 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

The one-call version saves latency, not credits. It costs the search plus the body price for each row that returns text, so cost grows with 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

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.
Last modified on November 11, 2026