GitHub Auto-Sync
Connect your repository once and keep docs, supported code, and supported binary files current automatically. Snipara preserves the right lane for each file so retrieval stays clean.
Included
GitHub Auto-Sync is available on every plan, including Free.
GitHub as evidence
GitHub sync is the evidence layer for repository-aware agents. Issues, pull requests, review comments, commits, Actions summaries, docs, and code files stay linked to their GitHub source instead of being copied into opaque memory.
The reviewed-memory layer is being introduced carefully: selected GitHub evidence can be proposed as durable Memory V2 only after policy checks, review, and source-link preservation. Treat GitHub as source truth; treat memory as compact, governed state.
PR Answer Packs
Push sync keeps the repository index fresh. Pull request events let Snipara generate Answer Packs: scoped context artifacts with impacted symbols, architecture continuity, implementation history, repository conventions, and code impact notes.
Read PR Answer Packs docsHow It Works
Supported File Types
GitHub sync has three ingestion lanes. Documentation and supported binary parsers feed snipara_context_query. Source code is stored as CODE documents and indexed into the code graph for structural tools such as snipara_code_callers.
Documentation
RAGUsed for semantic documentation search and context answers.
Code graph
CODEUsed for callers, imports, neighbors, and shortest-path code questions.
Parsed files
PARSERUsed when Snipara can turn a non-code file into searchable text without guessing. Code projects show parsed technical attachments; business projects show business file parsers. SVG is optional for code projects and should be limited to technical diagrams, not frontend icons, logos, or decorative assets.
What's NOT Synced
The following are automatically excluded from sync:
- Unsupported binaries - videos, compiled assets, and image formats without a parser
- Large files - Files over 1MB
- Dependencies -
node_modules/,vendor/,.venv/ - Build outputs -
dist/,build/,.next/ - Version control -
.git/ - Minified files -
*.min.js,*.min.css - Lock files -
package-lock.json,yarn.lock,pnpm-lock.yaml
Viewing Sync Status
Check your sync status in the dashboard:
- Navigate to Project → Settings → GitHub
- View the sync panel showing:
- Last sync time - When docs were last updated
- Commit SHA - The Git commit that was synced
- Document count - Number of files indexed
- Webhook status - Whether push events are wired, disabled, missing, or need attention
- Yellow indicator means pending changes detected
- Click Sync Now to trigger a manual sync
Setup Guide
Step 1: Connect Your GitHub Account
- Go to Settings in your Snipara dashboard
- Click Connect GitHub in the Integrations section
- Authorize Snipara to access your repositories
Note
Snipara never writes to your repository content. When Auto-Sync is enabled, Snipara may create or repair the repository webhook so GitHub can notify Snipara after pushes.
Step 2: Configure Repository
In your project settings, configure the GitHub sync:
| Setting | Description | Example |
|---|---|---|
| Repository | The owner/repo format | acme/docs |
| Branch | Branch to sync from (default: main) | main |
| Path Filter | Directory or glob patterns (comma-separated) | docs/ or **/*.md |
Step 3: Initial Sync
Save settings first. If Auto-Sync is enabled, Snipara creates or repairs the repository webhook. Then click Sync Now to perform the initial sync. Snipara will:
- Fetch all matching files from your repository
- Create document records for each file
- Generate embeddings for semantic search
- Record the latest commit SHA for change detection
Step 4: Webhook Status
The GitHub Sync panel shows the current delivery state so you can tell whether future commits will sync automatically:
| Status | Meaning | Action |
|---|---|---|
| Webhook active | Snipara manages an active GitHub push webhook for this project. | No action needed. |
| Detected | A matching webhook exists, but it is not attached to the project record. | Save settings to attach and refresh it. |
| Disabled | The webhook exists but is inactive in GitHub. | Save settings to reactivate it. |
| Not provisioned | No matching GitHub push webhook exists yet. | Save settings to create it automatically. |
| Needs attention | GitHub denied webhook management or Snipara could not check the hook. | Reconnect GitHub or use the manual fallback URL and secret shown in the panel. |
Path Filtering
You can limit which files are synced using path filters. Snipara supports both directory paths and glob patterns:
Directory Paths
docs/→ Syncs all files in docs/ and subdirectoriessrc/components/→ Syncs all files in src/components/Glob Patterns
*.md→ All .md files in root directory**/*.md→ All .md files in any directory (recursive)docs/**/*.mdx→ All .mdx files under docs/Multiple Filters
Separate multiple paths or patterns with commas:
docs/, README.md, CONTRIBUTING.md→ All docs + specific files**/*.md, **/*.mdx→ All markdown and MDX filesSync Behavior
Incremental Updates
Snipara uses content hashing to detect changes. On each sync:
Created
New files in the repo are added as documents
Updated
Changed files have their content and embeddings refreshed
Deleted
Removed files are deleted from your project
Sync Results
After each sync, you'll see a summary:
{
"message": "Sync completed",
"created": 5,
"updated": 2,
"deleted": 1,
"unchanged": 42,
"errors": []
}Manual vs Automatic Sync
| Method | Trigger | Use Case |
|---|---|---|
| Manual Sync | Click "Sync Now" in dashboard | Initial setup, one-time updates |
| Webhook Sync | GitHub push or pull request event delivered to Snipara | Automatic updates after commits and PR Answer Pack queueing |
| API Sync | POST to /api/projects/:id/github | CI/CD integration |
API Reference
Get Sync Status
GET /api/projects/{projectId}/github
X-API-Key: snp-...
Response:
{
"isGitHubConnected": true,
"project": {
"githubRepo": "acme/docs",
"githubBranch": "main",
"githubPath": "docs/",
"githubLastSyncAt": "2025-01-20T12:00:00Z",
"githubLastCommitSha": "abc123...",
"githubSyncEnabled": true,
"githubWebhookId": "123456789",
"documentCount": 45
},
"webhookStatus": {
"configured": true,
"managed": true,
"hookId": "123456789",
"active": true,
"events": ["push", "pull_request"],
"lastResponse": {
"code": 200,
"status": "active",
"message": "OK"
},
"error": null
},
"branches": ["main", "develop"],
"hasChanges": true,
"latestSha": "def456..."
}Configure Sync
PUT /api/projects/{projectId}/github
Content-Type: application/json
{
"githubRepo": "acme/docs",
"githubBranch": "main",
"githubPath": "docs/",
"githubSyncEnabled": true
}When githubSyncEnabled is true, saving settings also creates or repairs the GitHub push webhook. If GitHub does not allow webhook management, the settings still save and the dashboard shows manual fallback details.
Trigger Sync
POST /api/projects/{projectId}/github
Response:
{
"message": "Sync completed",
"created": 5,
"updated": 2,
"deleted": 1,
"unchanged": 42,
"errors": []
}Private Repositories
Snipara fully supports private repositories. When connecting your GitHub account, you grant read access to your private repos. The sync process:
- Uses your OAuth token to authenticate with GitHub API
- Falls back to Contents API when download URLs aren't available
- Decodes base64 content for private repo files
- Never stores your GitHub credentials - only OAuth tokens
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| "GitHub account not connected" | No OAuth token found | Connect GitHub in Settings |
| "Repository not found" | Invalid repo or no access | Check repo name and permissions |
| "Failed to list branches" | Token expired or revoked | Reconnect GitHub account |
| Webhook needs attention | GitHub denied hook management or the hook cannot be checked | Reconnect GitHub, verify repository admin rights, or use the manual fallback |
| 0 files synced | No matching files found | Check path filter and file extensions |
| Slow sync | Large repository | Use path filters to limit scope |
Rate Limiting
Snipara includes a 100ms delay between file downloads to avoid hitting GitHub's rate limits. For large repositories, consider:
- Using path filters to limit the number of files
- Syncing during off-peak hours
- Keeping Auto-Sync enabled so GitHub sends only push events that need processing