GitHub Code indexes the code in a repository so answers can quote the implementation, not just the docs. Nothing is picked for you: you choose the file types, then narrow by folder and by pattern.
For READMEs and docs/ folders picked by convention, use GitHub Files. For issues, pull requests or discussions, use GitHub Issues, GitHub Pull Requests or GitHub Discussions.

Before you start

  • The repository’s owner and name.
  • For a private repository, an access token. A fine-grained token with Contents: read-only on that repository is enough. Kelu never writes to your repository.
  • A Pro plan or above.

Set up

1

Add the source

Open the knowledge base, click Add source, pick GitHub Code and enter a Display name.
2

Name the repository

Fill in Owner and Repository name (pasting the repository URL into Owner fills both). Add an Access token if the repository is private.
3

Choose what to index

Pick at least one File type. Optionally browse the repository under Directories and tick the folders to index. Each file shows whether it would be indexed.
4

Add it

Click Test connection, then Add source. The first sync starts right away. Copy the webhook secret from the confirmation screen if you want to sync on every push.

Options

FieldRequiredWhat it does
OwnerYesThe user or organization that owns the repository.
Repository nameYesThe repository’s name.
Branch or tagNoEmpty follows the default branch. A tag such as v2.1.0 pins the code to a release.
Access tokenNoNeeded for private repositories.
API URLNoGitHub Enterprise only, for example https://github.example.com/api/v3.
File typesYesThe languages and formats to index. See below.
DirectoriesNoFolders to index. Empty means the whole repository.
File include regexNoOnly paths matching this regular expression.
File exclude regexNoSkip paths matching this regular expression. Wins over the include regex.
The regexes use Go syntax (no lookahead) and are checked when you save.

File types

GroupTypes
DocumentationJupyter Notebooks, Markdown, MDX, Text
Source codeC#, C/C++, Go, Java, JavaScript, Kotlin, Python, Rust, Swift, Terraform, TSX, TypeScript, YAML
Pick a language, not an extension: TypeScript covers .ts, .mts and .cts.

Directories

  • A folder covers everything beneath it: src selects src/ but not src-generated/.
  • Picking a folder leaves out files at the top of the repository, such as the README. Tick Files at the repository root to keep them.
  • GitHub lists at most 1,000 entries per folder. The picker tells you when a folder is cut short.

What gets indexed

  • Each file becomes one document titled with its path. Code is split into sections at top-level declarations, each with its own heading, so answers can point at the right part of the file.
  • Markdown, MDX and text are indexed as written. Notebooks are converted to markdown.
  • Always skipped: dot files and folders, dependency and cache folders (node_modules, .next, .nuxt, venv, .venv, __pycache__, __pypackages__, .tox, .pytest_cache, .mypy_cache, .ruff_cache), and files over 512 KB.
  • Citations link to the file on GitHub at the branch or tag that was read.

Sync

The repository is re-read every hour. Click Sync Now to sync at once. To re-index on every push, set up the webhook from the source’s Webhook tab, the same way as for GitHub Files. See Keeping content fresh.

Versions

Add one source per branch or tag, give each a Version label, and use source groups so a question about v1 is answered from v1.

Troubleshooting

  • Nothing is indexed. Check File types, then Directories. A folder that doesn’t exist selects nothing without an error. Browse the tree to pick real folders.
  • The directory picker says 401 or 403. GitHub rejected the token. A fine-grained token must include this repository and Contents: read-only.
  • http status 404 fetching archive. The owner, name, branch or tag is wrong, or the token can’t read the private repository.
  • Generated files crowd out answers. Exclude their folder, or add a File exclude regex for their path.