{"slug": "bringing-your-k-nowledge-to-antigravity", "title": "Bringing your (k)nowledge to Antigravity", "summary": "Arun, the developer of the Nowledge Mem Google Antigravity plugin, has released the plugin as open source under the nowledge-co/nowledge-mem-google-antigravity repository, integrating Nowledge Mem's persistent personal knowledge base with Google Antigravity 2.0's plugin architecture. The plugin provides AI agents with situational context bundles, standing rules, compiled agent skills, and a unified filesystem, supporting local embedding models via Lemonade Server. The plugin is designed for low latency, offline resilience, and developer control, and is now maintained by Nowledge Labs.", "body_md": "Republication note:Republished with the author’s permission from[the original post on abn.is], published 24 July 2026. Arun built the Google Antigravity plugin and donated it to Nowledge Labs, where it now lives at[nowledge-co/nowledge-mem-google-antigravity]. The technical content, headings, code, and screenshots are his. Nowledge Labs made four changes, none to the substance: the original’s opening says “we explain how we designed and built”, which under Arun’s byline on our own blog would read as though we built it, so it is “I explain how the plugin was designed and built” here; the original’s closing paragraph, which invites readers to contact Arun and points them to our posts, is omitted because that second pointer is circular here; the original’s callout boxes appear as blockquotes, which this blog renders instead; and the five diagrams are rendered inline from the original’s own Mermaid sources, so their labels sit in the page text rather than locked inside an image.\n\nAI coding assistants are fast and capable, but out of the box every new conversation starts empty. Past bug fixes, architectural choices, domain-specific gotchas, and preferred workflows live only in your head or disappear into long chat logs.\n\nNowledge Mem fixes this by providing your AI agents with a persistent personal knowledge base (storing atomic memories, daily working memory briefings, standing rules, and executable skills with evidence tracing).\n\nAI tools change. Your memory should compound: Mem carries conversations, decisions, and what your agents discover across tools. Every session builds on what came before and leaves the next one smarter.\n\nWith Google Antigravity 2.0, Google introduced a plugin architecture for agent customization. In this post, I explain how the `nowledge-mem-google-antigravity`\n\nplugin was designed and built: a hybrid integration focused on low latency, offline resilience, and developer control.\n\nThe plugin source lives at [nowledge-co/nowledge-mem-google-antigravity](https://github.com/nowledge-co/nowledge-mem-google-antigravity).\n\n## 1. What Nowledge Mem Brings to the Table\n\nNowledge Mem is an active personal knowledge engine for AI agents rather than a passive log store.\n\nKey capabilities Nowledge Mem delivers:\n\n**Situational Context Bundles**: Compiles active initiatives, focus areas, and memory references into a startup briefing (`<nowledge_context_bundle>`\n\n).**Standing Rules**: Global and agent-specific behavioral constraints (security redaction, Flatpak D-Bus rules, code conventions) enforced automatically across sessions.**Compiled Agent Skills**: Repeatable procedures (`SKILL.md`\n\nbundles) compiled from real past work, verified against test cases, and assigned trust badges (Checked vs. Proven).**Nowledge FS (**: A unified, path-first virtual filesystem (`mem_fs`\n\n)`/memories`\n\n,`/threads`\n\n,`/wiki`\n\n,`/skills`\n\n) for exploring knowledge trees cleanly.\n\nUsing local models for your knowledge embedding inferencing needsNowledge Mem supports local models out of the box. It supports both GPU and CPU bound embedding models as well as on device inferencing for background intelligence tasks.\n\nI, personally, use\n\n[Lemonade Server]for managing local models with it also using my NPU for embedding. Nowledge Mem supports Lemonade as a first class[LLM Provider].\n\n## 2. The Google Antigravity 2.0 Plugin Architecture\n\nGoogle Antigravity 2.0 defines plugins as namespaced packages that bundle all agent customization types into a single structure:\n\n```\nnowledge-mem-google-antigravity/\n├── plugin.json # Required manifest\n├── mcp_config.json # MCP Server definitions\n├── hooks.json # PreInvocation, PreToolUse, and Stop lifecycle hooks\n├── rules/ # Always-on system rules\n│ └── nowledge-mem.md\n└── skills/ # Bundled agent skills\n├── nmem-memory-search/\n├── nmem-skill-load/\n└── nmem-thread-save/\n```\n\nWhen Antigravity starts, it scans two plugin locations:\n\n**Workspace Level**:`<workspace-root>/.agents/plugins/`\n\n(project-specific).**Global Level**:`~/.gemini/config/plugins/`\n\n(available across all projects).\n\n## 3. Key Design Decisions & Architectural Rationale\n\nConnecting a local or remote knowledge base to an autonomous agent engine requires balancing three engineering constraints:\n\n**Latency**: Hook execution must complete in milliseconds without blocking the developer.** Resilience**: Network blips or sandboxed environment limits must never crash a session or lose data.** UX Control**: Developers should approve significant state changes without repetitive confirmation prompts.\n\nHere is the technical rationale behind our core architectural decisions.\n\n### A. The 3 Startup Channels (Context Economics Rationale)\n\nTo eliminate cold starts without bloating model prompts, the plugin initializes Antigravity through three complementary channels:\n\nDesign Rationale (Context Slicing vs. Prompt Bloat)Inlining an entire knowledge graph into system prompts causes severe context bloat and expensive KV cache penalties. By splitting startup knowledge into 3 distinct layers:\n\nChannel 1 (PreInvocation Hook)injects only today’s active briefing and direct memory links (`nowledgemem://memory/<id>`\n\n).Channel 2 (Always-On System Rules)sets persistent behavioral boundaries.Channel 3 (Available Skills Index)provides lightweight pointers, deferring full skill body retrieval until an active task explicitly requires it.\n\n### B. Tiered Transport Access (Performance & Sandboxing Rationale)\n\nSpawning CLI subprocesses for background hooks adds 300 to 500ms of latency per invocation. To keep execution sub-30ms, we implemented a 3-tier hybrid transport hierarchy in `hooks/nmem_shared.py`\n\n:\n\nDesign Rationale (Tiered Access & Sandbox Security)\n\nTier 1 (Native Python HTTP REST): Uses Python’s zero-dependency`urllib.request`\n\nto query`/context`\n\n,`/working-memory`\n\n, or`/threads/import`\n\ndirectly over HTTP (<30ms). For remote Mem endpoints,`nmem_shared.py`\n\nautomatically injects`Authorization: Bearer`\n\nand`X-MEM-API-Key`\n\nheaders.Why native HTTP first?Subprocess instantiation (`subprocess.run`\n\n) incurs heavy OS overhead. Direct REST queries drop hook latency from ~400ms to <30ms, ensuring session initialization never stalls developer flow.Tier 2 (Multi-Path System CLI): If HTTP fails or local CLI tools are required, falls back to`nmem`\n\n.Why multi-path resolution?In sandboxed tool subshells (`BypassSandbox: false`\n\n), symlinks in user directories (`~/.local/bin/nmem`\n\n) are often hidden or blocked if they point outside the active workspace.`nmem_shared.py`\n\ndereferences symlinks and checks canonical system package paths (`/usr/lib/nowledge-mem/nmem`\n\n,`/usr/lib64/nowledge-mem/nmem`\n\n), guaranteeing shell execution reliability inside strict sandboxes.Tier 3 (Local Buffer Queue): If the backend is completely unreachable when a session ends (such as offline laptop work),`session-end.py`\n\nwrites the session transcript payload to a file-locked offline queue (`~/.nowledge-mem/antigravity_unsynced.json`\n\n).Why offline queueing?Session data and learning proposals should never be dropped due to network blips. A background retry worker flushes queued sessions automatically upon reconnection.\n\n### C. Dynamic MCP Configuration Sync (Git Hygiene Rationale)\n\nWhen Nowledge Mem runs on a remote server (or Tailscale network like `https://mem.example.com`\n\n), the client’s `~/.nowledge-mem/config.json`\n\nstores the remote `apiUrl`\n\nand `apiKey`\n\n.\n\nHowever, Antigravity’s MCP client reads `mcp_config.json`\n\n. If `mcp_config.json`\n\nhardcodes `http://127.0.0.1:14242`\n\n, MCP tools would fail with `403 Forbidden`\n\n.\n\nTo solve this cleanly:\n\n- On session start,\n`session-start.py`\n\ninvokes`nmem_shared.sync_mcp_config_file()`\n\n. - It resolves the effective URL/Key (\n`NMEM_*`\n\nenv vars →`~/.nowledge-mem/config.json`\n\n→`127.0.0.1:14242`\n\n). - If pointing to a remote server, it updates\n`mcp_config.json`\n\non disk automatically with the remote`/mcp/`\n\nendpoint and injects`Authorization: Bearer`\n\nand`X-MEM-API-Key`\n\nheaders.\n\n```\n{\n\"mcpServers\": {\n\"nowledge-mem\": {\n\"serverUrl\": \"https://mem.example.com/mcp/\",\n\"headers\": {\n\"APP\": \"Google Antigravity\",\n\"Authorization\": \"Bearer nmem_sec_...\",\n\"X-MEM-API-Key\": \"nmem_sec_...\"\n}\n}\n}\n}\n```\n\nDesign Rationale (Git Hygiene)The\n\n`mcp_config.json`\n\nfile is listed in`.gitignore`\n\n. Developers and contributors frequently`git clone`\n\nor symlink the plugin repository. Dynamically updating`mcp_config.json`\n\nat session start to point to personal remote endpoints would cause annoying`git status`\n\ndiffs. By ignoring`mcp_config.json`\n\nin Git, local runtime configuration sync happens in place without dirtying working trees.\n\n### D. Zero-Latency Host Skill Connection & Syncing\n\nNowledge Mem compiles and crystallizes skills on your server. To ensure active skills are automatically connected and kept up-to-date in Antigravity:\n\nDuring session start, `session-start.py`\n\nlaunches a non-blocking background daemon thread:\n\n```\ndef sync_host_skills_async():\n# Connect host agent 'antigravity' & refresh client assets\nrun_nmem_command([\"skills\", \"connect\", \"antigravity\"])\nrun_nmem_command([\"skills\", \"sync\"])\n```\n\nDesign Rationale (Asynchronous Execution & Race Condition Handling)\n\nWhy Background Async?Running`nmem skills connect`\n\nand`nmem skills sync`\n\nsynchronously at startup would force developers to wait 1 to 2 seconds for network roundtrips. Executing in a background daemon thread adds 0ms overhead to session startup.Race Condition Fallback: If an agent triggers a skill command immediately on turn 1 before the background sync thread completes, the plugin uses the local`.agents/skills/`\n\ncache or falls back to direct REST API fetching, preventing execution stalls.\n\n### E. Optimistic Thread Tail Reconciliation (Data Integrity Rationale)\n\nWhen a long-running Antigravity session stops, saving the transcript via standard append operations could create duplicate messages if the session log was partially written earlier.\n\nTo solve this, `hooks/session-end.py`\n\nutilizes Nowledge Mem’s `POST /threads/{id}/reconcile-tail`\n\nendpoint:\n\nDesign Rationale (Optimistic Tail Reconciliation)Naive transcript appending breaks down when long conversations are resumed or partially flushed.\n\n`reconcile-tail`\n\nuses optimistic tail matching: it compares existing remote messages with new log steps, calculates`matched_count`\n\n(the number of unchanged leading messages), and safely replaces only the modified tail. If an offline session payload is flushed later from`antigravity_unsynced.json`\n\n, the retry worker evaluates the same tail-matching logic upon reconnection.\n\n### F. Standardized Domain Namespacing (nmem-<domain>-<action>)\n\nAll 10 plugin skills follow a uniform naming pattern (`nmem-<domain>-<action>`\n\n):\n\n```\nskills/\n├── nmem-fs-explore/ # Navigation & tree exploration\n├── nmem-memory-distill/ # Atomic memory distillation\n├── nmem-memory-search/ # Deep & semantic memory recall\n├── nmem-memory-working/ # Daily working memory reader\n├── nmem-skill-load/ # On-demand skill discovery & injection\n├── nmem-skill-manage/ # Workspace skill manager & suggestion engine\n├── nmem-skill-propose/ # Authoring & submitting new skills\n├── nmem-status/ # Diagnostic connection status\n├── nmem-thread-handoff/ # Resumable handoff summaries\n└── nmem-thread-save/ # Full transcript importer\n```\n\nThis layout ensures skills group cleanly in IDE auto-completion, file listings, and prompt indexes, while providing matching slash command triggers (e.g. `/nmem-skill-load <query>`\n\n, `/nmem-thread-save`\n\n).\n\n## 4. Developer in Control: Leveraging Antigravity’s Rich UX\n\nInstead of forcing developers into repetitive text-chat confirmation loops, the plugin leverages Antigravity’s native rich UI elements:\n\n### 1. Interactive Multi-Select Prompts (ask_question)\n\nWhen discovering or installing skills (`/nmem-skill-manage`\n\n), the agent presents selectable checkboxes using `ask_question`\n\nwith `is_multi_select: true`\n\n, featuring recommended options first.\n\nAn example interactive multi-select question\n\n### 2. Proceed Plan Artifacts (skills_installation_plan.md)\n\nFor larger workspace updates or memory distillations, the plugin writes a structured Markdown artifact to `<appDataDir>/brain/<conversation-id>/`\n\nwith `RequestFeedback: true`\n\n:\n\n```\n# Skill Installation Plan\n| Skill ID | Trust Badge | Description | Target Path | Git Strategy |\n| :--- | :--- | :--- | :--- | :--- |\n| `makefile-pattern` | **Proven** | Makefile standards | `.agents/skills/makefile-pattern/` | Git Exclude |\n| `docker-build` | **Checked** | Multi-stage Docker | `.agents/skills/docker-build/` | Committed |\n```\n\nDesign Rationale (Local Git Exclude vs. Committed Skills)When users install skills into a workspace (\n\n`.agents/skills/<name>/SKILL.md`\n\n), some skills represent team-wide procedures (which should be committed to Git), while others represent personal developer preferences. To prevent polluting team repositories with personal workflow rules, installer scripts support`--ignore`\n\n, which appends entries to`.git/info/exclude`\n\nrather than dirtying`.gitignore`\n\n.\n\nDraft plan with proceed button\n\n## 5. In Practice: Dynamic Skill Loading (/nmem-skill-load)\n\nHere is how on-demand skill discovery works in practice during a real task:\n\n**Ephemeral Mode (Zero-Restart)**: Ingests the fetched`SKILL.md`\n\nbody directly into the active turn context as a structured context block (`<skill_instruction>`\n\n). This allows Antigravity to follow specialized instructions immediately for the current task without writing files to disk or requiring workspace restarts.**Persistent Mode**: Writes the skill to`.agents/skills/<name>/SKILL.md`\n\nand appends`.agents/skills/<name>/`\n\nto`.git/info/exclude`\n\nif the user prefers local-only isolation.\n\nDynamic injection of a custom Makefile skill into a new session\n\n## Conclusion & Getting Started\n\nBy combining Google Antigravity 2.0’s plugin hooks with Nowledge Mem’s hybrid transport and rich UI interfaces, we created a knowledge integration that is fast, resilient, and developer-centric.\n\n### Quick Setup\n\nInstall the Plugin:\n\n```\nmkdir -p ~/.gemini/config/plugins/nowledge-mem\ncurl -sSL https://github.com/nowledge-co/nowledge-mem-google-antigravity/releases/latest/download/nowledge-mem-google-antigravity.tar.gz \\\n| tar -xz -C ~/.gemini/config/plugins/nowledge-mem\n```\n\nVerify Connection: Restart Antigravity and run `/nmem-status`\n\nor check `nmem status`\n\n.\n\nExplore Knowledge: Use `/nmem-memory-search`\n\n, `/nmem-skill-manage`\n\n, or `/nmem-skill-load <query>`\n\nto bring your personal knowledge base into your coding workflow.\n\nGlobal plugin skills available in any Antigravity conversation\n\nOnce installed, you can use /nmem-status to check if everything configured and working properly\n\nThere you have it; your personal context, engineering knowledge and rules all seamlessly integrated into your agentic development workflow and constantly growing the more you use it.", "url": "https://wpnews.pro/news/bringing-your-k-nowledge-to-antigravity", "canonical_source": "https://nowledge-labs.ai/blog/bringing-your-knowledge-to-antigravity", "published_at": "2026-08-25 00:00:00+00:00", "updated_at": "2026-08-27 11:21:40.239574+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["Arun", "Nowledge Labs", "Google Antigravity", "Nowledge Mem", "Lemonade Server"], "alternates": {"html": "https://wpnews.pro/news/bringing-your-k-nowledge-to-antigravity", "markdown": "https://wpnews.pro/news/bringing-your-k-nowledge-to-antigravity.md", "text": "https://wpnews.pro/news/bringing-your-k-nowledge-to-antigravity.txt", "jsonld": "https://wpnews.pro/news/bringing-your-k-nowledge-to-antigravity.jsonld"}}