Ingest GitHub pull requests, issues, and commits into CortexDB.

GitHub Connector

The GitHub connector ingests pull requests, issues, commits, and reviews into CortexDB as typed episodes.

Setup

1. Create a GitHub Token

Create a personal access token or GitHub App with these permissions:

  • repo -- Read access to repositories
  • read:org -- Read organization information (optional)

2. Configure the Connector

CORTEX_GITHUB_TOKEN=ghp_your-token
CORTEX_GITHUB_REPOS=acme/backend,acme/frontend
CORTEX_GITHUB_TENANT_ID=my-app
CORTEX_GITHUB_NAMESPACE=github

3. Start the Connector

cortexdb-connector github \
  --token ghp_your-token \
  --repos "acme/backend,acme/frontend" \
  --tenant-id my-app

What Gets Ingested

| GitHub Event | Episode Type | Content | |---|---|---| | Pull request | code | PR title, description, files changed | | PR review | message | Review comment text | | Issue | task | Issue title and body | | Issue comment | message | Comment text | | Commit | code | Commit message and diff summary |

Episode Example

{
  "type": "code",
  "content": "Refactored auth middleware to support JWT and API keys.\n\nFiles changed: src/auth/middleware.rs, src/auth/rate_limit.rs\n+234 -89 across 5 files",
  "source": "github",
  "author": "bob",
  "timestamp": "2026-03-13T16:45:00Z",
  "metadata": {
    "repo": "acme/backend",
    "pr_number": 234,
    "state": "merged",
    "base_branch": "main",
    "labels": ["enhancement", "auth"]
  }
}

Configuration

| Variable | Default | Description | |---|---|---| | CORTEX_GITHUB_TOKEN | Required | GitHub token | | CORTEX_GITHUB_REPOS | Required | Comma-separated repo list | | CORTEX_GITHUB_TENANT_ID | Required | Target tenant | | CORTEX_GITHUB_NAMESPACE | github | Target namespace | | CORTEX_GITHUB_INCLUDE_COMMITS | true | Ingest commits | | CORTEX_GITHUB_INCLUDE_ISSUES | true | Ingest issues | | CORTEX_GITHUB_INCLUDE_PRS | true | Ingest pull requests | | CORTEX_GITHUB_BACKFILL_DAYS | 90 | Days of history to backfill | | CORTEX_GITHUB_POLL_INTERVAL_SEC | 60 | Polling interval | | CORTEX_GITHUB_WEBHOOK_SECRET | (none) | Webhook secret for real-time ingestion |

Webhook Mode

For real-time ingestion, configure a GitHub webhook instead of polling:

  1. In your repo settings, add a webhook pointing to https://your-cortexdb/v1/webhooks/github
  2. Set the content type to application/json
  3. Select events: Pull requests, Issues, Issue comments, Push
  4. Set CORTEX_GITHUB_WEBHOOK_SECRET to the webhook secret