feat: add xmem-antigravity plugin and groq support#215
Conversation
antigravity is mentioned in the README as a supported export format but there was no actual plugin for it. added plugin/xmem-antigravity with the same structure as xmem-claude — hooks, skills, commands, and scripts. also added a native transcript.jsonl parser in plugin-utils so antigravity sessions don't need the LLM fallback that other formats use. groq was the only major provider missing from the model registry. added src/models/groq.py and wired it into settings, registry, and base.py. default model is llama-3.3-70b-versatile.
There was a problem hiding this comment.
Code Review
This pull request introduces the xmem-antigravity plugin to enable persistent memory across Antigravity agent sessions, alongside adding backend support for Groq models to facilitate ultra-low-latency inference. Feedback on these changes highlights three key areas for improvement: first, the Groq API key validation needs to be integrated into the settings post-initialization check to prevent false-positive validation errors; second, the extractText utility should be updated to handle structured objects like tool calls so that critical transcript context is not lost; and third, a timeout should be added to the API fetch requests to prevent the plugin scripts from hanging indefinitely.
|
| Filename | Overview |
|---|---|
| src/models/groq.py | New Groq model factory following the same pattern as claude.py/ollama.py; guards against missing import and missing API key before constructing ChatGroq. |
| src/models/registry.py | Groq added to _BUILDERS, _KEY_MAP, and _VISION_MODEL_MAP dictionaries; consistent with every other provider entry in the file. |
| src/config/settings.py | Three new Groq fields (groq_api_key, groq_model, groq_vision_model) added; groq added to the valid_providers set in validate_fallback_order. |
| plugin/xmem-antigravity/scripts/lib/plugin-utils.cjs | Core utility library; adds parseAntigravityTranscript for native JSONL parsing, redactSecrets, truncate, and config loaders. Logic mirrors xmem-claude's plugin-utils with Antigravity-specific field names. |
| plugin/xmem-antigravity/scripts/lib/xmem-client.cjs | HTTP client for the XMem API; identical structure to xmem-claude's client with Antigravity-specific env var fallbacks. |
| plugin/xmem-antigravity/scripts/summary-hook.cjs | Stop hook that reads transcript_path from stdin, builds a redacted tail via transcriptTail, and ingests it into XMem; always emits { continue: true } to avoid blocking session shutdown. |
| plugin/xmem-antigravity/scripts/context-hook.cjs | SessionStart hook that searches XMem and injects context via hookSpecificOutput.additionalContext; degrades gracefully on error. |
| plugin/xmem-antigravity/hooks/hooks.json | Registers context-hook and summary-hook for SessionStart and Stop events; structure is identical to the xmem-claude plugin. |
| src/models/base.py | Adds groq to the Provider Literal type, keeping it in sync with the registry. |
Sequence Diagram
sequenceDiagram
participant AG as Antigravity Runtime
participant CH as context-hook.cjs
participant SH as summary-hook.cjs
participant XC as XMemClient
participant API as api.xmem.in
AG->>CH: SessionStart (stdin JSON: cwd)
CH->>XC: "search(project context query, top_k=6)"
XC->>API: POST /v1/memory/search
API-->>XC: "{ results: [...] }"
XC-->>CH: formatted results
CH-->>AG: "hookSpecificOutput { additionalContext: xmem-context }"
AG->>SH: Stop (stdin JSON: cwd, transcript_path, session_id)
SH->>SH: parseAntigravityTranscript(transcript_path)
SH->>SH: "transcriptTail -> redactSecrets -> truncate"
SH->>XC: "ingest(content, { source: antigravity, type: session-summary })"
XC->>API: POST /v1/memory/ingest
API-->>XC: ok
XC-->>SH: done
SH-->>AG: "{ continue: true }"
Reviews (2): Last reviewed commit: "Update plugin/xmem-antigravity/scripts/l..." | Re-trigger Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
Hi @kanishkez, thank you for the contribution |
antigravity is already mentioned in the README as a supported export format but there was no plugin for it. this adds plugin/xmem-antigravity following the exact same structure as xmem-claude.
also added groq as a model provider — it was the only major one missing from the registry.
changes: