> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/knowledge-sources/indexing-knowledge-sources/github.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
