Skip to main content

Citations

Every search result in Ground includes a citation that provides complete provenance information.

Citation Fields

FieldDescriptionExample
chunk_idUnique identifier for the chunkabc123...
source_idID of the sourcedef456...
source_nameHuman-readable source name"Stripe API"
pathFile path or URL/src/api/auth.py
symbolFunction, class, or section nameauthenticate()
start_lineStarting line number (code only)42
end_lineEnding line number (code only)65
version_refVersion identifiera1b2c3d (commit SHA)
languageProgramming language or formatpython, openapi
chunk_typeType of chunkcode, docs, openapi

Citation Types

Code Citations

For repository sources, citations include file path, line numbers, and commit SHA:
{
  "source_name": "anthropic-sdk-python",
  "path": "src/anthropic/client.py",
  "symbol": "Anthropic.__init__",
  "start_line": 45,
  "end_line": 78,
  "version_ref": "a1b2c3d4e5f6",
  "language": "python",
  "chunk_type": "code"
}

Documentation Citations

For HTML documentation, citations include the URL:
{
  "source_name": "FastAPI Docs",
  "path": "https://fastapi.tiangolo.com/tutorial/security/",
  "symbol": "OAuth2 with Password",
  "version_ref": "2024-01-15",
  "language": "markdown",
  "chunk_type": "docs"
}

OpenAPI Citations

For OpenAPI specs, citations include operation details:
{
  "source_name": "Stripe API",
  "path": "https://api.stripe.com/openapi.json",
  "symbol": "createPaymentIntent",
  "version_ref": "2023-10-16",
  "language": "openapi",
  "chunk_type": "openapi"
}

Using Citations

In LLM Prompts

Include citations in your prompts for grounded responses:
Based on the following evidence, answer the question.

Evidence 1 (from anthropic-sdk-python at src/anthropic/client.py L45-78):
[content here]

Evidence 2 (from Stripe API v2023-10-16, POST /v1/payment_intents):
[content here]

Question: How do I create a payment intent?

For User Display

Show citations to help users verify information:
The authentication flow uses OAuth2 with JWT tokens.
📄 Source: FastAPI Docs → /tutorial/security/ → "OAuth2 with Password"
⏰ Last synced: 5 days ago

Version Tracking

Ground tracks versions differently by source type:
Source TypeVersion Reference
RepositoryGit commit SHA
HTML DocsContent hash or date
OpenAPIinfo.version from spec
This allows you to:
  • Link to specific code versions
  • Detect when documentation changes
  • Track API version compatibility