-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture & Internals
Antigravity Usage Intelligence is engineered to be lightweight, zero-overhead, and privacy-preserving.
flowchart TD
subgraph Local Storage [Local Disk / Ledgers]
A["Antigravity SQLite Ledgers<br/>(~/.gemini/antigravity/conversations/*.db)"]
B["Local Language Server<br/>(language_server_windows_x64.exe)"]
end
subgraph Telemetry Engine [Usage Intelligence Core]
C["Python Telemetry Engine (collector.py)<br/>• Read-Only WAL Mode (?mode=ro&immutable=1)<br/>• Non-blocking Protobuf Parser<br/>• Atomic Incremental Cache (<80ms)"]
D["Live Quota Detector (src/quota_detector.js)<br/>• Connect-RPC over HTTPS Loopback<br/>• CSRF Protected Local IPC"]
end
subgraph Extension Host [VS Code / Antigravity IDE]
E["Extension Backend (extension.js)<br/>• Status Bar Item<br/>• Multi-View Controller"]
F["Interactive Webview (src/ui/dashboard.html)<br/>• GitHub-Grade Heatmap<br/>• Dual Model Radial Gauges<br/>• Session Drawer & Search"]
end
A -->|Safe Read-Only WAL| C
B -->|Connect-RPC HTTPS| D
C -->|JSON Payload| E
D -->|Live Quota Sync| E
E -->|CSP & Nonce IPC| F
Google Antigravity stores active conversation steps in SQLite databases under ~/.gemini/antigravity/conversations/.
To prevent database locks, schema corruption, or query contention while active AI pairing sessions are running, collector.py enforces three safeguards:
-
URI Read-Only Parameter:
sqlite3.connect(f"file:{db_path}?mode=ro&immutable=1", uri=True)
-
Query-Only PRAGMA:
PRAGMA query_only = ON;
- WAL-Safe Journal Mode Check: Never attempts to write temporary rollbacks or checkpoint the WAL file.
Instead of guessing remaining quotas based on arbitrary heuristics, the extension connects directly to Antigravity's local language server process (language_server_windows_x64.exe):
- Process Discovery: Discovers the running server port and command-line arguments using local OS process tables.
- CSRF Protection: Extracts the internal ephemeral CSRF token generated during IDE startup.
-
Loopback HTTPS: Issues Connect-RPC POST requests to:
with headers:
POST https://127.0.0.1:<PORT>/exa.language_server_pb.LanguageServerService/GetUserStatus
Content-Type: application/json X-Csrf-Token: <CSRF_TOKEN>
-
Payload Unpacking: Reads
userStatus.tier,userStatus.quotaPools, anduserStatus.resetTimewithout sending any personal data or file contents.
Scanning thousands of historical conversation sessions on every UI render would introduce lag. Antigravity Usage Intelligence utilizes a derived-stats caching strategy:
- Cache file:
~/.gemini/antigravity/antigravity_stats_cache.json. - Only databases whose file modification timestamps (
mtime) have changed since the last scan are re-parsed. - Unmodified databases are served instantly from the cached index.
- Typical cold run: ~600ms.
- Typical warm run: < 80ms.
| Boundary | Policy | Implementation |
|---|---|---|
| Outbound Network | Zero Internet Access | No HTTP/HTTPS calls outside 127.0.0.1
|
| Code & Secrets | Zero Extraction | Prompts, files, code diffs, and API keys are never parsed or cached |
| Telemetry Beacons | Zero External Logging | No Google Analytics, no telemetry pings, no cloud tracking |
| Local Permissions | Read-Only Local Filesystem | Only reads Antigravity session metadata |
Antigravity Usage Intelligence · 100% Offline & Private · Open Source under MIT License · GitHub