{"slug": "z-local-first-search-layer-for-humans-and-agents", "title": "Z: Local-first search layer for humans and agents", "summary": "Zvec AI released zg (zvec-grep), a local-first search tool unifying ripgrep, BM25, and vector search behind a single interface for humans and AI agents, requiring Node.js 22 or newer and installable via npm. The tool indexes files locally by default, supports multi-format search, and integrates with OpenCode, enabling agents to retrieve ranked, source-linked evidence with fewer tokens, as demonstrated in a Sherlock Holmes benchmark where Claude Code with Claude Opus 5 used zg to answer a query about unseen creature marks.", "body_md": "English | [中文](/zvec-ai/zvec-grep/blob/main/README_CN.md)\n\n**Know the words—or don’t. Just zg.**\n\nThe local-first search layer for humans and agents.\n\n[🎬 Tour](#tour) |\n\n[💫](#features)|\n\n**Features**[🚀](#try-it-yourself)|\n\n**Try it yourself**[📚](/zvec-ai/zvec-grep/blob/main/docs/README.md)|\n\n**Docs**[📊](#benchmarks)|\n\n**Benchmarks**[🤝](#community)\n\n**Community****zg** (**z** vec-**g** rep) unifies ripgrep, BM25, and vector search behind\n[one local-first interface](/zvec-ai/zvec-grep/blob/main/docs/05-architecture.md). Use it directly from the\nterminal, or let your agent use it for you.\n\n**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.\n\n```\n# Requires Node.js 22 or newer.\nnpm install -g @zvec/zvec-grep\n\nmkdir zg-mystery && cd zg-mystery\ncurl --retry 3 --retry-all-errors --progress-bar -fL \\\n  -o alice-in-wonderland.txt https://raw.githubusercontent.com/GITenberg/Alice-s-Adventures-in-Wonderland_11/master/11.txt \\\n  -o sherlock-holmes.txt https://raw.githubusercontent.com/GITenberg/The-Memoirs-of-Sherlock-Holmes_834/master/834.txt\n\nzg index --embedding local/potion-retrieval-32m\n```\n\nWith [OpenCode](https://opencode.ai/) configured:\n\n```\nzg install --target opencode --yes\nopencode models\nopencode run --model opencode/nemotron-3-ultra-free \\\n  \"An unseen creature left a few marks. What did the detective infer? Cite local evidence.\"\n```\n\nFree model availability can change. Check `opencode models`\n\nand replace the\nexample model with one that is currently available in your environment.\n\nOpenCode chooses zg on its own—the prompt does not name a tool.\n\n**See the full agent run and answer**\n\n```\n⚙ 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}\n→ Read sherlock-holmes.txt [offset=5440, limit=120]\n\nAnswer:\nThe detective is Sherlock Holmes in *The Adventure of the Crooked Man*.\nFrom the animal's foot-marks, he inferred:\n\n- It was not a dog, cat, monkey, or other familiar creature: its print had\n  five foot-pads, long nails, and was nearly as large as a dessert-spoon\n  (sherlock-holmes.txt:5479-5486).\n- It had a long body and very short legs: nearly two feet long, but with a\n  stride of only about three inches (sherlock-holmes.txt:5497-5502).\n- It was carnivorous because it climbed the curtain toward a canary's cage\n  (sherlock-holmes.txt:5509-5510).\n- It was probably from the weasel or stoat tribe, though unusually large\n  (sherlock-holmes.txt:5514-5516).\n\nHolmes also inferred that a man entered through the window with it and later\nleft with the key (sherlock-holmes.txt:5464-5470, 5527-5528).\n```\n\nSearch the same bookshelf directly, without an agent:\n\n```\nzg query --human \"An unseen creature left a few marks. What did the detective infer?\" --limit 3\n```\n\nzg returns the relevant passages from `sherlock-holmes.txt`\n\n, ranked ahead of\n`alice-in-wonderland.txt`\n\n.\n\nEach benchmark uses paired A/B runs with tasks, agent/model, prompt, environment, and limits held constant; only zg access and usage guidance differ.\n\nSee the [benchmark documentation](/zvec-ai/zvec-grep/blob/main/benchmarks/README.md) for full results and\nreproduction details.\n\n[SWE-QA-Bench](/zvec-ai/zvec-grep/blob/main/benchmarks/swe-qa-bench/README.md) uses Claude Code with\nClaude Opus 5 at high reasoning effort;\n[BrowseComp-Plus](/zvec-ai/zvec-grep/blob/main/benchmarks/browse-comp-plus/README.md) uses Codex\ngpt-5.6-sol at medium reasoning effort. Both zg profiles use Qwen3.7 Text\nEmbedding.\n\n**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.\n\n|\n|\n\nthe 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.[Pylint](https://github.com/pylint-dev/pylint)— Python static analysis:the task traces[Matplotlib](https://github.com/matplotlib/matplotlib)— plotting and rendering:`FontInfo`\n\nand font selection through multiple math-text rendering stages. Ranked semantic and lexical evidence helps reconstruct the cross-file data and control flow.the task connects username uniqueness, ORM transactions, and formset bulk operations. Compact ranked evidence brings the distributed design rationale together.[Django](https://github.com/django/django)— web framework:\n\n**Repository questions**\n\n| Repository | Question type | Question |\n|---|---|---|\n`pylint-dev/pylint` |\nWhat Architecture exploration |\nWhat is the architectural pattern that distinguishes type-annotated from non-annotated instance attribute initialization using AST node type separation? |\n`matplotlib/matplotlib` |\nWhere Data / Control-flow |\nWhere 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? |\n`django/django` |\nWhy Design rationale |\nWhy 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? |\n\nzg 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.\n\n| Guide | What you can do |\n|---|---|\n|\n\n[CLI guide](/zvec-ai/zvec-grep/blob/main/docs/02-cli.md)[MCP guide](/zvec-ai/zvec-grep/blob/main/docs/03-mcp.md)[Retrieval pipeline](/zvec-ai/zvec-grep/blob/main/docs/04-pipeline.md)[Architecture](/zvec-ai/zvec-grep/blob/main/docs/05-architecture.md)[Server and execution modes](/zvec-ai/zvec-grep/blob/main/docs/06-server.md)[Embedding models](/zvec-ai/zvec-grep/blob/main/docs/07-embedding.md)[Roadmap](/zvec-ai/zvec-grep/blob/main/docs/08-roadmap.md)Community contributions are always welcome—bug fixes, features, and documentation improvements all help make zvec-grep better.\n\nCheck out our [Contributing Guide](/zvec-ai/zvec-grep/blob/main/CONTRIBUTING.md) to get started!", "url": "https://wpnews.pro/news/z-local-first-search-layer-for-humans-and-agents", "canonical_source": "https://github.com/zvec-ai/zvec-grep", "published_at": "2026-09-02 19:56:26+00:00", "updated_at": "2026-09-02 20:23:00.116733+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["Zvec AI", "zg", "zvec-grep", "OpenCode", "Claude Code", "Claude Opus 5", "Node.js"], "alternates": {"html": "https://wpnews.pro/news/z-local-first-search-layer-for-humans-and-agents", "markdown": "https://wpnews.pro/news/z-local-first-search-layer-for-humans-and-agents.md", "text": "https://wpnews.pro/news/z-local-first-search-layer-for-humans-and-agents.txt", "jsonld": "https://wpnews.pro/news/z-local-first-search-layer-for-humans-and-agents.jsonld"}}