StackMap
Subscribe
Explore / zvec-grep
zvec-ai

zvec-grep

zg: ripgrep, BM25 and vector search behind one local-first CLI for humans and agents — index a workspace once, search code, docs and data by meaning, then verify with exact text or regex.

2,822 144 TypeScript Apache-2.0updated yesterday
View on GitHubDispute this mapping →
Curator's take

Give it to a coding agent that wastes tool calls grepping: `zg index` builds a local index (embeddings can stay local — potion-retrieval-32m is the default), then `zg query` returns ranked, source-linked results across code, Markdown and structured files, and the agent drops to exact/regex only to confirm. Fewer calls, fewer tokens, nothing leaves the machine unless you allow a remote embedder. Built on Alibaba's zvec engine; direct and server modes. NOT a symbol-aware tool — it doesn't know what a function is, only what text means — and NOT a graph: for call edges and blast radius use a code-intelligence server.

Mapped by ShipWithAI editors · links verified

Continue your stack

What teams reach for next — and why each earns a place beside zvec-grep. Ranked by curator confidence.

pairs wellalternativealternativebuilt withserenacocoindex-codetokensavezveczvec-grep
pairs wellalternativebuilt withpick a node for the why · open it from the panel
Weekly digest
README.md2 min read

English | 中文

zg logo

Know the words—or don’t. Just zg.

The local-first search layer for humans and agents.

npm version CI Apache 2.0 license Node.js 22 or newer

🎬 Tour | 💫 Features | 🚀 Try it yourself | 📚 Docs | 📊 Benchmarks | 🤝 Community

zg (zvec-grep), powered by zvec, unifies ripgrep, BM25, and vector search behind one local-first interface. Use it directly from the terminal, or let your agent use it for you.

🎬 See it in action

Install the agent integration, index a workspace, and let the agent search it with zvec-grep

💫 Why zg?

  • Ready for humans and agents — install once, index once, then use the same workspace from the CLI or your agent on macOS, Linux, and Windows.
  • Search beyond keywords — discover by meaning, rank by relevance, then verify with exact text or regex when needed.
  • Multi-format search — search source code, documents, and structured data while preserving useful structure and source locations.
  • Less searching, less context — ranked, source-linked results surface the right evidence with fewer tool calls, fewer tokens, and less noise.
  • Local by default — files, indexes, and local models stay on your machine; remote embeddings receive data only with your permission.

🚀 Try it yourself

1. Set up a sample bookshelf

# Requires Node.js 22 or newer.
npm install -g @zvec/zvec-grep

mkdir zg-mystery && cd zg-mystery
curl --retry 3 --retry-all-errors --progress-bar -fL \
  -o alice-in-wonderland.txt https://raw.githubusercontent.com/GITenberg/Alice-s-Adventures-in-Wonderland_11/master/11.txt \
  -o sherlock-holmes.txt https://raw.githubusercontent.com/GITenberg/The-Memoirs-of-Sherlock-Holmes_834/master/834.txt

zg index --embedding local/potion-retrieval-32m

[!NOTE] The index is stored in .zvec-grep/ under the indexed project root.

[!TIP] If zg index or zg query fails, rerun the same command with --debug for diagnostics (supported in both direct and server modes). zg status --mode direct --debug reports per-file failures stored in an existing index; rerun a failed direct command to diagnose command-level fatal errors. Use zg status --mode server --debug to inspect recorded server indexing errors. For server connection failures, check zg server status and the server logs.

2. Choose how to search

For agents: ask with OpenCode

With OpenCode configured:

zg install --target opencode --