Note:
@vaquill-ai/ai-sdk is not published yet, so its install command does not work today.
Until it is released, install it from a checkout of the integrations/vercel-ai directory of the repository.
The Python packages are built on the published vaquill SDK and need Python 3.11 or newer.
The Vercel package is built on the published @vaquill-ai/sdk and needs Node 20 or newer.
Each is MIT licensed.
Use the integrations on a server only. A vq_key_ key must never ship to a browser.
Almost every tool spends credits and an agent can call tools many times in a loop, so each framework section below shows its spend guard.
Batch routes charge the single-call price once per item, so batching saves round trips and never gives a discount.
These are the prices at the time of writing.
GET /api-credits/pricing is the live list, and creditsConsumed on each response is what that call actually billed.
LangChain
langchain-vaquill provides a toolkit, a retriever and LangGraph-compatible tools.
It gives an agent search, citation resolution, section text, amendment history, cited-by, definitions and session laws.
Install
langchain-vaquill[agents] and langchain-openai. This needs langchain 1.0 or newer, which provides create_agent.
Spend guard
Always setmax_credits on the toolkit and the retriever, because an agent can call tools many times in a loop. It is a hard cap: once reached, paid tools return a message telling the model to stop.
Use free_only=True to expose only tools that never spend (vaquill_credit_balance, vaquill_get_pricing, vaquill_statutes_coverage, vaquill_list_boards, vaquill_list_watches and vaquill_extract_citations with its default resolve=false).
Every tool description states what it costs, and vaquill_get_pricing returns the live prices.
Agent
Tool selection
vaquill_create_watch, vaquill_update_watch, vaquill_delete_watch) change the account and exist only with include_watch_tools=True.
Retriever
include_body=True (the default) returns section text and costs the search price plus the section text price per row.
include_body=False returns the excerpt for the search price only.
A call that could push the total past max_credits is refused before any request is sent, with vaquill.SpendGuardExceeded.
Errors, retries and idempotency
Tools never raise SDK exceptions or stack traces at the model. They raiseToolException with an instruction: out of credits (stop), bad key (stop), rate limited (wait, retry once), not found (resolve the citation first), bad arguments (fix and call again), spend cap reached (answer with what you have).
Anything shaped like an API key or bearer token is removed from messages.
Retries, backoff and idempotency keys come from the Python SDK underneath, so they behave as described on the Python SDK page.
You can pass your own client= or async_client= (a vaquill.Vaquill or vaquill.AsyncVaquill) to tune them.
LlamaIndex
llama-index-tools-vaquill ships two import paths.
llama_index.tools.vaquill has VaquillToolSpec for agents, and llama_index.retrievers.vaquill has VaquillRetriever for query engines and pipelines.
Install
Spend guard
The prices are in the table above, and a count is cheaper than a search.get_credit_balance and extract_citations with resolve=False are free.
Read the live prices with client.pricing.get() (free) before a large job.
Always set max_credits when you hand tools to an agent or a retriever to a pipeline.
It is a hard cap shared by the sync and async paths: once it is reached no further request is sent.
One call that is already in flight can still finish, so choose a cap with some headroom.
Agent
_async twin, and to_tool_list() wires both into one FunctionTool, so async agents use the async client.
create_watch, update_watch and delete_watch are not exposed unless you opt in with VaquillToolSpec(enable_watch_management=True).
Retriever
include_body=True (the default). Set include_body=False for excerpts at the search price only.
Before each request the retriever adds the worst-case cost of that retrieval to what it has spent, and raises vaquill.SpendGuardExceeded without sending anything if the total would pass the cap.
Errors, retries and idempotency
By default a failure comes back as a short string the model can act on, for exampleVaquill error: Out of credits (402). ....
There are no stack traces and the API key is scrubbed from every message.
Set raise_on_error=True to raise VaquillToolError instead. Retriever failures always raise VaquillToolError.
VaquillToolSpec accepts client, async_client, timeout and max_retries. Retries and idempotency are handled by the Python SDK underneath.
Vercel AI SDK
@vaquill-ai/ai-sdk gives generateText, streamText or a ToolLoopAgent the ability to search statutes and regulations, read a section, verify a citation and check what changed.
Install
Not yet published (see the note under the table at the top). Once released:ai (5.0.15 or newer, 6 or 7) and zod (3.25.76 or newer, or 4) are peer dependencies.
ai 7 itself requires Node 22 or newer.
Spend guard
OnlycreditBalance is free.
maxCredits defaults to 200 credits per process. Set it deliberately, and pair it with a step limit (stopWhen) on the AI SDK side.
The cap is checked before each call against credits already spent, so the last call may take the total slightly past the limit.
Once the limit is reached, every further paid call returns a spend_limit result and sends no request.
While a cap is set, paid calls run one at a time, so parallel tool calls cannot overshoot it.
Pass maxCredits: Infinity to switch the cap off.
generateText
Agent loop
streamText pattern is the same as generateText.
Options
allowWrites: true five watch tools appear: listWatches, createWatch, updateWatch, deleteWatch and testWatch.
createWatch makes Vaquill email or POST to an address the model chooses, so enable writes only for agents you trust with that, and consider a human approval step.
Errors, retries and idempotency
A tool never throws for an API problem. Success returns{ ok: true, data, creditsSpentSoFar }.
A failure returns a structured result the model can act on.
Retries and idempotency come from the TypeScript SDK underneath.
Error result format
Error result format
kind is one of spend_limit, insufficient_credits, authentication, permission_denied, not_found, invalid_request, rate_limited, daily_cap, server_error, timeout, connection, bad_response, error or unexpected.Results carry no stack traces, and anything shaped like an API key is replaced with [redacted].
Only an abort (the AI SDK’s abortSignal) is rethrown, so cancelling a request stops the loop.
A result larger than maxResultChars is replaced by { ok: true, truncated: true, preview, note }. Credits are still spent for it, so ask for a pinpoint subsection or a narrower search.Webhooks and versioning
The integrations do not receive webhooks. To verify a law change delivery, use the webhook helpers of the Python or TypeScript SDK. Pagination and batch helpers are not exposed as tools, and bulk fetches are deliberately left out. Use the SDK for those.langchain-vaquill and llama-index-tools-vaquill are at 0.1.0, so the API may change in minor versions before 1.0. The Vercel package is unpublished.
