GitHub
Use GitHub issues, discussions, and wikis as knowledge sources. Sync repositories, pull requests, and markdown docs to your AI assistant.
Connect your GitHub repositories to use issues, discussions, pull requests, and wikis as knowledge sources. This is perfect for technical documentation, community support, and keeping your AI assistant updated with the latest project information.
What Can Be Indexed
Ask0 can index the following GitHub content:
- Issues: Open and closed issues with comments
- Discussions: Community Q&As and announcements
- Pull Requests: PRs with descriptions and review comments
- Wiki Pages: Repository wiki documentation
- README Files: Main and folder READMEs
- Documentation: Markdown files in docs folders
- Releases: Release notes and changelogs
Setting Up GitHub Source
Generate GitHub Token
- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
repo(for private repositories)public_repo(for public repositories only)read:discussion(for discussions)
- Copy the generated token
Add GitHub Source
In Ask0 dashboard:
- Navigate to Sources → Add Source → GitHub
- Enter your GitHub token
- Configure repository settings
Configure Repository
Repository: owner/repo-name
Branch: main # or master, develop, etc.
Content Types:
☑ Issues
☑ Discussions
☑ Pull Requests
☑ Wiki
☑ Documentation Files
Filters:
Issue Labels: [bug, feature, documentation]
Issue State: all # open, closed, or all
Discussion Categories: [Q&A, Announcements]
File Paths:
- /docs/**/*.md
- /README.md
- /wiki/**
Refresh Schedule: Every 6 hoursStart Indexing
Click "Connect & Index" to begin importing GitHub content.
Configuration Options
Repository Selection
Index single or multiple repositories:
repository: myorg/myrepo
repositories:
- myorg/main-app
- myorg/mobile-app
- myorg/documentation
organization: myorg
include_repos: [main-*, docs-*]
exclude_repos: [*-archive, *-deprecated]Content Filtering
Issues
issues:
enabled: true
states: [open, closed]
labels:
include: [documentation, faq, help-wanted]
exclude: [wontfix, duplicate]
created_after: 2023-01-01
with_comments: true
min_comments: 0
assignees: [user1, user2] # optionalDiscussions
discussions:
enabled: true
categories:
include: [Q&A, How-to, Show and Tell]
exclude: [Polls]
answered_only: false
include_comments: truePull Requests
pull_requests:
enabled: true
states: [open, closed, merged]
include_drafts: false
include_reviews: true
include_comments: true
base_branch: mainDocumentation Files
files:
enabled: true
paths:
include:
- /**/*.md
- /**/*.mdx
- /**/README*
exclude:
- /**/node_modules/**
- /**/vendor/**
- /**/.github/**
max_file_size: 10MBAdvanced Configuration
Authentication
For different access needs:
auth_type: token
token: ghp_xxxxxxxxxxxxauth_type: app
app_id: 123456
private_key: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
installation_id: 789012auth_type: oauth
client_id: your_client_id
client_secret: your_client_secret
access_token: your_access_tokenRate Limiting
Respect GitHub API limits:
rate_limiting:
requests_per_hour: 5000 # GitHub default
concurrent_requests: 10
retry_after_rate_limit: true
backoff_strategy: exponentialIncremental Updates
Efficiently update only changed content:
incremental:
enabled: true
strategy: since_last_sync
check_interval: 1 hour
webhooks:
enabled: true
secret: your_webhook_secret
events: [issues, discussion, push]Webhook Integration
Set up real-time updates:
- In Ask0: Get your webhook URL from source settings
- In GitHub: Add webhook in repository settings
- Configure events:
- Issues
- Discussions
- Pull requests
- Pushes (for documentation)
- Wiki changes
Webhook URL: https://api.ask0.ai/webhooks/github/YOUR_SOURCE_ID
Content Type: application/json
Secret: your_webhook_secret
Events:
☑ Issues
☑ Discussion
☑ Pull request
☑ Push
☑ WikiContent Processing
Issue Enhancement
Automatically enrich issue content:
issue_processing:
include_metadata: true
extract_code_blocks: true
link_related_issues: true
include_labels_in_content: true
format: markdownCode Block Handling
Process code examples:
code_handling:
extract_language: true
syntax_highlight: false # for indexing
include_line_numbers: false
max_lines_per_block: 100Link Resolution
Convert GitHub references:
link_resolution:
convert_issue_refs: true # #123 → full link
convert_user_mentions: true # @user → profile link
convert_commit_shas: true # abc123 → commit link
resolve_relative_links: trueBest Practices
Optimizing GitHub Sources:
- Use labels to categorize and filter content
- Encourage detailed issue descriptions
- Maintain a comprehensive wiki
- Use discussion categories effectively
- Keep README files updated
Labeling Strategy
Create a labeling system for better indexing:
Labels for Indexing:
- "documentation": Always index
- "faq": High priority
- "bug": Include with context
- "feature-request": Include for roadmap
- "internal": Exclude from public
- "duplicate": Always excludeContent Quality
Improve answer quality:
- Write descriptive issue titles
- Include reproduction steps
- Add solution in comments when resolved
- Use discussions for Q&A
- Maintain up-to-date documentation
Monitoring
Sync Status
Track indexing progress:
Repository: myorg/myrepo
Last Sync: 2024-01-15 14:30:00
Status: Active
Statistics:
- Issues: 234 indexed
- Discussions: 89 indexed
- Files: 156 indexed
- Total Tokens: 1.2M
Next Sync: 2024-01-15 20:30:00Common Issues
Authentication Failed
- Verify token has correct scopes
- Check token expiration
- Ensure repository access
Rate Limit Exceeded
- Reduce sync frequency
- Lower concurrent requests
- Use webhook updates instead
Missing Content
- Check filter configuration
- Verify file paths
- Review label filters
API Usage
Manage GitHub sources programmatically:
// Create GitHub source
const source = await ask0.sources.create({
type: 'github',
name: 'Main Repository',
config: {
repository: 'myorg/myrepo',
token: process.env.GITHUB_TOKEN,
contentTypes: ['issues', 'discussions', 'files'],
filters: {
issues: {
labels: ['documentation', 'faq'],
states: ['open', 'closed']
}
}
}
});
// Trigger sync
await ask0.sources.sync(source.id);
// Get indexed content stats
const stats = await ask0.sources.getStats(source.id);
console.log(`Indexed ${stats.issues} issues, ${stats.discussions} discussions`);
// Search within GitHub source
const results = await ask0.search({
query: 'authentication error',
sources: [source.id],
limit: 10
});Security Considerations
Token Management
- Store tokens securely (use environment variables)
- Rotate tokens regularly
- Use minimum required scopes
- Monitor token usage
Private Repositories
When indexing private repos:
privacy:
respect_visibility: true
exclude_sensitive_labels: [security, private]
redact_emails: true
mask_tokens: true