GitHub Integration Guide
How to integrate Arc Memory with GitHub
GitHub Integration Guide
This guide explains how to integrate Arc Memory with GitHub to enhance your knowledge graph with pull requests, issues, discussions, and other GitHub data.
Overview
Arc Memory can integrate with GitHub to:
- Fetch pull request data and link it to commits
- Retrieve issue information and connect it to related PRs
- Capture discussions and comments
- Track code reviews and feedback
- Analyze contribution patterns
Authentication
Before you can use GitHub integration, you need to authenticate with GitHub.
Using a Personal Access Token (PAT)
-
Create a token:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click “Generate new token”
- Select the following scopes:
repo
(for private repositories)read:user
read:org
(if accessing organization repositories)
- Click “Generate token”
- Copy the token
-
Authenticate with Arc Memory:
-
Verify authentication:
Using GitHub CLI
If you already use GitHub CLI (gh
), you can use its authentication:
Using a GitHub App (for Organizations)
For organization-wide use, you can create a GitHub App:
-
Create a GitHub App:
- Go to GitHub Settings > Developer settings > GitHub Apps
- Click “New GitHub App”
- Fill in the required information
- Set permissions:
- Repository: Read-only
- Issues: Read-only
- Pull requests: Read-only
- Discussions: Read-only
- Create the app
-
Install the app on your organization or repositories
-
Generate a private key for the app
-
Authenticate with Arc Memory:
Building with GitHub Data
Once authenticated, you can build your knowledge graph with GitHub data:
Limiting GitHub Data
To limit the amount of GitHub data fetched:
GitHub Data in the Knowledge Graph
After building with GitHub data, the knowledge graph will contain:
Node Types
Node Type | Description | Example |
---|---|---|
PR | Pull request | PR #123 |
Issue | GitHub issue | Issue #456 |
Discussion | GitHub discussion | Discussion #789 |
Comment | Comment on PR, issue, or discussion | Comment on PR #123 |
Review | Code review on a PR | Review on PR #123 |
User | GitHub user | User “username” |
Edge Types
Edge Type | Description | Example |
---|---|---|
PART_OF | Commit is part of a PR | Commit abc123 → PR #123 |
REFERENCES | PR references an issue | PR #123 → Issue #456 |
AUTHORED_BY | PR/issue authored by user | PR #123 → User “username” |
REVIEWED_BY | PR reviewed by user | PR #123 → User “reviewer” |
COMMENTED_BY | Comment authored by user | Comment → User “commenter” |
RESPONDS_TO | Comment responds to another comment | Comment → Comment |
Querying GitHub Data
You can query GitHub data using the why
, relate
, and trace
commands:
Finding PRs for a Commit
Finding Issues Referenced by a PR
Finding the Decision Trail for a Line
GitHub Enterprise Support
Arc Memory supports GitHub Enterprise:
Rate Limiting Considerations
GitHub API has rate limits that may affect Arc Memory:
- Authenticated requests: 5,000 requests per hour
- Unauthenticated requests: 60 requests per hour
To avoid rate limiting issues:
- Always authenticate with a token
- Use incremental builds when possible
- Limit the scope of your builds
- Consider using a GitHub App for higher rate limits
Troubleshooting
Authentication Issues
If you encounter authentication issues:
- Verify your token has the correct scopes
- Check if the token has expired
- Try re-authenticating:
Rate Limit Errors
If you hit rate limits:
- Check your current rate limit status:
- Wait for the rate limit to reset
- Use incremental builds:
- Limit the scope of your build:
Missing Data
If GitHub data is missing from your knowledge graph:
- Verify you included the GitHub flag:
- Check if the data exists on GitHub
- Verify your authentication has access to the repository
- Run with debug logging:
Best Practices
- Use incremental builds to minimize API calls
- Authenticate with a token to increase rate limits
- Limit the scope of your builds to recent data when possible
- Consider using a GitHub App for organization-wide use
- Schedule builds during off-hours for large repositories
- Use specific filters when querying to improve performance
Examples
CI/CD Integration
Team Dashboard Integration
See Also
- Authentication Command - For more authentication options
- Build Command - For more build options
- Dependencies Guide - For required dependencies
- Troubleshooting Guide - For common issues and solutions