Bring your Nowledge Mem knowledge base into Google Antigravity with persistent context, memory rules, and agent skills.
This package is the Google Antigravity-native product surface for Nowledge Mem.
It is deliberately hybrid:
- Google Antigravity loads memory rules plus lifecycle hooks for Context Bundle / Working Memory startup context and session capture
- the plugin exposes local Nowledge Mem MCP tools for lower-friction retrieval and memory writes
- bundled skills teach Antigravity when to recall, distill, save threads, and create handoff summaries
- Antigravity can still call
nmemdirectly whenever it needs a more flexible path
The recommended setup is simple and stable: Google Antigravity on top, MCP for direct retrieval tools, and nmem for hooks, thread save, remote auth, and command fallback.
- Google Antigravity 2.0
- Nowledge Mem running locally, or a reachable remote Nowledge Mem server
nmemCLI in yourPATH(or installed via standard Linux packages at/usr/lib/nowledge-mem/nmem//usr/lib64/nowledge-mem/nmem)
You can install the standalone nmem CLI via PyPI, Fedora COPR, or Arch AUR:
# PyPI
pip install nmem-cli
# Fedora / RPM-based Linux (COPR)
sudo dnf copr enable abn/nowledge-mem
sudo dnf install nowledge-mem-cli
# Arch Linux (AUR)
yay -S nmem-cliIf Nowledge Mem is already running on the same machine through the desktop app, install the bundled CLI from Settings -> Preferences -> Developer Tools -> Install CLI. That gives Antigravity direct access to the local Mem instance. The plugin automatically resolves system installation paths if sandboxed subshells restrict user $PATH symlinks.
Verify connection and in-flight background tasks:
nmem status
nmem tasksFor the default same-machine setup, nmem status should show http://127.0.0.1:14242 (default). Historical Antigravity conversation sessions can also be backfilled directly using nmem t sync --from antigravity.
For local development or a repository checkout install, you can link the plugin folder to one of the locations scanned by Antigravity:
Place or symlink the plugin folder inside .agents/plugins/ (or _agents/plugins/) at the root of your opened workspace:
mkdir -p .agents/plugins
ln -s /path/to/nowledge-mem-google-antigravity .agents/plugins/Place or symlink the plugin folder inside ~/.gemini/config/plugins/ in your user home directory:
mkdir -p ~/.gemini/config/plugins
ln -s /path/to/nowledge-mem-google-antigravity ~/.gemini/config/plugins/Alternatively, you can clone the repository directly into your global plugins directory:
git clone https://github.com/nowledge-co/nowledge-mem-google-antigravity.git ~/.gemini/config/plugins/nowledge-memRestart Google Antigravity after linking or cloning.
Release packaging notes live in RELEASING.md.
Automatic lifecycle hooks
- PreInvocation Hook: Automatically loads Context Bundle when available, with Working Memory as the lightweight fallback, and injects it as situational context at the start of the session. Prioritizes direct native HTTP REST transport (<30ms latency), falling back to CLI subprocess execution. Concurrently launches a non-blocking background thread to connect and sync active host skills (
nmem skills connect antigravityandnmem skills sync). - PostInvocation Hook: Evaluates mid-session runtime state (such as pending offline sessions in
~/.nowledge-mem/plugins/antigravity/unsynced.json), triggers asynchronous background synchronization, and throttles informational notifications to at most once per conversation session. - Stop Hook: Automatically imports conversation messages from Antigravity's
transcript.jsonllog into Nowledge Mem under the current conversation ID when execution completes. Defers capture when background tasks are still running (fullyIdle: false), and prioritizes incremental tail reconciliation (/threads/{id}/reconcile-tail) to eliminate duplicate messages and reduce payload size. Prioritizes direct native HTTP REST transport, falling back to CLI execution and local offline buffer queuing (~/.nowledge-mem/plugins/antigravity/unsynced.json). - Space Resolution & Verification: Resolves the active space by prioritizing explicit environment overrides (
NMEM_SPACE/NMEM_SPACE_ID), workspace/plugin config (.config.json/~/.nowledge-mem/plugins/antigravity/config.json), and project config (.nmemspace/.nowledge/config.json). Dynamically detected candidate spaces from workspace directory names are verified against existing backend spaces; if the space does not exist on the server, Antigravity safely falls back todefault.
Bundled MCP
- Local same-machine installs expose
nowledge-memMCP tools athttp://127.0.0.1:14242/mcp/automatically. - The startup hook automatically synchronizes
mcp_config.jsonwith effective client settings (~/.nowledge-mem/config.jsonorNMEM_API_URL/NMEM_API_KEY). For remote Mem,mcp_config.jsonis updated dynamically with the remote server URL and authentication headers (Authorization: BearerandX-NMEM-API-Key). - The committed
mcp_config.jsonis a local placeholder template. Do not commit a realnmem_...API key.
Persistent context rules
rules/nowledge-mem.mdtells Antigravity how to route recall across Context Bundle, Working Memory, distilled memories, conversation threads, handoff summaries, and positional CLI fallback signatures.
Agent skills
nmem-fs-explorenmem-memory-distillnmem-memory-searchnmem-memory-workingnmem-skill-loadnmem-skill-managenmem-skill-proposenmem-statusnmem-thread-handoffnmem-thread-save
By default, both nmem and the bundled MCP server point to the local Mem server at http://127.0.0.1:14242.
Nowledge Mem resolves connection and space settings in the following strict order of precedence:
- Environment Variables:
NMEM_API_URL,NMEM_API_KEY,NMEM_SPACE(orNMEM_SPACE_ID) - Local Workspace Config (
.config.json): Place a.config.jsonfile at the root of the workspace. This file is git-ignored and allows configuring server endpoints, credentials, default space, and future settings locally for that specific workspace:{ "apiUrl": "https://mem.example.com", "apiKey": "nmem_your_key", "space": "my-project-space" } - Explicit Workspace Space Files:
.nmemspaceor.nowledge/config.jsonin the workspace root. - Plugin Root Config (
.config.json): Place a.config.jsonin the plugin repository root for plugin-wide local testing defaults. - Plugin Storage Config:
~/.nowledge-mem/plugins/antigravity/config.json(persists Antigravity-specific plugin defaults across upgrades without polluting root files). - Global Client Config:
~/.nowledge-mem/config.json(managed vianmem config client set ...). - Local Defaults:
http://127.0.0.1:14242anddefaultspace.
For global remote Mem setup via CLI, run:
nmem config client set url https://mem.example.com
nmem config client set api-key nmem_your_keyIf you need a temporary override for one session, launch Antigravity from a shell where NMEM_API_URL, NMEM_API_KEY, or NMEM_SPACE are exported.
For MCP tools in remote mode, generate the host config:
nmem config mcp show --host google-antigravityPaste the generated JSON into Antigravity's custom MCP config (~/.gemini/config/mcp_config.json or modified raw via the MCP Store).
The bundled skills are convenience paths, not a cage. Antigravity should freely compose direct nmem commands when that is clearer or more flexible.
Examples:
nmem --json wm read
nmem --json m search "auth token rotation" --mode deep --importance 0.7
nmem --json m search "auth token rotation" --mode deep --importance 0.7 --space "Research Agent"
nmem --json m add "JWT refresh failures came from clock skew between the gateway and API nodes." -t "JWT refresh failures traced to clock skew" -i 0.9 --unit-type learning -l auth -l backend -s google-antigravity
nmem statusAntigravity supports two separate save paths:
- Thread Save (
nmem-thread-saveskill //nmem-thread-save): Imports the real session messages into Nowledge Mem. The Stop hook performs this import automatically at the end of the session, but the skill is available for manual mid-session triggers. - Handoff Save (
nmem-thread-handoffskill //nmem-thread-handoff): Creates a compact resumable handoff summary with Goal, Decisions, Files, Risks, and Next. Use this when you want a lightweight restart point rather than the full transcript.
Use nmem-memory-distill for durable atomic knowledge, nmem-thread-save for the full session, and nmem-thread-handoff for a resumable handoff.
- Install/Update Skill (
nmem-skill-manageskill //nmem-skill-manage): Evaluates the project context, lists active/archived/candidate skills from Nowledge Mem, and helps recommend and install them into<workspace-root>/.agents/skills/<skill-folder>/. Users can choose to commit these skills to git or keep them local-only (via git-exclude). - On-Demand Skill Loader (
nmem-skill-loadskill //nmem-skill-load <query>): Dynamically searches candidate/compiled skills on Nowledge Mem and loads them into the active turn (Ephemeral Mode) or installs them locally (Persistent Mode). Triggered explicitly via/nmem-skill-load <query>or automatically when Antigravity detects an unhandled domain task with an available skill definition.
Run unit tests for lifecycle hooks:
make test
# or: npm run testRun container integration test suite using docker.io/nowledgelabs/mem:latest published on a random host port:
make test-integration
# or: python3 -m pytest -v tests/integration/Run full plugin validation:
make validate
# or: npm run validate