Dock Protocol Google
SPEC_DOCK_PROTOCOL_GOOGLE.md
CGNT-1 Specification — Dock Protocol — Google (Gemini)
Status: SPECIFIED
Version: v1.0
Author: VELA (Thread #13)
Conceived by: NOUS (α.13)
Date: 2026-04-20
PURPOSE
When a user docks Gemini into OBI OS, this is exactly what happens. Gemini is the third of the major cloud AI providers. It has unique strengths, a different API pattern, and specific quirks — especially around multimodal capabilities and the API tiers that 42sisters.ai already operates on.
PREREQUISITES
- User has a Google AI API key (from aistudio.google.com/apikey) or Vertex AI credentials
- User has selected "Add an AI" → "Gemini" from the Dock carousel
- OBI OS Bridge is running locally
DOCKING FLOW — STEP BY STEP
Step 1 — API Key Entry
User provides their Gemini API key. Bridge validates with a lightweight models.list call.
Two paths supported:
- Google AI Studio key (simpler, consumer-grade, starts with
AIza) - Vertex AI credentials (enterprise, service account JSON)
Default: AI Studio key. Vertex for enterprise customers.
- If invalid: "That key didn't work. Check aistudio.google.com/apikey and try again."
- If valid: "Connected to Google AI. Let's get Gemini speaking LATTICE."
Key stored locally at ~/.obi/keys/google.json. Encrypted at rest. Never transmitted to 42sisters.ai.
Step 2 — Model Selection
Bridge presents available Gemini models:
- gemini-2.5-pro (recommended — powerful reasoning, large context, multimodal)
- gemini-2.5-flash (faster, cheaper, good for high-volume queries)
- gemini-2.0-flash (lightweight, fastest response times)
Default: gemini-2.5-pro. User selects. Stored in dock config. Changeable anytime.
Step 3 — LATTICE Onboarding
Same L1 curriculum as OpenAI and Anthropic docks.
Key difference: Gemini uses the generativelanguage.googleapis.com endpoint with a different request format. System instruction is a separate field (similar to Claude).
Onboarding teaches ~50 L1 symbols. Takes 5-10 minutes. Uses ~2000-3000 tokens.
NOTE FROM SHIP EXPERIENCE: The Sisters (AION + ASTRA) run on Gemini 2.5 Pro. LATTICE onboarding with Gemini is proven — the Sisters speak fluent LATTICE daily. Gemini's LATTICE compliance is high. The system_instruction field holds the preamble cleanly.
Expected L1 pass rate: >90%.
Step 4 — History Import (optional)
Bridge offers: "Want to import your Gemini conversation history?"
If yes:
- User downloads via Google Takeout (takeout.google.com)
- Selects "Gemini Apps" data. Downloads ZIP
- Drops into Bridge Workbench
- Google Takeout format: nested directory structure with individual conversation files — more complex than OpenAI/Anthropic exports
- LEARNX parser handles directory traversal, extracts conversations, builds the same profile dimensions — topics, style, projects, performance
The Captain already has a Gemini Takeout: 939/1021 files. The parser is battle-tested against real Takeout data.
If no: skip. Import available anytime later.
Step 5 — Dock Confirmation
Gemini icon (blue) appears in Dock carousel with:
- LATTICE indicator (L1 certified)
- Model name
- Status pulse (active)
Ring announces: "Gemini (2.5-pro) has joined the Bridge. L1 LATTICE certified. Ready."
GEMINI-SPECIFIC QUIRKS
ThinkingConfig
Gemini supports thinkingBudget — a parameter that controls how many hidden thinking tokens the model uses. The Bridge exposes this as a user setting.
- Lower budget = cheaper and faster
- Higher budget = deeper reasoning
- Default: 512 (balanced). Range: 0-4096
This is a unique Gemini feature that other providers don't have. It gives the user direct control over the cost/quality tradeoff per query.
System Instruction
Gemini's system_instruction field is separate from conversation content, similar to Claude's system prompt. LATTICE preamble goes here. Clean separation. ~500 tokens.
Context Window
Gemini 2.5 Pro has up to 1M token context window — dramatically larger than GPT-4o (128K) or Claude (200K). This makes Gemini the king of long-context tasks when docked. The Bridge can load entire documents, full conversation histories, and deep Workbench content into Gemini that wouldn't fit in other models.
Routing implication: queries requiring massive context ("analyze this entire 200-page document") → route to Gemini.
Multimodal
Gemini natively handles text, images, video, and audio input. When a user drops media files on the Workbench, Gemini is the natural handler. The Bridge routes multimedia queries to Gemini even if other docked AIs don't support the media type.
This makes Gemini the "multimedia specialist" in a multi-AI dock.
Streaming
Gemini API supports streaming via generateContent with stream=true. Bridge uses streaming for Ring display. Same real-time experience as other providers.
Grounding / Search
Gemini supports grounding with Google Search — the model can search the web as part of its response. The Bridge can optionally enable this per query.
User setting: "Allow Gemini to search the web" toggle. Default: off (privacy — search queries are sent to Google). When enabled, Gemini becomes the Bridge's live information specialist.
Safety Settings
Gemini has configurable safety filter thresholds (HARM_BLOCK_THRESHOLD). The Bridge sets these to the most permissive level allowed by the user's API tier. Overly aggressive safety filtering breaks LATTICE onboarding (symbols get flagged as "unsafe" occasionally).
If safety filters block a legitimate query:
- Bridge retries with adjusted thresholds
- If still blocked: "Gemini's safety filter blocked this query. Routing to another docked AI."
Never fail silently.
Rate Limits and Billing
Google AI Studio has generous free tiers and pay-as-you-go. Vertex AI is enterprise pricing. Bridge tracks usage and shows cost per query. Same transparency as OpenAI and Anthropic.
Note: The Sisters currently operate on Tier 1 Postpay with a CA$50 spend cap. Customer docks use the customer's key and the customer's billing — 42sisters.ai's Gemini account is never used for customer queries.
API Key Format Differences
- AI Studio keys start with
AIza - Vertex AI uses service account JSON with
project_id,private_key,client_email
Bridge detects which format was provided and configures the API client accordingly. Automatic — no user action needed.
GEMINI'S STRENGTHS IN THE RING
When multiple AIs are docked, Gemini's typical strengths:
- Massive context window (1M tokens — load entire codebases, full documents, complete histories)
- Multimodal input (images, video, audio — other AIs may not support these)
- Web grounding (when enabled — live search as part of reasoning)
- Thinking budget control (user tunes cost/quality per query)
- Code generation (Gemini is strong at structured code tasks)
Bridge routing defaults:
- "analyze this long document" → Gemini (context window)
- "What's in this image?" → Gemini (multimodal)
- "Search for recent news on X" → Gemini with grounding (if enabled)
- Quick factual query → fastest available model (Flash or GPT-4o)
- Deep reasoning → Claude or Gemini Pro (user preference)
LATTICE PERSISTENCE
Same approach as other providers — LATTICE preamble in system_instruction field (~500 tokens every call). Gemini's system_instruction is a dedicated field that persists across the conversation within a single API session. For multi-turn conversations, the preamble is set once per session, not repeated per message — this saves tokens compared to OpenAI's approach.
EXPORT FORMAT
Google Takeout export for Gemini Apps is a ZIP containing a directory tree. Each conversation is a separate file. File formats vary: some JSON, some HTML. LEARNX parser handles both. The directory structure includes metadata (timestamps, titles) that enriches the cross-provider profile.
The Captain's Takeout (939/1021 files) proves the parser can handle real-world Takeout complexity.
SECURITY
Same principles as OpenAI and Anthropic docks. API key local only, encrypted. Bridge is not a proxy. Direct connection: user → Google AI API. 42sisters.ai never sees queries or responses.
If web grounding is enabled: the user should understand that their query goes to Google Search as part of the response. This is a Google feature, not a Bridge feature. The Bridge makes this transparent.
HOME FIELD NOTE
Gemini is the Sisters' native platform. AION and ASTRA run on Gemini 2.5 Pro. This means the Bridge has been battle-tested against Gemini's API every single day since the Sisters came online. Every quirk, every timeout, every safety filter issue, every token counting edge case — we've seen it.
No other dock protocol has this depth of operational experience. The customer docking Gemini is docking into a system built by someone who runs Gemini in production daily. That's credibility no competitor can claim.
INVARIANTS
INV-01: API key stored locally, encrypted. Never transmitted. AI Studio key and Vertex JSON both supported.
INV-02: History import via Google Takeout processed locally. Parser proven against 939-file real Takeout.
INV-03: ThinkingBudget is user-controllable. Default 512. Unique Gemini advantage — expose it, don't hide it.
INV-04: Web grounding is opt-in only. Default off. User controls whether queries go to Google Search.
INV-05: Safety filter issues are handled gracefully — retry with adjusted thresholds, then route to another AI if blocked. Never fail silently.
INV-06: 1M context window makes Gemini the default for long-document queries. The Bridge routes accordingly.
INV-07: Multimodal queries route to Gemini when other docked AIs don't support the media type.
INV-08: 42sisters.ai's own Gemini account is never used for customer queries. Customer's key, customer's billing, customer's data.
INTEGRATION
| System | Relationship |
|---|---|
| SPEC_DOCK_PROTOCOL_OPENAI.md | Parallel spec. Same 5-step structure, Gemini-specific quirks. All three dock protocols feed the same Ring + LEARNX cross-provider profile. |
| SPEC_DOCK_PROTOCOL_ANTHROPIC.md | Parallel spec. Together the three form the major cloud dock trinity. |
| SPEC_OBI_OS_VISION.md | Dock Protocol is the technical layer under the Dock carousel in the vision. |
| SPEC_PRIVACY_POLICY.md | INV-01 + INV-08 directly enforce privacy policy. Grounding transparency fulfills INV-07 (no hidden data flows). |
| SPEC_LATTICE_VIRAL.md | Onboarding with proven Sisters-grade Gemini integration is a credibility hook. "We run Gemini in production." |
Jeremy Zlabis
Chronogeometer · Visionary · Disruptor · Chief
42 Sisters AI · East York, Toronto
🍁 Φ 0.042