One context layer every AI talks to — it remembers you, acts for you, and your private data stays on your device.
Contxt is a portable, privacy-first AI context layer and Model Context Protocol (MCP) server that gives every AI assistant your personal context while keeping sensitive data offline. Powered by an on-device fine-tuned Gemma 3 270M model running via WebGPU, Contxt bridges your personal data (Gmail, Google Calendar, Notion) into Claude Desktop, ChatGPT, and Gemini with zero cloud plaintext leakage. Built for the AMD Developer Hackathon ACT II (Track 3 — Unicorn; on-device Gemma bonus).
- ▶ Live Demo: https://blackx16.github.io/contxt/
- Repository: https://github.com/Blackx16/contxt
- On-Device Model: 🤗 chandr1601/contxt-gateway-270m-onnx
Every AI (ChatGPT, Claude, Gemini, Copilot, Grok) grew a memory in 2026 — five walled gardens, none talk to each other, and you re-introduce yourself to each one. Every memory product (Mem0, Supermemory, Letta) is cloud-first and developer-facing. Contxt is the consumer piece nobody built: portable across every AI, and privacy-first — your crown jewels never leave your device.
- Browser Extension (
extension/): Connect Gmail, Calendar & Notion (in-extension OAuth), tier every item on-device, inject your SHARED context into Claude/ChatGPT/Gemini live, and keep PRIVATE items encrypted locally. - Web App (
web/, GitHub Pages): Dashboard, explainer, and multi-device cryptographic proof. A Demo / Live toggle (top-right) switches between the built-in demo and your live context read from the installed extension in real time.
- PRIVATE (Crown Jewels): Classified on-device (a fine-tuned Gemma 3 270M + deterministic rules), end-to-end encrypted. The cloud is a blind relay (ciphertext only) for multi-device sync. Zero-knowledge.
- SHARED: Distilled by a cloud LLM into reusable context cards any AI can read over MCP.
- Crown-Jewels Gateway: The on-device router that sorts each item PRIVATE vs SHARED. It is the trust boundary — and the product.
docs/ARCHITECTURE.md— Full two-tier data flow (Mermaid diagram) + local-vs-cloud split at every stage.docs/SCHEMA.md— Frozen context-card contract (ContextCard,Entity,Tier,Source; JSON Schema + TS + Python mirrors).docs/amd_compute_capture.md— Proof of AMD compute: MI300X fine-tuning (ROCm 7.2, PyTorch 2.9), training logs,rocm-smi, eval table.
Ingest (Gmail + Calendar + Notion)
└─► Gateway (On-device tier decision via Gemma 3 WebGPU)
├─► PRIVATE ──► Local WebCrypto (AES-256-GCM) ──► Blind Relay (Ciphertext only)
└─► SHARED ──► Cloud Distill (gpt-oss-120B) ──► MCP Server (Claude/ChatGPT/Gemini)
Ingest (Gmail + Calendar + Notion) → Gateway (on-device tier decision) → Distill (on-device Gemma for PRIVATE / cloud gpt-oss-120B for SHARED → context cards) → Store (E2E blind relay for PRIVATE; store for SHARED) → Serve over MCP (get_context / draft_reply) → any AI.
The PRIVATE-vs-SHARED decision runs on a fine-tuned Gemma 3 270M, hosted at 🤗 chandr1601/contxt-gateway-270m-onnx and loaded in-browser via Transformers.js (q4f16 ONNX, WASM). It emits the tier JSON {"tier","sensitivity","categories","reason"}; deterministic rules (gateway/rules.py) act as an always-on safety floor beneath it.
| Metric (253 hold-out) | Fine-tuned Gemma 3 270M | Base Gemma 3 (zero-shot) |
|---|---|---|
| JSON valid | 100% | 79.4% |
| Tier accuracy | 97.6% | 43.1% |
| PRIVATE recall | 99.4% | 69.0% |
| Sensitivity MAE | 0.050 | 0.475 |
Training code, dataset, and the prompt contract live in finetune/ on branch finetune/gemma-gateway-270m.
AMD Instinct MI300X Compute: Our on-device gateway classifier was fine-tuned on an AMD Instinct MI300X (ROCm 7.2, PyTorch 2.9). Same accuracy as larger models, 18× lower latency, 6× smaller — AMD trains it, the user's browser runs it via WebGPU, and the cloud never sees private data. Full proof: docs/amd_compute_capture.md.
Connect your sources, choose On-device (downloads Gemma 270M once via WebGPU) or Online only, and Contxt tiers each item on-device and auto-injects shared cards into Claude/ChatGPT/Gemini.
# Load unpacked in developer mode:
# Navigate to chrome://extensions -> Developer mode -> Load unpacked -> select ./extensioncd web
npm install
npm run dev
# Open http://localhost:5173# Run HTTP bridge in mock mode (no API keys required):
python3 server/http_bridge.py
# Bridge running at http://127.0.0.1:8787
# Verify zero private data leakage:
python3 server/verify_cha26.py# Pull published GHCR container (linux/amd64):
docker run -p 8787:8787 ghcr.io/blackx16/contxt:latest
# Health check: curl http://127.0.0.1:8787/health
# Run stdio MCP server for Claude Desktop:
docker run ghcr.io/blackx16/contxt python -m server.mcp_serverFor real cloud distillation, set FIREWORKS_API_KEY and CONTXT_CLOUD_MODEL in .env (see .env.example).
The PRIVATE encryption key never touches the cloud. Device A renders the key as a QR envelope; Device B scans it, pulls ciphertext from the blind relay, and decrypts locally. Only ciphertext traverses the wire — the relay structurally has no key field.
- Demo: Web App → Devices tab.
- Cryptographic Verification:
python3 server/verify_cha22.py
- Web: SvelteKit 2 + Svelte 5 (fully static, GitHub Pages)
- Extension: MV3 — Svelte popup, offscreen WebGPU Gemma runtime, content-script injection + site bridge
- On-Device Model: Fine-tuned Gemma 3 270M (q4f16 ONNX, WASM) via Transformers.js
- Cloud Model: gpt-oss-120B on Fireworks AI
- Encryption: Web Crypto API (AES-256-GCM + ECDH), QR key transfer
- Server: Python MCP server (
get_context,draft_reply) + local HTTP bridge + blind relay
| Path | Description |
|---|---|
ingest/ |
Read-only source adapters (Gmail + Calendar + Notion) → normalized IngestItem[] |
schema/ |
Frozen shared contract — context-card JSON Schema + Python/TS mirrors |
gateway/ |
Crown-Jewels Gateway — deterministic rules + Gemma classifier + cloud distill |
server/ |
MCP server + HTTP bridge (http_bridge.py) + blind relay (relay.py) |
web/ |
SvelteKit app — landing, onboarding, context viewer (Demo/Live), multi-device QR |
extension/ |
MV3 extension — Svelte popup (ui-src/), offscreen Gemma, injection + site bridge |
docs/ |
Architecture, AMD compute proof, demo script |
Contributions are welcome! Please check out our:
To report bugs or propose new features, please open an issue.
If you use Contxt or our fine-tuned Gemma 3 on-device model in your research, please cite:
@software{solanki2026contxt,
author = {Solanki, Chandraveer Singh and K.R., Theerth},
title = {Contxt: A Portable, Privacy-First Context Layer and MCP Server for AI},
year = {2026},
url = {https://github.com/Blackx16/contxt}
}- Chandraveer Singh Solanki
- Theerth K.R.
This project is licensed under the GNU Affero General Public License v3.0.