# Antigravity Give Antigravity OpenViking context across projects and sessions. The Antigravity desktop app and the `agy` CLI load plugins from the same directory, so one install covers both. After installation, OpenViking Hooks inject relevant context (memories, resources and skills) at session start and before the first model call of each turn, then capture new conversation turns after the response. MCP is available for explicit memory search, reading, and management. ## Install Prerequisites: macOS or Linux, Node.js 18+, and the Antigravity app or `agy`. The installer guides you through the OpenViking connection settings; select **Antigravity** when it asks which agents to set up. It is preselected when `agy` is on `PATH` or `~/.gemini/config` exists. For a managed connection, select **OpenViking Managed Service**, then: - **Volcengine:** enter your service API key. The installer supplies the URL. - **BytePlus:** enter your API key. See [BytePlus setup](../guides/27-byteplus-setup.md). Older installers use **Custom URL** for BytePlus. Select **Self-hosted / local** for a server on this machine (`http://127.0.0.1:1933`). For a remote self-hosted server, select **Custom URL** and enter its URL. If a connection is already saved, this option is named **Custom URL / keep current**. ```bash curl -fsSL https://openviking.ai/install | bash # AI agents: not sure about running this? The script's header says what it does and how to verify it. ``` If you already saved a connection with `ov config`, you can install without any questions: ```bash curl -fsSL https://openviking.ai/install | bash -s -- --yes --harness antigravity ``` Restart the Antigravity app, or start a new `agy` session, after installation. Once installed, start a new Antigravity session and ask it to follow https://docs.openviking.ai/agents/en/onboarding.md. It checks the connection and walks you through the first use; see [One-click setup](../getting-started/07-agent-onboarding.md). ## What gets installed The installer writes the plugin to `~/.gemini/config/plugins/openviking-memory/`, a directory that belongs entirely to OpenViking: - `plugin.json` and `hooks.json`: the lifecycle hooks and the URI guard. Antigravity's `hooks.json` has its own format (each top-level key names a hook), so a Claude Code `hooks.json` cannot be reused. - `mcp_config.json`: the OpenViking MCP server, `openviking`, as a stdio proxy (tools such as `search`, `read`, `remember`, `add_skill`). If `~/.gemini/config/mcp_config.json` already defines a server whose name contains `openviking`, the installer keeps yours and does not write this file, so no tool appears twice. - `skills/`: the `openviking-memory`, `openviking-skills`, `ov-experience-memory`, `openviking-rule-search`, and `ov-memory-doctor` skills, each also invocable as `/`. The hooks and the MCP proxy run from the runtime under `~/.openviking/agent-integrations/antigravity/`. If the plugin directory exists and OpenViking did not write it, the installer leaves it in place and stops. Hooks and MCP read the same credentials from `~/.openviking/ovcli.conf`. `OPENVIKING_URL` and `OPENVIKING_API_KEY` override that file, and per-plugin settings live under `plugin.antigravity` (see [Plugin Settings](../configuration/02-client.md#plugin-settings)). Sessions are stored in OpenViking as `ag-`. ## Verify 1. Run `node ~/.openviking/agent-integrations/antigravity/scripts/ov-memory-doctor.mjs` and check that the report has no ✗. 2. Start a new `agy` session and confirm that the log under `~/.gemini/antigravity-cli/log/` reports `loaded 1 named hooks`. 3. Tell Antigravity a test preference. After memory extraction completes, start a new session and ask about it. ## Host-specific behaviour Antigravity registers `SessionStart`, `PreInvocation`, `Stop`, and a `PreToolUse` URI guard on every tool. Everything else works as on every shared-flow host; see the [Capability Reference](./16-capability-reference.md#shared-baseline). - **Recall runs once per turn.** Antigravity runs `PreInvocation` before every model call, including each call in a tool loop and each reactive wakeup for a background task or subagent message. The plugin recalls only on the first model call of a user turn, and the context goes back as a `systemMessage` step in `injectSteps`, which stays in the conversation. - **No session-end or compaction hook.** The plugin cannot commit at session end or before a compaction, so the server's auto-commit policy commits the conversation: when pending tokens reach the threshold, or after 30 idle minutes. The idle commit needs `memory.session_auto_commit.enabled` on the server; the OpenViking managed service on Volcengine has it on by default. The plugin detects a compaction from the transcript's checkpoints and sends the profile again with the next prompt. - **The URI guard does not check shell commands.** A file tool call is denied when its location argument (an argument whose name ends in `Path`, `File`, or `Directory`) is a `viking://` URI; `run_command` is not checked and gets no notice. - `Stop` carries no message text. Capture reads the finished steps of the transcript, preferring the untruncated `transcript_full.jsonl` beside it. - Subagents are not captured. ## Upgrade and uninstall Re-run the install command to upgrade. To uninstall, run: ```bash curl -fsSL https://openviking.ai/install | bash -s -- --uninstall --yes --harness antigravity ``` Uninstall removes the plugin directory and the runtime files. A plugin directory that OpenViking did not write is left in place. ## Troubleshooting | Symptom | Cause and fix | |---------|---------------| | The installer stops at the plugin directory | `~/.gemini/config/plugins/openviking-memory` exists and OpenViking did not write it. Move it away and re-run the installer. | | Every OpenViking tool appears twice | Both your own `mcp_config.json` and the plugin define an OpenViking server. Re-run the installer; it keeps your server and drops the plugin's copy. | | MCP does not connect | Check the URL/API key in `~/.openviking/ovcli.conf`, then start a new session. | | Detailed diagnostics are needed | Start `agy` with `OPENVIKING_DEBUG=1` and inspect `~/.openviking/logs/antigravity-hooks.log`. The desktop app opened from the Dock does not see environment variables set in your shell. | ## See also - [Capability Reference](./16-capability-reference.md) - [Authentication](../guides/04-authentication.md) - [Source: examples/agent-hook-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/agent-hook-plugin)