Overview
zg (zvec-grep) is a local-first search layer that unifies ripgrep, BM25, and vector search behind a single interface for humans and AI agents. Powered by zvec (Alibaba’s vector compute library), zg indexes a workspace once and then serves both keyword and semantic queries from the same local index. It exposes an MCP server so agents can search without manual setup, and integrates with OpenCode, Codex, Claude Code, Qwen Code, Qoder, and Cursor.
Key Facts
- Name: zg / zvec-grep (npm package
@zvec/zvec-grep) - Language: Rust (binary) with TypeScript/JavaScript tooling
- License: Apache 2.0
- Runtime: Node.js 22+, macOS/Linux/Windows
- Embedding models: pluggable — defaults to local models (e.g.
local/potion-retrieval-32m); remote embeddings require explicit opt-in - Index location:
.zvec-grep/under the indexed project root - Architecture: MCP server + CLI + direct/server execution modes
- Benchmarks: self-reported paired A/B runs against Claude Code (Opus 5) and Codex (GPT-5.6) showing reduced input tokens, fewer tool calls, and faster agent wall-time across coding and prose retrieval tasks
Relationships
- “uses” model-context-protocol — ships an MCP server and MCP tools for agent access
- “operates-with” claude-code — listed as a supported agent integration target
- “compatible-with” qmd — both are hybrid search tools for knowledge workspaces (qmd for Shopify docs, zg for general workspaces)
- “compatible-with” docmd — docmd auto-generates llms.txt while zg indexes and searches; complementary indexing pipeline
- “implements” memory-retrieval-patterns — ranked semantic + lexical + regex verification pipeline
- “extends” open-knowledge-format — workspace indexing layer that can surface OKF-structured evidence by relevance
Implications
zg represents the emergence of a search-as-a-service layer for agent workspaces — a reusable component that sits between a wiki/vault and an AI agent. Unlike wiki-specific tools like qmd or docmd, zg is generic: it indexes any workspace (code, docs, structured data) and exposes it to any MCP-capable agent. For the LLM Wiki ecosystem, this means a wiki vault can be augmented with a zg index to give agents a fast, local, multi-strategy retrieval path without modifying wiki structure. The local-by-default model aligns with LLM Wiki’s on-device preference, while the agent auto-detection (OpenCode choosing zg without prompt instruction) demonstrates the MCP integration pattern other wiki tools could adopt.
Open Questions
- Stars/forks not publicly available in captured sources (GitHub page did not render).
- Benchmark claims are vendor-sourced and self-reported; independent reproduction pending.
- Whether zg has explicit support for indexing the OKF object-form frontmatter or typed wikilinks.
External Links
- GitHub: https://github.com/zvec-ai/zvec-grep
- npm: https://www.npmjs.com/package/@zvec/zvec-grep
- zvec (Alibaba): https://github.com/alibaba/zvec
Sources
^[raw/external/github-com-zvec-grep-a0e159be.md]