Alibaba's zvec-grep Gives Coding Agents One Search Layer to Replace Endless Grep Loops

Alibaba's Zvec team open-sourced zg, a local-first CLI that fuses ripgrep, BM25, and vector search into one interface for humans and coding agents.

·
·
Alibaba's zvec-grep Gives Coding Agents One Search Layer to Replace Endless Grep LoopsPRO
  • Alibaba's Zvec team open-sourced zg (zvec-grep), a local-first search CLI under Apache 2.0.
  • Unifies ripgrep, BM25, and vector search behind one interface for humans and agents.
  • Installs via npm install -g @zvec/zvec-grep, requires Node.js 22+, runs on macOS, Linux, Windows.
  • Auto-configures MCP integration for Codex, Claude Code, Cursor, and OpenCode.
  • Four routes: hybrid default, --fts (BM25), --vector, --rg (no index needed).
  • Local-first: indexes and default models stay on-device; launch post explains rationale.

Coding agents burn a surprising share of their tool budget on searching. When they know the exact symbol or error string, ripgrep delivers. When they only have a vague description of a behavior, keyword search fails and the agent starts guessing terms, opening whole files, and stitching context together manually. zg (zvec-grep), open-sourced by Alibaba's Zvec team, tries to collapse that loop into a single local-first search layer that both humans and agents can call.

zg unifies ripgrep, BM25, and vector search behind one interface. Index your repo once, then query it from the terminal or let your agent call it over MCP.

Four retrieval routes, one index

zg indexes a workspace once and exposes four ways to query it. The hybrid default combines semantic intent with lexical anchors, fused using Reciprocal Rank Fusion. --fts runs BM25-ranked retrieval for known terms. --vector returns conceptually similar results with no lexical scoring. --rg shells out to ripgrep for exhaustive literal or regex matching and requires no index at all, which matters when a repo hasn't been indexed yet.

  • Hybrid (default) — semantic intent plus lexical anchors, fused with Reciprocal Rank Fusion
  • --fts — BM25-ranked keyword retrieval for known terms
  • --vector — pure conceptual similarity, no lexical scoring
  • --rg — raw ripgrep for exhaustive literal or regex matches, no index required

Pro article

This story is for Pro members

You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.

Trending
  • No trending articles

Comments

avatar

Next Reads