A closed issue is a question somebody asked and somebody answered. BeforeQuery indexes a repository’s conversation as three separate sources — GitHub Issues, GitHub Pull Requests and GitHub Discussions — one document per thread, with citations back to the thread on GitHub. Three sources rather than one switch: they answer different questions and cost different amounts of noise, so most repositories want one or two of them and not all three. Add whichever you want; they share a repository and a token.
Separate from GitHub Code. Index the repo for its docs/ folder, and add any of these alongside it for the threads.

Prerequisites

  • The repository, as owner/name.
  • A personal access token — optional for issues and pull requests on a public repo, required for discussions on any repository and for anything private. A classic PAT needs the repo scope; a fine-grained one needs Issues: Read, Pull requests: Read or Discussions: Read as applicable.
  • A BeforeQuery workspace owner role.

Set up a connector

1

Add the source

Open Knowledge Base → Sources → Add source and choose GitHub Issues, GitHub Pull Requests or GitHub Discussions. Enter the repository and, if you need one, an access token.
2

Narrow what is indexed

Issues and pull requests take state, labels, exclude labels and updated within. Discussions take none of them — they are served by GitHub’s GraphQL API, which offers no such filters.
3

Check the connection and add

Click Test connection, then Add. The first sync starts immediately.

Connection settings

Leave state on closed. A resolved thread is the one that answers a question; an open issue is an unanswered one, and indexing it teaches the assistant to repeat the problem back.

Data ingested

One thread, one document:
  • Thread URL on GitHub, and Issue #123: title as the title
  • State, including completed vs not planned
  • Who opened it, and its labels
  • The description, then up to 50 comments under a ## Discussion heading
Discussions carry their category and accepted answer instead of state and labels. GitHub’s own updated_at is stored, so a thread it reports unchanged is never fetched again. Pull requests are noisier than issues by nature — a review thread is mostly line-level commentary — so start with exclude labels and a tight updated within if a PR source starts crowding out your docs.

Keeping content in sync

Issues and pull requests re-sync every 5 minutes; discussions every hour, because GraphQL returns each whole thread with the listing and there is no per-thread request to save. Sync on the source’s page runs one now if you cannot wait. Only threads GitHub reports as updated are read again. See Sources Overview.

Troubleshooting

  • Discussions failing to connect? They need an access token even on a public repository. Test connection says so before you save.
  • Nothing indexed at all? Check the state filter — a repository whose issues are mostly open indexes nothing under the default closed.
  • Rate-limited sync? GitHub allows 60 requests an hour unauthenticated. Add a token.
  • Too much noise in answers? Tighten with exclude labels and updated within, or isolate the source in a source group.