Index a repository’s pull requests: the description, the comments and the reviews. Each pull request becomes one document, and citations link back to it.
Other GitHub sources read the same repository: GitHub Issues, GitHub Discussions, GitHub Files and GitHub Code. Add any of them side by side.

Before you start

  • A Pro plan or higher, and permission to edit sources in the knowledge base.
  • The repository’s owner and name.
  • For a private repository: a GitHub access token. A public repository needs none, but this source makes several requests per pull request, so a token avoids GitHub’s low limit on anonymous requests.

Token permissions

Use a fine-grained personal access token limited to the repositories you connect, with:
  • Pull requests: read-only
  • Issues: read-only (pull requests are listed through GitHub’s issues endpoint)
  • Metadata: read-only (GitHub adds this automatically)
A classic token with the repo scope also works. Kelu only reads; it never writes to your repository.

Set up

1

Choose GitHub Pull Requests

Open your knowledge base, go to Sources, click Add source and choose GitHub Pull Requests. Give the source a name.
2

Name the repository

Fill in Owner and Repository name. Pasting the repository URL into Owner fills both. Add the Access token if you have one.
3

Choose what to index (optional)

Set State, Labels, Exclude labels and Updated within, and choose whether to skip pull requests that were never merged.
4

Test and add

Click Test connection, then Add source. The first sync starts right away.

Options

OptionDefaultWhat it does
Owner—Required. The user or organization that owns the repository.
Repository name—Required.
Access tokenEmptyRequired for a private repository.
API URLEmptyGitHub Enterprise Server only, for example https://github.example.com/api/v3.
StateClosed onlyClosed only, Open only or All.
LabelsEmptyKeeps pull requests that carry at least one of these labels.
Exclude labelsEmptyDrops pull requests that carry any of these labels. Wins over Labels.
Updated withinEmptyOnly pull requests updated in the last N days. Empty indexes all of them.
Skip pull requests that were never mergedOffDrops pull requests that were closed without merging.
For the best answers, use Closed only with Skip pull requests that were never merged on. That indexes what shipped. A closed, unmerged pull request describes a change that was rejected, but reads just like one that shipped.

What gets indexed

  • One document per pull request, titled Pull request #123: title.
  • It holds the status and close reason, who opened it, its labels, the description and the comments (the newest 200).
  • Reviews come too: each review’s verdict and text, and each inline review comment with its file, line and up to 20 lines of the diff it was left on.
  • Up to 100 reviews and 100 inline comments are read per pull request. The source’s Sync history tab lists any pull request that was cut.
  • The full diff is not indexed. For the code itself, add a GitHub Code source.
When you change State, the label filters or Skip pull requests that were never merged, the next sync removes pull requests that no longer match. Updated within is different: a pull request that ages out of the window stays indexed.

Sync

GitHub Pull Requests re-syncs every 5 minutes. Pull requests that did not change are skipped. Click Sync Now on the source page to sync right away.

Troubleshooting

  • Nothing was indexed. Check State. With Closed only, open pull requests are not read.
  • Answers cite work that never shipped. Turn on Skip pull requests that were never merged.
  • The sync fails with rate limit exhausted. Add a token, or wait for the reset time in the error.
  • 401 or 403. GitHub rejected the token, or it cannot read this repository. Check the token permissions above.
  • 404. The repository was not found, or the token cannot see it. A fine-grained token must list this repository.
  • Too many low-value pull requests. Narrow with Labels or Updated within, or put the source in its own source group so only some surfaces answer from it.