> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trygroundai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Citations

> Understanding provenance and citations in Ground

# Citations

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

## Citation Fields

| Field         | Description                      | Example                   |
| ------------- | -------------------------------- | ------------------------- |
| `chunk_id`    | Unique identifier for the chunk  | `abc123...`               |
| `source_id`   | ID of the source                 | `def456...`               |
| `source_name` | Human-readable source name       | `"Stripe API"`            |
| `path`        | File path or URL                 | `/src/api/auth.py`        |
| `symbol`      | Function, class, or section name | `authenticate()`          |
| `start_line`  | Starting line number (code only) | `42`                      |
| `end_line`    | Ending line number (code only)   | `65`                      |
| `version_ref` | Version identifier               | `a1b2c3d` (commit SHA)    |
| `language`    | Programming language or format   | `python`, `openapi`       |
| `chunk_type`  | Type of chunk                    | `code`, `docs`, `openapi` |

## Citation Types

### Code Citations

For repository sources, citations include file path, line numbers, and commit SHA:

```json theme={null}
{
  "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:

```json theme={null}
{
  "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:

```json theme={null}
{
  "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 Type | Version Reference        |
| ----------- | ------------------------ |
| Repository  | Git commit SHA           |
| HTML Docs   | Content hash or date     |
| OpenAPI     | `info.version` from spec |

This allows you to:

* Link to specific code versions
* Detect when documentation changes
* Track API version compatibility
