MindSync AI
Local-first MCP orchestration, persistent shared memory, and automatic task routing for coding agents.
🌐 adityarya24.github.io/mindsync-ai
💡 What is MindSync?
MindSync connects disparate AI coding agents (Codex, Claude Code, Gemini CLI, Antigravity, Grok, Cursor, OpenCode, Aider) into a single, coordinated local ecosystem without requiring a cloud SaaS account or third-party servers.
The human-facing CLI session you are talking to remains in charge as the orchestrator. MindSync routes subtasks by domain capability, enforces file locks to prevent multi-agent collisions, tracks rate limits for seamless quota handoff across providers, and preserves long-term factual memory across sessions.
┌────────────────────────┐
│ You (Human Prompt) │
└───────────┬────────────┘
│
▼
┌────────────────────────────────────────────────┐
│ Human-Facing CLI Session (Orchestrator) │
│ (e.g., Codex / Claude / Gemini / Grok / ...) │
└──────────────────────┬─────────────────────────┘
│ (MCP Protocol)
▼
┌─────────────────────────────────────────────────────────────┐
│ MINDSYNC CORE │
│ ┌───────────────────────┬───────────────────────────────┐ │
│ │ Capability Router │ Conflict Prevention Shield │ │
│ ├───────────────────────┼───────────────────────────────┤ │
│ │ Quota & Handoff Tier │ Vector Memory (`sqlite-vec`) │ │
│ └───────────────────────┴───────────────────────────────┘ │
└─────────────────────────────┬───────────────────────────────┘
│ (Isolated Worktrees)
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Codex Worker │ │ Claude Worker │ │ Gemini / Grok │
│ (Implementation)│ │ (Deep Reasoning) │ │ (Audit & Search) │
└──────────────────┘ └──────────────────┘ └──────────────────┘
Key Guarantee: Dispatched workers receive bounded tasks inside isolated Git worktrees and cannot recursively re-delegate through MindSync.
⚡ Quick Start
1. Installation
pip install mindsync-ai
(Requires Python 3.10+)
2. Automated Auto-Discovery & Setup
# Auto-detects installed MCP hosts and PATH coding CLIs
mindsync setup --mode auto
# Verify system health, lock engines, and adapter status
mindsync doctor
# Inspect available agent roster and capabilities
mindsync agents
Restart your CLI sessions after setup to load the registered MCP servers.
# Additional setup options
mindsync setup --dry-run # Preview changes without modifying host configs
mindsync setup --cli grok # Target a specific host only
mindsync setup --no-discover # Register hosts without PATH CLI scanning
mindsync setup --no-hooks # Skip Codex standalone hooks
🤖 Supported Clients & Roster
A CLI may act as an MCP Host (orchestrator), a Worker (dispatched execution), or both:
| CLI / Engine | MCP Host | Dispatched Worker | Domain Strength / Role |
|---|---|---|---|
| OpenAI Codex | Native | Yes | Fast implementation, refactoring, standalone memory hooks |
| Anthropic Claude Code | Native | Yes | Architecture, comprehensive reviews, massive context |
| Google Gemini CLI | Native | Yes | Research, multimodal analysis, tool integrations |
Antigravity (agy) |
Via Gemini | Yes | Preferred execution worker in Gemini family |
| Grok CLI (xAI) | Native | Yes | Codebase exploration, security audit, rapid synthesis |
| Cursor Agent | JSON (mcp.json) |
Yes | In-IDE pair programming, file editing |
| OpenCode | JSON (opencode.jsonc) |
Yes | Context-first systems counseling & multi-model routing |
| Aider | — | Yes | Surgical git diffs & local file edits |
ℹ️ Family Isolation: Gemini CLI and
agyshare thegemini-antigravityfamily. When either is the human-facing orchestrator, both are excluded from automatic worker selection to protect orchestrator bandwidth.
🎯 Orchestration & Capability Dispatch
Policy configuration is located at ~/.mindsync/orchestration.json (Modes: auto, suggest, off).
Run Dispatched Jobs
# Route task automatically to best suited agent by capability
mindsync-dispatch run auto "implement and test the auth fix" --capability coding
# Check status of running or completed jobs
mindsync-dispatch status
Automatic Provider Quota Handoff
MindSync prevents blocked workflows when an LLM provider's quota exhausts mid-task. When enabled with an isolated worktree, MindSync transfers the working state, task prompt, and latest checkpoint to a ranked successor agent:
# Run with worktree isolation and automatic quota handoff
mindsync-dispatch run auto "refactor database schema" --write --worktree --on-limit handoff
# Inspect provider and account cooldowns
mindsync-dispatch limits
# Clear cooldowns manually after operator verification
mindsync-dispatch limits clear
Pre-emptive Usage Evaluation
MindSync includes pluggable usage readers. Bundled readers use local CLI/IDE session stores (not browser cookies). A missing or failed read stays unavailable — dispatch does not invent a percent.
| Adapter | Reader | Local source |
|---|---|---|
codex |
codex-oauth |
~/.codex/auth.json + ChatGPT WHAM usage |
claude |
claude-oauth |
~/.claude/.credentials.json + Anthropic OAuth usage |
grok |
grok-oauth |
Grok CLI session + billing credits |
agy / gemini |
antigravity-oauth |
Official Antigravity CLI vault + quota summary |
cursor |
cursor-oauth |
Cursor IDE session DB (User/globalStorage/state.vscdb), read-only. Opt-in: usage.readers.cursor: true. Off by default — this is not a Cursor CLI auth file. |
opencode |
opencode-go |
OpenCode Go plan key only, not BYOK upstreams |
Antigravity token refresh. A still-valid access token is enough to read quota. If the token has expired, refresh needs the official installed-app OAuth client. Set both of these in the environment of the process that runs dispatch/MCP — they are not stored in the repo:
MINDSYNC_ANTIGRAVITY_CLIENT_IDMINDSYNC_ANTIGRAVITY_CLIENT_SECRET
Without them, an expired Antigravity token makes the reader return unavailable (neutral, not a fake 0%). mindsync doctor reports the adapter as preemptive only when usage.enabled is on.
{
"usage": {
"enabled": false,
"defaultThresholdPercent": 90,
"orchestratorReservePercent": 80,
"pollingIntervalSeconds": 60,
"readers": {
"cursor": false
}
}
}
defaultThresholdPercent: Dispatched worker handoff threshold.orchestratorReservePercent: Threshold for warning the operator before starting large runs.readers.cursor: Must betruebefore MindSync opens Cursor's IDEstate.vscdb. The other bundled readers do not need a per-reader flag.- If a provider reaches threshold and a MindSync checkpoint exists, dispatch safely transfers the worktree diff to the successor agent.
Automated Pull Request Workflow
Configure MindSync to automatically publish branches and open PRs upon successful task completion:
# Enable PR creation upon successful completion for current repository
mindsync config onComplete pr --project .
(MindSync never auto-merges PRs and strictly declines to publish if checks fail or if secrets/sensitive tokens are detected in diffs).
🧠 Persistent Memory & Shared Facts
MindSync embeds a lightweight, local vector and relational database powered by sqlite-vec for cross-session knowledge retention:
# View memory database statistics
mindsync memory stats
# List recorded facts for a specific repository
mindsync memory list --project my-repo
# Semantic search across historical decisions and architecture facts
mindsync memory recall --project my-repo --query "database migration decision"
MCP Tool Bundles
- Orchestrator Hosts (16 Tools): Exposes full orchestration (
delegate_task,route_task,get_sync_context,update_focus,memory_checkpoint,memory_recall,queue_durable_fact, etc.). - Dispatched Workers (12 Tools): Runs with
MINDSYNC_WORKER=1, omitting recursive delegation tools while retaining shared context, focus locks, and fact retrieval.
🔒 Safety & Security Architecture
- Human-in-the-Loop Authority: The human-facing orchestrator CLI always retains final approval and verification.
- Explicit Binary Execution:
mindsync setuponly configures known recipes. Unknown binaries are suggested, never executed blindly. - Crash-Safe Locking: State updates use atomic writes and file locks. On Windows, lock contention timeouts are configurable via environment variables.
- Secret-Safe Serialization: Job status, telemetry, and handoff payloads strictly strip access tokens, auth headers, and raw credential structures before logging.
⚙️ Advanced Configuration & Environment Variables
Click to expand Environment Variables
| Variable | Description | Default |
|---|---|---|
MINDSYNC_HOME |
Root configuration directory | ~/.mindsync |
AGENT_DISPATCH_HOME |
Storage for dispatch jobs and rosters | ~/.mindsync/dispatch |
MINDSYNC_CALLER_CLI |
Declares calling CLI engine identity | Auto-detected |
MINDSYNC_QUEUE_LOCK_TIMEOUT |
Max wait time for file locks (seconds) | 10.0 |
MINDSYNC_LOCK_CONTENTION_BACKOFF_BASE |
Backoff base for Windows lock contention | 0.05 |
MINDSYNC_SSH_HOST |
Remote VPS host for optional sync | — |
MINDSYNC_REMOTE_ROOT |
Remote VPS sync directory | — |
MINDSYNC_ANTIGRAVITY_CLIENT_ID |
Google installed-app client id for Antigravity token refresh | — |
MINDSYNC_ANTIGRAVITY_CLIENT_SECRET |
Matching client secret. Required only when the vault access token is expired; omit both rather than guessing | — |
🛠️ Development & Testing
# 1. Clone repository
git clone https://github.com/adityarya24/mindsync-ai.git
cd mindsync-ai
# 2. Set up virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 3. Install in editable mode with development dependencies
python -m pip install -e ".[dev]"
# 4. Run linter & test suite
python -m ruff check .
python -m pytest -q
📄 License
Distributed under the MIT License. Open-source and free for personal and commercial use.
Metadata
Release files for mindsync-ai 1.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mindsync_ai-1.9.0.tar.gz | 278.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mindsync_ai-1.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 473.2 kB
Release files / mindsync_ai-1.9.0.tar.gz
| Download URL | mindsync_ai-1.9.0.tar.gz |
|---|---|
| Size | 278.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
123891a7135f402d500e825d80a12596fba5dcfa8966e282aa6e29797283b40e
|
|
BLAKE2b-256 checksum How to use checksums |
edc8239900fe79fd326a8827372ce92b0496388db1d0283a426f55c12c8c42ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / mindsync_ai-1.9.0-py3-none-any.whl
| Download URL | mindsync_ai-1.9.0-py3-none-any.whl |
|---|---|
| Size | 194.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51751102b74421b10608b2417fd88a14f059f497595b14b02ad3b2b3cb76a40c
|
|
BLAKE2b-256 checksum How to use checksums |
5c0eec92400e7403543d7da42a16902bc0cbeef6508b924b7318689401374e46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logSecurity for mindsync-ai 1.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mindsync_ai-1.9.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.