# GitHub

### Indexing GitHub Knowledge Source

You can use GitHub as a knowledge source to index files from your repositories. This works for both public and private repositories.

**Step 1**: **Add your first Knowledge Source**

* Navigate to **AI >** [**Knowledge Sources**](https://web.clearfeed.app/knowledge-sources) from the left sidebar in the ClearFeed WebApp.
* Select `GitHub` from the "Add Knowledge Source" dropdown menu in the top right corner.
* Complete the configuration form in the side drawer:
  * **Name**: Enter a descriptive title for this Knowledge Source
  * **Tags**: These are identifiers linked with every Knowledge Source, aiding in categorization and structuring. (*GitHub* will be included by default)
  * **Auto Reindex Regularly**: Enable this option to automatically update the knowledge source every 24 hours
* After saving your addition, the Knowledge Source will appear in the list.

**Step 2**: **Upload/Connect GitHub Repository**

* Click the **Upload/Connect** button next to the GitHub knowledge source you just created.

<figure><img src="https://3455705434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE2O2wTaNovd6fXpEuLKz%2Fuploads%2Fgit-blob-d9b8b981777618b25e239440fe325e1f0bf488cc%2Fgh_upload.png?alt=media" alt=""><figcaption><p>Click Upload/Connect to link your GitHub repository</p></figcaption></figure>

* Follow the on-screen flow to authenticate with GitHub using a GitHub personal access token (PAT) and choose the repository you want ClearFeed to use as a knowledge source.
* After connecting, the Knowledge Source will either start indexing immediately (reflected by an **In Progress** status) or will be picked soon (reflected with an **Pending** status). Get more details on Managing Knowledge Sources [here](https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/knowledge-sources/managing-knowledge-sources).
* **Reindexing GitHub Repository -** To reindex the GitHub repository, manually reindex the knowledge source by clicking the "Reindex" button next to it.

### Using AI Agents

Once you've configured the knowledge sources, learn how to build and use AI Agents

{% content-ref url="../../ai-agents/build-ai-agents" %}
[build-ai-agents](https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/ai-agents/build-ai-agents)
{% endcontent-ref %}

{% content-ref url="../../ai-agents/use-ai-agents" %}
[use-ai-agents](https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/ai-agents/use-ai-agents)
{% endcontent-ref %}

### **Manage Knowledge Sources**

Once the status of the knowledge source has been indexed, learn more on how to manage the knowledge source below.

{% content-ref url="../managing-knowledge-sources" %}
[managing-knowledge-sources](https://docs.clearfeed.ai/clearfeed-help-center/clearfeed-ai/knowledge-sources/managing-knowledge-sources)
{% endcontent-ref %}


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
