Skip to main content

GitHub Integration

Import repositories, issues, and pull requests from GitHub as searchable Trix memories.

Overview

The GitHub integration imports your repositories, issues, and pull requests as searchable Trix memories. Content is converted to markdown and synchronized incrementally.

  • Repository Sync - Import repository metadata, descriptions, and README files
  • Issue Sync - Import issues with labels, state, and comments
  • Pull Request Sync - Import PRs with branch info and review status
  • File Content - Retrieve individual file contents from repositories
  • Incremental Updates - Only sync changed content

Connecting GitHub

Via CLI (Recommended)

connect.sh
trix integrations connect github

This opens your browser for OAuth authorization. Grant Trix access to your GitHub repositories.

Via API

initiate.sh
# Initiate OAuth flow
curl -X POST https://api.trixdb.com/v1/integrations/oauth/initiate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider": "github"}'

GitHub OAuth requires the repo, read:user, and read:org scopes for full access to repositories and organizations.

What Gets Synced

Repositories

Each GitHub repository becomes a memory with:

Memory FieldSource
contentRepository name, description, and stats
content_typemarkdown
metadata.sourcegithub
metadata.github_urlRepository URL
metadata.languagePrimary programming language
metadata.starsStar count
tags["github", "repository"]

Issues

Each GitHub issue becomes a memory with:

Memory FieldSource
contentIssue title and body as markdown
metadata.issue_numberIssue number (e.g., #42)
metadata.stateopen or closed
metadata.labelsArray of label names
metadata.authorGitHub username
tags["github", "issue", "open"]

Pull Requests

Each GitHub pull request becomes a memory with:

Memory FieldSource
contentPR title and description as markdown
metadata.pr_numberPR number
metadata.stateopen, closed, or merged
metadata.head_branchSource branch name
metadata.base_branchTarget branch name
tags["github", "pull-request"]

Resource Types

TypeDescription
github_repositoryRepository metadata, description, README
github_issueIssues with labels, state, assignees
github_pull_requestPRs with branch info, review status
github_fileIndividual file content from repositories

Syncing Content

sync.sh
# List connections
trix integrations list

# Sync all repositories
trix integrations sync conn_abc123

# Sync specific repository with issues
trix integrations sync conn_abc123 --repo owner/repo --include issues,prs

# Full sync (re-import everything)
trix integrations sync conn_abc123 --full

# Check status
trix integrations status conn_abc123

API Reference

api.sh
# List connections
curl -X GET https://api.trixdb.com/v1/integrations/connections \
  -H "Authorization: Bearer YOUR_API_KEY"

# Trigger sync
curl -X POST https://api.trixdb.com/v1/integrations/connections/{id}/sync \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"job_type": "incremental"}'

# Sync specific repository
curl -X POST https://api.trixdb.com/v1/integrations/connections/{id}/sync \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"repository": "owner/repo", "resource_types": ["github_issue", "github_pull_request"]}'

# Disconnect
curl -X DELETE https://api.trixdb.com/v1/integrations/connections/{id} \
  -H "Authorization: Bearer YOUR_API_KEY"

Rate Limits

GitHub has generous API rate limits. Trix handles this automatically:

  • 5,000 requests/hour for authenticated requests
  • 30 requests/minute conservative limit used by Trix
  • Automatic retry with exponential backoff on rate limit errors
  • Sync jobs queue and process sequentially

GitHub's rate limit is per-user. If you hit limits, wait for the reset time shown in the error message.

Required Permissions

The GitHub OAuth app requests these scopes:

ScopePurpose
repoFull access to private and public repositories
read:userRead user profile information
read:orgRead organization membership

Troubleshooting

Repositories Not Appearing

  1. Check that you've authorized the correct GitHub account
  2. Verify the OAuth app has access to the organization's repositories
  3. For organization repos, an org admin may need to approve the OAuth app

Private Repositories

Private repositories require the repo scope. If you only see public repos, reconnect and ensure you grant full repository access.

Reconnecting

reconnect.sh
trix integrations disconnect conn_abc123
trix integrations connect github

GitHub OAuth tokens don't expire, but you can revoke access at any time from GitHub Settings → Applications → Authorized OAuth Apps.