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 docs

How It Works

GitHub sync workflow
Rendering diagram...

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

RAG

Used for semantic documentation search and context answers.

.md.markdown.mdx.txt.rst.adoc

Code graph

CODE

Used for callers, imports, neighbors, and shortest-path code questions.

.py.pyi.ts.tsx.mts.cts.go

Parsed files

PARSER

Used 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.

.pdf.docx.pptx.svg.vsdx

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:

  1. Navigate to Project → Settings → GitHub
  2. 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
  3. Yellow indicator means pending changes detected
  4. Click Sync Now to trigger a manual sync

Setup Guide

Step 1: Connect Your GitHub Account

  1. Go to Settings in your Snipara dashboard
  2. Click Connect GitHub in the Integrations section
  3. 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:

SettingDescriptionExample
RepositoryThe owner/repo formatacme/docs
BranchBranch to sync from (default: main)main
Path FilterDirectory 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:

  1. Fetch all matching files from your repository
  2. Create document records for each file
  3. Generate embeddings for semantic search
  4. 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:

StatusMeaningAction
Webhook activeSnipara manages an active GitHub push webhook for this project.No action needed.
DetectedA matching webhook exists, but it is not attached to the project record.Save settings to attach and refresh it.
DisabledThe webhook exists but is inactive in GitHub.Save settings to reactivate it.
Not provisionedNo matching GitHub push webhook exists yet.Save settings to create it automatically.
Needs attentionGitHub 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 subdirectories
src/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 files

Sync 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

MethodTriggerUse Case
Manual SyncClick "Sync Now" in dashboardInitial setup, one-time updates
Webhook SyncGitHub push or pull request event delivered to SniparaAutomatic updates after commits and PR Answer Pack queueing
API SyncPOST to /api/projects/:id/githubCI/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:

  1. Uses your OAuth token to authenticate with GitHub API
  2. Falls back to Contents API when download URLs aren't available
  3. Decodes base64 content for private repo files
  4. Never stores your GitHub credentials - only OAuth tokens

Troubleshooting

IssueCauseSolution
"GitHub account not connected"No OAuth token foundConnect GitHub in Settings
"Repository not found"Invalid repo or no accessCheck repo name and permissions
"Failed to list branches"Token expired or revokedReconnect GitHub account
Webhook needs attentionGitHub denied hook management or the hook cannot be checkedReconnect GitHub, verify repository admin rights, or use the manual fallback
0 files syncedNo matching files foundCheck path filter and file extensions
Slow syncLarge repositoryUse 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

Next Steps