> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airweave.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airweave.ai/_mcp/server.

# Github

> Github integration with Airweave

{/* AUTO-GENERATED CONTENT START */}

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/airweave.docs.buildwithfern.com/2026-05-20T11%3A36%3A51.367Z/docs/pages/connectors/github/icon.svg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T162602Z&X-Amz-Expires=604800&X-Amz-Signature=5c89f12447a113467351d4410c41779fbd0d6e92cc23bca1638925d3bc577b29&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="Github logo" width="48" height="48" />

<h1>
  Github
</h1>

This connector enables AI agents and RAG systems to retrieve context from Github through Airweave's unified search layer.

## Configuration

GitHub source connector integrates with the GitHub REST API to extract and synchronize data.

Connects to your GitHub repositories.

It supports syncing repository metadata, directory structures, and code files with
configurable filtering options for branches and file types.

#### [View Source Code](https://github.com/airweave-ai/airweave/tree/main/backend/airweave/platform/sources/github.py)

Explore the Github connector implementation

### Authentication

**Supported authentication methods:**

* Direct Credentials
* Auth Provider

### Configuration Options

This connector does not have any additional configuration options.

## Data Models

The following data models are available for this connector:

#### GitHubRepositoryEntity

Schema for GitHub repository entity.

| Field               | Type           | Description                                    |
| ------------------- | -------------- | ---------------------------------------------- |
| repo\_id            | int            | Unique GitHub repository ID                    |
| name                | str            | Repository short name                          |
| created\_at         | datetime       | Timestamp when the repository was created      |
| updated\_at         | datetime       | Timestamp when the repository was last updated |
| full\_name          | str            | Full repository name including owner           |
| description         | Optional\[str] | Repository description                         |
| default\_branch     | str            | Default branch of the repository               |
| language            | Optional\[str] | Primary language of the repository             |
| fork                | bool           | Whether the repository is a fork               |
| size                | int            | Size of the repository in KB                   |
| stars\_count        | Optional\[int] | Number of stars                                |
| watchers\_count     | Optional\[int] | Number of watchers                             |
| forks\_count        | Optional\[int] | Number of forks                                |
| open\_issues\_count | Optional\[int] | Number of open issues                          |

#### GitHubDirectoryEntity

Schema for GitHub directory entity.

| Field       | Type | Description                                           |
| ----------- | ---- | ----------------------------------------------------- |
| full\_path  | str  | Repository-qualified directory path (owner/repo/path) |
| name        | str  | Directory name                                        |
| path        | str  | Path of the directory within the repository           |
| repo\_name  | str  | Name of the repository containing this directory      |
| repo\_owner | str  | Owner of the repository                               |
| branch      | str  | Branch that was traversed for this directory          |

#### GitHubCodeFileEntity

Schema for GitHub code file entity.

| Field       | Type           | Description                                      |
| ----------- | -------------- | ------------------------------------------------ |
| full\_path  | str            | Repository-qualified file path (owner/repo/path) |
| name        | str            | Filename                                         |
| branch      | str            | Branch that was traversed for this file          |
| sha         | str            | SHA hash of the file content                     |
| line\_count | Optional\[int] | Number of lines in the file                      |
| is\_binary  | bool           | Flag indicating if file is binary                |
| html\_url   | Optional\[str] | HTML URL for viewing this content on GitHub.     |

#### GitHubPullRequestEntity

Schema for a merged GitHub pull request.

Reference:
[https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28](https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28)

| Field                | Type                  | Description                                            |
| -------------------- | --------------------- | ------------------------------------------------------ |
| pr\_id               | str                   | Repository-qualified PR identifier (owner/repo#number) |
| title                | str                   | Pull request title                                     |
| body                 | Optional\[str]        | Pull request description (markdown)                    |
| number               | int                   | PR number within the repository                        |
| state                | str                   | PR state (closed for merged PRs)                       |
| author               | Optional\[str]        | Login of the PR author                                 |
| labels               | Optional\[List\[str]] | Labels applied to the PR                               |
| assignees            | Optional\[List\[str]] | Assignee logins                                        |
| reviewers            | Optional\[List\[str]] | Requested reviewer logins                              |
| base\_branch         | Optional\[str]        | Base branch the PR was merged into                     |
| head\_branch         | Optional\[str]        | Source branch of the PR                                |
| additions            | Optional\[int]        | Number of lines added                                  |
| deletions            | Optional\[int]        | Number of lines deleted                                |
| changed\_files       | Optional\[int]        | Number of files changed                                |
| changed\_files\_list | Optional\[List\[str]] | Paths of files changed in this PR                      |
| merge\_commit\_sha   | Optional\[str]        | SHA of the merge commit                                |
| created\_time        | datetime              | When the PR was created                                |
| updated\_time        | datetime              | When the PR was last updated                           |
| merged\_at           | Optional\[datetime]   | When the PR was merged                                 |
| repo\_name           | str                   | Repository short name                                  |
| repo\_owner          | str                   | Repository owner                                       |
| web\_url\_value      | Optional\[str]        | Link to the PR on GitHub                               |

#### GitHubPRCommentEntity

Schema for a review comment on a GitHub pull request.

Review comments are anchored to specific lines in the diff.

Reference:
[https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28](https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28)

| Field           | Type           | Description                                                            |
| --------------- | -------------- | ---------------------------------------------------------------------- |
| comment\_id     | str            | Repository-qualified comment identifier (owner/repo#number/comment/id) |
| comment\_label  | str            | Short label for the comment                                            |
| body            | Optional\[str] | Comment body (markdown)                                                |
| path            | Optional\[str] | File path the comment is anchored to                                   |
| diff\_hunk      | Optional\[str] | Diff context surrounding the comment                                   |
| author          | Optional\[str] | Login of the comment author                                            |
| pr\_number      | int            | PR number this comment belongs to                                      |
| created\_time   | datetime       | When the comment was created                                           |
| updated\_time   | datetime       | When the comment was last updated                                      |
| repo\_name      | str            | Repository short name                                                  |
| repo\_owner     | str            | Repository owner                                                       |
| web\_url\_value | Optional\[str] | Link to the comment on GitHub                                          |

#### GithubRepoEntity

Schema for a GitHub repository (alternative schema).

References:
[https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28](https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28)

Note: This is an alternative repository entity schema. Consider using GitHubRepositoryEntity.

| Field               | Type                | Description                                   |
| ------------------- | ------------------- | --------------------------------------------- |
| full\_name          | Optional\[str]      | Full name (including owner) of the repo.      |
| owner\_login        | Optional\[str]      | Login/username of the repository owner.       |
| private             | bool                | Whether the repository is private.            |
| description         | Optional\[str]      | Short description of the repository.          |
| fork                | bool                | Whether this repository is a fork.            |
| pushed\_at          | Optional\[datetime] | When the repository was last pushed.          |
| homepage            | Optional\[str]      | Homepage URL for the repository.              |
| size                | Optional\[int]      | Size of the repository (in kilobytes).        |
| stargazers\_count   | int                 | Number of stars on this repository.           |
| watchers\_count     | int                 | Number of people watching this repository.    |
| language            | Optional\[str]      | Primary language of the repository.           |
| forks\_count        | int                 | Number of forks for this repository.          |
| open\_issues\_count | int                 | Number of open issues on this repository.     |
| topics              | List\[str]          | Topics/tags applied to this repo.             |
| default\_branch     | Optional\[str]      | Default branch name of the repository.        |
| archived            | bool                | Whether the repository is archived.           |
| disabled            | bool                | Whether the repository is disabled in GitHub. |

#### GithubContentEntity

Schema for a GitHub repository's content (file, directory, submodule, etc.).

References:
[https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28](https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28)

Note: This is a generic content entity. Consider using specific entities like
GitHubCodeFileEntity or GitHubDirectoryEntity.

| Field            | Type           | Description                                                                |
| ---------------- | -------------- | -------------------------------------------------------------------------- |
| repo\_full\_name | Optional\[str] | Full name of the parent repository.                                        |
| path             | Optional\[str] | Path of the file or directory within the repo.                             |
| sha              | Optional\[str] | SHA identifier for this content item.                                      |
| item\_type       | Optional\[str] | Type of content. Typically 'file', 'dir', 'submodule', or 'symlink'.       |
| size             | Optional\[int] | Size of the content (in bytes).                                            |
| html\_url        | Optional\[str] | HTML URL for viewing this content on GitHub.                               |
| download\_url    | Optional\[str] | Direct download URL if applicable.                                         |
| content          | Optional\[str] | File content (base64-encoded) if retrieved via 'mediaType=raw' or similar. |
| encoding         | Optional\[str] | Indicates the encoding of the content (e.g., 'base64').                    |

#### GitHubFileDeletionEntity

Schema for GitHub file deletion entity.

This entity is used to signal that a file has been removed from the repository
and should be deleted from the destination.

| Field           | Type           | Description                                        |
| --------------- | -------------- | -------------------------------------------------- |
| full\_path      | str            | Repository-qualified file path (owner/repo/path)   |
| deletion\_label | str            | Human-readable deletion label                      |
| file\_path      | str            | Path of the deleted file within the repository     |
| repo\_name      | str            | Name of the repository containing the deleted file |
| repo\_owner     | str            | Owner of the repository                            |
| branch          | Optional\[str] | Branch context for the deleted file                |

{/* AUTO-GENERATED CONTENT END */}

## Setting up a GitHub Personal Access Token for Airweave

To connect your GitHub repositories to Airweave, you'll need to create a Personal Access Token (PAT) with the appropriate permissions. This guide walks you through the process of creating and configuring a fine-grained token for use with Airweave.

### Step 1: Access Developer Settings in GitHub

Navigate to your GitHub account settings by clicking on your profile picture in the top right corner, then select "Settings". From there, scroll down to find and click on "Developer settings" in the left sidebar.

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/airweave.docs.buildwithfern.com/2026-05-20T11%3A36%3A51.367Z/docs/pages/connectors/github/find-developer-settings.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T162602Z&X-Amz-Expires=604800&X-Amz-Signature=b2879c1ed4f87a102fd5c92bb2b80d35b3183a52f4e3fbd3fe91ef2943a74b4b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="Finding Developer Settings in GitHub" width="600" />

### Step 2: Create a New Fine-Grained Token

In the Developer settings page, select "Fine-grained tokens" from the left menu, then click on "Generate new token".

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/airweave.docs.buildwithfern.com/2026-05-20T11%3A36%3A51.367Z/docs/pages/connectors/github/fine-grained-token.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T162602Z&X-Amz-Expires=604800&X-Amz-Signature=321df7130bce5bffd46359c91155baa0cf183d8cdc60e0f760131be5f5fb9cbd&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="Fine-grained tokens section" width="600" />

### Step 3: Configure Your Token

Fill out the token form with the following details:

1. **Token name**: Choose a descriptive name like "Airweave Integration"
2. **Expiration**: Select an appropriate expiration date (recommended: 1 year for production use)
3. **Repository access**: Choose either "All repositories" or select specific repositories you want to connect to Airweave

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/airweave.docs.buildwithfern.com/2026-05-20T11%3A36%3A51.367Z/docs/pages/connectors/github/create-new-token.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T162602Z&X-Amz-Expires=604800&X-Amz-Signature=18d99684f1bc49847eeae3c26d4ec879f0f470e89ba15b487104e0bd7cee18fd&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="Creating a new token" width="600" />

### Step 4: Set Required Permissions

For the GitHub connector to work properly, you need to grant the following permissions:

Under "Repository permissions":

* Set "Contents" to "Read-only" - This allows Airweave to read repository files

<img src="https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/airweave.docs.buildwithfern.com/2026-05-20T11%3A36%3A51.367Z/docs/pages/connectors/github/add-conent-to-read-rights.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260807%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260807T162602Z&X-Amz-Expires=604800&X-Amz-Signature=1cbdc56acbf4aaaeba96c81593254ec2dafd398c918ac66b07f00181147f7b62&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject" alt="Setting content permissions" width="600" />

### Step 5: Generate and Save Your Token

After configuring the permissions, scroll to the bottom of the page and click "Generate token".

**Important**: GitHub will display your token only once. Make sure to copy and store it in a secure location, as you won't be able to view it again.

### Step 6: Add Your Token to Airweave

When setting up the GitHub connector in Airweave:

1. **Authentication**: Paste your personal access token in the "Personal Access Token" field
2. **Configuration**: Enter the repository name in the format `owner/repo` (e.g., `airweave-ai/airweave`) in the "Repository Name" configuration field

Your GitHub repository is now connected to Airweave and ready for synchronization.