{"slug": "zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents", "title": "zvec-grep (zg): A Local-First Hybrid Search Engine for Humans and AI Agents", "summary": "Zvec-ai released zvec-grep (zg), an open-source, local-first hybrid search engine that unifies ripgrep-style regex matching, BM25, and local vector search in a single command-line tool. Built on Alibaba's zvec vector library, zg indexes source code, documents, and configuration files locally under a .zvec-grep/ directory, keeping embeddings and indexes on the developer's machine rather than sending code to cloud APIs. The tool is designed for both human developers and AI coding agents such as Claude Code, Codex, and OpenCode, returning ranked, source-linked snippets to reduce token consumption during repository exploration.", "body_md": "For years, `ripgrep` has been the undisputed champion of developer code search—offering instant, multi-threaded regex matching across massive directory trees. Yet traditional grep tools share a fundamental limitation: they require the user to anticipate the exact string literal, variable name, or regex pattern. \n\nWhen developers or AI coding agents navigate unfamiliar codebases, architectural intent is often conceptual (*\"where is database connection pooling configured?\"* or *\"how are expired user sessions cleaned up?\"*). In those scenarios, keyword search requires tedious guessing loops.\n\n**zvec-grep (zg)** is an open-source search engine developed by zvec-ai. Powered by Alibaba's high-performance `zvec` vector library, `zg` bridges lexical and semantic retrieval, unifying ripgrep, BM25, and local vector search into a single command-line tool and agent integration.\n\n`zg` serves as a local-first search layer designed symmetrically for both human developers and autonomous AI coding agents. It indexes source code, documents, and structured configuration files locally, enabling queries that combine the precision of exact text matching with the discovery power of semantic embeddings.\n\n`zg` eliminates the trade-off between semantic search and exact matching:\n\nWhen autonomous coding agents (such as Claude Code, Codex, or OpenCode) explore repositories, broad scans and recursive grep calls quickly burn through context windows and rate limits. `zg` surfaces ranked, source-linked evidence snippets, enabling agents to pinpoint code locations in fewer tool calls with significantly lower token consumption.\n\nData privacy is central to `zg`'s architecture. Source code, generated indexes, and local embedding models remain entirely on the developer's computer under `.zvec-grep/`. No proprietary source code is uploaded to remote cloud APIs or third-party vector databases.\n\n`zg` operates effortlessly whether run directly by an engineer in a shell or invoked by an agent:\n\n```\n# Install globally (requires Node.js 22+)\nnpm install -g @zvec/zvec-grep\n\n# Index your project using local embeddings\nzg index --embedding local/potion-retrieval-32m\n\n# Search directly as a human\nzg query --human \"How are authentication tokens validated?\" --limit 3\n\n# Or install as an AI agent tool (OpenCode, Claude Code, Cursor)\nzg install --target opencode --yes\n```\n\nBy combining the lightning speed of regex search with the intelligence of local vector retrieval, `zvec-grep` modernizes repository navigation. It provides developers and AI assistants with a faster, privacy-preserving, and more intuitive search foundation.\n\n*Want to bring semantic search to your terminal? Check out the [zvec-grep GitHub Repository](https://github.com/zvec-ai/zvec-grep).*", "url": "https://wpnews.pro/news/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents", "canonical_source": "https://dev.to/terminalchai/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents-2dkf", "published_at": "2026-09-12 21:05:08+00:00", "updated_at": "2026-09-12 21:23:55.849954+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["zvec-ai", "zvec-grep", "Alibaba", "zvec", "Claude Code", "Codex", "OpenCode", "Cursor"], "alternates": {"html": "https://wpnews.pro/news/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents", "markdown": "https://wpnews.pro/news/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents.md", "text": "https://wpnews.pro/news/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents.txt", "jsonld": "https://wpnews.pro/news/zvec-grep-zg-a-local-first-hybrid-search-engine-for-humans-and-ai-agents.jsonld"}}