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

# Source Citations

> AI responses include linked GitHub issues as verifiable source citations.

When Pastures AI returns a diagnosis, responses include **source citations** — links to real GitHub issues that informed the answer. This is a key differentiator: every recommendation is traceable to an actual resolution, not hallucinated.

## What citations look like

Each citation in the response displays:

* **Repository name** — e.g., `k3s-io/k3s`
* **Issue number** — e.g., `#8921`
* **Link** — opens the GitHub issue in a new tab
* **Status badge** — color-coded `open` or `closed` indicator

```
Sources
↗ k3s-io/k3s#8921        closed
↗ rancher/rancher#43156   open
```

Citations appear below the AI response text in a dedicated "Sources" section.

## How citations are generated

Source citations are powered by the [Oracle corpus](/rancher-oracle/corpus). When a query is processed:

1. The query is embedded and matched against 48,000+ indexed issue resolutions
2. The top-k matching issues are retrieved from the vector database
3. The LLM generates a grounded response using these issues as context
4. The matching issues are returned as structured citation metadata

Each citation includes the repository, issue number, URL, and current status (open/closed).

## Mode availability

<CardGroup cols={3}>
  <Card title="Oracle" icon="check" color="#16a34a">
    Full citations from the 48K+ issue corpus
  </Card>

  <Card title="Demo" icon="play" color="#2563eb">
    Realistic demo citations (e.g., k3s-io/k3s#8921)
  </Card>

  <Card title="BYO Model" icon="xmark" color="#dc2626">
    No citations — requires the Oracle corpus
  </Card>
</CardGroup>

<Warning>
  BYO model mode connects to your own OpenAI-compatible endpoint. Since it doesn't have access to the Oracle corpus, responses will not include source citations. The AI may still be useful for general Kubernetes questions, but answers are not grounded in verified resolutions.
</Warning>

## Citation data structure

The AI drawer receives citations as part of the response payload:

```typescript theme={null}
interface Source {
  repo: string;        // "k3s-io/k3s"
  issueNumber: number; // 8921
  url: string;         // "https://github.com/k3s-io/k3s/issues/8921"
  status: 'open' | 'closed';
}
```

Status badges use color coding: green for `closed` (resolved), red for `open` (still active). This helps users gauge whether the referenced fix is a known-good resolution or an ongoing discussion.
