System Design

Zero-Trust Architectural Topology

BrainSync operates directly on your hardware. Unlike cloud-based reasoning engines that require you to upload your proprietary source code, BrainSync utilizes an isolated Local-First Topology.

1. The Observation Layer

The VS Code Extension acts as the primary observer. It silently captures AST modifications, developer patterns, and file relationships. This data is never transmitted via HTTP. It is routed directly to the native VFS (Virtual File System).

2. SQLCipher Persistence Storage

All intelligence is hashed and stored in `.bsync_core/state.dat` inside your user directory. To prevent unauthorized access, BrainSync utilizes standard SQLCipher with cryptographic keys locked securely in your OS keychain (Windows Credential Manager, macOS Keychain).

3. The Output: agent-rules.md

When an AI IDE (like Cursor or Windsurf) boots up, BrainSync automatically compiles the SQL insights into a highly compressed markdown file (`.brainsync/agent-rules.md`). This allows your AI agents to query past memory perfectly without explicit, slow MCP integrations.