Retrieval and grounding
Build a small, version-aware retrieval layer that cites Torq sources and refreshes live state for every decision.
Index the right corpus
Start with the developer index. Fetch linked guides, the OpenAPI contract, the SDK reference, and the context pack. Chunk by heading and retain each document's canonical URL, title, section, release status, and retrieval time.
Do not ingest internal source trees, credentials, customer records, or unpublished role material.
Route questions before retrieval
| Question class | Retrieve |
|---|---|
| Concepts and architecture | Developer guides and context pack |
| Exact request or response shape | OpenAPI and API reference |
| Current vault, market, fund, or asset state | Canonical resource API |
| Wallet-specific position or eligibility | Wallet-scoped API using the current session |
| Available workflow | Context pack plus capability catalogue |
| SDK implementation | SDK reference for the approved package version |
Separate static truth from live truth
Static documentation can define what availableLiquidity means. Only a current API response can
state its present value. Keep these as separate citations in the prompt, and attach freshness block
evidence to live state.
Minimal retrieval record
{
"sourceUrl": "https://docs.torq.finance/developers/canonical-state",
"section": "Completion contract",
"retrievedAt": "2026-08-09T00:00:00Z",
"releaseStatus": "private_preview",
"content": "..."
}Timestamps remain ISO in machine records. Product-facing calendar dates use Torq's platform date format.
Citation contract
Require the model to return the exact Torq source URL for factual claims and the resource ID plus freshness evidence for current-state claims. If a claim has no source, present it as an open question, not a fact.