EmbeddingGemma 2 Multimodal Firewall (DeepMind Steal)
Replaces brittle, single-modality 512-token embeddings with 8K-context, sub-0.5ms MRL-truncated multimodal pre-action interdiction that costs $0 in cloud tokens.
Commands
# Run system doctor diagnostic
npm run embeddinggemma:doctor
# CLI diagnostic (JSON or text)
npx thumbgate embeddinggemma --json
# Run unit test suite
node --test tests/embeddinggemma-adapter.test.js
Architectural Pillars
- 8K Context Window: Ingests up to 8,192 tokens (~32KB chars) without chunking, capturing entire multi-file diffs and terminal stack traces.
- Matryoshka Representation Learning (MRL): Native 768d truncates to 256d fast-gate with unit L2 re-normalization, cutting dot product compute by 66.7% for
<0.5msPreToolUse firewall evaluation. - Multimodal State Unification: Maps visual UI DOM/screenshots (BrowserOS Neo / Playwright) and bash commands into the same vector space.
- Fail-Closed RAG Identity Diode: Blocks cross-model vector distance calculations to prevent embedding pollution.