> For the complete documentation index, see [llms.txt](https://docs.clearfeed.ai/clearfeed-help-center/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/knowledge-sources/indexing-knowledge-sources/github.md).

# GitHub

You can use GitHub as a Knowledge Source to index files from public or private repositories. ClearFeed uses the GitHub App connected to your account, so you do not need to provide a personal access token while adding the Knowledge Source.

## Prerequisite: Connect GitHub for Knowledge Sources

Before adding a GitHub Knowledge Source, connect GitHub from **Account Settings > Integrations > GitHub**.

When connecting GitHub, choose **Issues + Knowledge Source**. This lets ClearFeed create and sync GitHub issues, and read the selected repositories for Knowledge Sources.

{% hint style="info" %}
You may need a GitHub organization admin to approve or install the ClearFeed GitHub App. During installation, you can grant ClearFeed access to all repositories or only selected repositories.
{% endhint %}

For the full GitHub integration setup, see [GitHub integration](/clearfeed-help-center/integrations/github.md).

## Add a GitHub Knowledge Source

1. Navigate to **AI > Knowledge Sources** from the left sidebar in the ClearFeed WebApp.
2. Click **Add Knowledge Source** and select **GitHub**.
3. Complete the configuration form:
   * **Name**: Enter a descriptive title for this Knowledge Source.
   * **Tags**: Add tags to categorize the source. `GitHub` is included by default.
   * **Auto Reindex Regularly**: Enable this option to automatically update the Knowledge Source every 24 hours.
   * **Repository**: Select the GitHub repository you want ClearFeed to index.
   * **Folder Path**: Optionally enter a folder path to index only a specific folder inside the repository. Leave this blank to index the whole repository.
4. Click **Add**.

After the Knowledge Source is added, ClearFeed starts indexing the selected repository. The status may show **In Progress** while indexing is running, or **Initiated** if it is queued.

{% hint style="warning" %}
If the GitHub App is not connected with Knowledge Source permissions, ClearFeed shows an **Extended GitHub App Not Connected** message while adding the source. Use **Open Integrations** from that message, reconnect GitHub with **Issues + Knowledge Source**, and then return to add the Knowledge Source.
{% endhint %}

## Edit or reindex a GitHub Knowledge Source

You can edit an existing GitHub Knowledge Source to change the repository or folder path. Changing either value triggers ClearFeed to reindex the source using the updated selection.

To manually reindex a GitHub Knowledge Source, click **Reindex** next to it. Get more details on managing Knowledge Sources [here](/clearfeed-help-center/clearfeed-ai/knowledge-sources/managing-knowledge-sources.md).

## Using AI Agents

Once you've configured the Knowledge Source, learn how to build and use AI Agents.

{% content-ref url="/pages/BG6lBe8zAALu5HQvWnQQ" %}
[Build AI Agents](/clearfeed-help-center/clearfeed-ai/ai-agents/build-ai-agents.md)
{% endcontent-ref %}

{% content-ref url="/pages/KfSu1GlJW2NmCvxVTv5c" %}
[Use AI Agents](/clearfeed-help-center/clearfeed-ai/ai-agents/use-ai-agents.md)
{% endcontent-ref %}

## Migrating a deprecated GitHub Knowledge Source to new Knowledge Source

If you have an older GitHub Knowledge Source, recreate it using the steps above to move it to ClearFeed's newer GitHub indexing.

Before recreating the Knowledge Source, verify that your GitHub integration is connected with **Issues + Knowledge Source** permissions. Go to **Account Settings > Integrations > GitHub** and choose **Issues + Knowledge Source** when reconnecting.

Once the new GitHub Knowledge Source has been created and indexed successfully, you can delete the old GitHub Knowledge Source. Deleting the old Knowledge Source only removes it from ClearFeed; it does not delete content from GitHub.
