English | 中文 Know the words—or don’t. Just zg. 💫 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 💫 Why zg? Ready for humans and agents — install once, index once, then use the same workspace from…
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
💫 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.
zg --install --target opencode --yes
opencode models
opencode run --model opencode/nemotron-3-ultra-free \
"An unseen creature left a few marks. What did the detective infer? Cite local evidence."
Free model availability can change. Check opencode models and replace the
example model with one that is currently available in your environment.
OpenCode chooses zg on its own—the prompt does not name a tool.
See the full agent run and answer
⚙ zvec_grep_zvec_grep_search {"root":".../zg-mystery","query":"An unseen creature left a few marks. What did the detective infer?","fts":["marks","unseen creature","inferred","detective"],"fuse":true}
→ Read sherlock-holmes.txt [offset=5440, limit=120]
Answer:
The detective is Sherlock Holmes in *The Adventure of the Crooked Man*.
From the animal's foot-marks, he inferred:
- It was not a dog, cat, monkey, or other familiar creature: its print had
five foot-pads, long nails, and was nearly as large as a dessert-spoon
(sherlock-holmes.txt:5479-5486).
- It had a long body and very short legs: nearly two feet long, but with a
stride of only about three inches (sherlock-holmes.txt:5497-5502).
- It was carnivorous because it climbed the curtain toward a canary's cage
(sherlock-holmes.txt:5509-5510).
- It was probably from the weasel or stoat tribe, though unusually large
(sherlock-holmes.txt:5514-5516).
Holmes also inferred that a man entered through the window with it and later
left with the key (sherlock-holmes.txt:5464-5470, 5527-5528).
For humans: search directly
Search the same bookshelf directly, without an agent:
zg --preview detail "An unseen creature left a few marks. What did the detective infer?" --limit 3
zg returns the relevant passages from sherlock-holmes.txt, ranked ahead of
alice-in-wonderland.txt.
Use repeated --hybrid, --fts, or --vector flags for separate queries.
Each nonempty result group starts with its original query and position, such as
-- query 2/2: timeout --; colored output uses a dim rule and a magenta label.
📊 Benchmarks
Each benchmark uses paired A/B runs with tasks, agent/model, prompt,
environment, and limits held constant; only zg access and usage guidance
differ.
SWE-QA-Bench uses Claude Code with
Claude Opus 5 at high reasoning effort;
BrowseComp-Plus uses Codex
gpt-5.6-sol at medium reasoning effort. Both zg profiles use Qwen3.7 Text
Embedding.
Why it helps: semantic discovery narrows the search space, ranked lexical
retrieval anchors exact identifiers, and compact evidence reduces broad
scans, repeated tool calls, and model context.
Why it generalizes: the same retrieval loop works across domains—code is
indexed with symbols, signatures, and breadcrumbs, while prose is retrieved
as focused sections and chunks.
2. Real-World Case Studies
Pylint — Python static analysis: the task asks how AST node handling
separates annotated and non-annotated attribute initialization. Symbol-aware
retrieval is useful because the architectural entry point is not known in
advance.
Matplotlib — plotting and rendering: the task traces FontInfo and font
selection through multiple math-text rendering stages. Ranked semantic and
lexical evidence helps reconstruct the cross-file data and control flow.
Django — web framework: the task connects username uniqueness, ORM
transactions, and formset bulk operations. Compact ranked evidence brings
the distributed design rationale together.
Repository questions
Repository
Question type
Question
pylint-dev/pylint
What Architecture exploration
What is the architectural pattern that distinguishes type-annotated from non-annotated instance attribute initialization using AST node type separation?
matplotlib/matplotlib
Where Data / Control-flow
Where does the FontInfo NamedTuple propagate font metrics and glyph data through the mathematical text rendering pipeline, and what control flow determines whether the postscript_name or the FT2Font object is used at different stages of character rendering?
django/django
Why Design rationale
Why does the User model’s unique constraint on the username field interact with Django’s ORM transaction handling, and what cascading effects would occur if this constraint were removed on an existing database with formset-based bulk operations?
zg works best when evidence spans files or modules and the target location is
unknown, especially for call-chain, data-flow, and architectural questions.
Since agents decide when and how to use it, results vary by model and run;
repeated-run averages are more reliable.
🤝 Join Our Community
💬 DingTalk
📱 WeChat
🎮 Discord
X (Twitter)
Scan to join
Scan to join
Click to join
Click to follow
❤️ Contributing
Community contributions are always welcome—bug fixes, features, and
documentation improvements all help make zvec-grep better.
评论