Sync
Intelligently sync files to your store with two methods of change detection: Git-based (fastest) and hash-based (most accurate). Only uploads files that have changed since the last sync, making it efficient for large document collections and perfect for CI/CD workflows.
Command
mxbai store sync <name-or-id> <patterns...> [options]Options
--strategy <strategy>- Processing strategy:fastorhigh_quality(default:fast)--contextualization- Deprecated: Now configured at store level usingmxbai store create --contextualization. This flag is ignored and will be removed in a future version.--from-git <ref>- Git reference for change detection (e.g.,HEAD~1,main)--dry-run- Preview changes without syncing--yes,-y- Skip confirmation prompt--force,-f- Force upload regardless of whether content has changed or not--metadata <json>- JSON metadata to attach to synced files--parallel <n>- Number of concurrent operations (default:100, range:1-200)
Change Detection
The sync command provides two methods of change detection:
- Git-based (fast): Uses
git diffto detect changes since a specific commit - Hash-based (accurate): Compares file hashes with stored metadata
Examples
# Sync with git-based detection
mxbai store sync "my-knowledge-base" "docs/**" --from-git HEAD~1
# Sync with hash-based detection and custom parallel processing
mxbai store sync "my-knowledge-base" "**/*.md" --parallel 10
# Sync with high-quality processing
mxbai store sync "my-knowledge-base" "**/*.md" --strategy high_quality
# Deprecated: contextualization is now configured at the store level
# mxbai store sync "my-knowledge-base" "**/*.md" --strategy high_quality --contextualization
# Dry run to preview changes
mxbai store sync "my-knowledge-base" "docs/**/*.md" --dry-run
# Skip confirmation prompt
mxbai store sync "my-knowledge-base" "**/*.md" --yes
# Force sync all files regardless of changes
mxbai store sync "my-knowledge-base" "**/*.md" --force
# Sync and set metadata
mxbai store sync "my-knowledge-base" "docs/**" --metadata '{"updated": "2024-01-15"}'
# Sync in CI/CD environment
mxbai store sync "my-knowledge-base" "docs/**" --yes --from-git HEAD~1Last updated: February 25, 2026