# zvec-grep (zg)

A local-first command-line search tool that unifies ripgrep-style text search, BM25 and vector search behind one interface, usable directly from a terminal or by an AI agent.

zvec-grep, invoked as zg, is a local-first search tool for a workspace that unifies exact text and regex search, BM25 keyword search and vector semantic search behind a single interface, powered by a companion library called zvec. It can be used directly from the terminal or from an AI agent, and searches source code, documents and structured data while preserving useful structure and source locations.

Search results are ranked and linked to their source, aiming to surface the right evidence with fewer tool calls, fewer tokens and less noise than reading whole files. Files, indexes and local models stay on the user's machine by default; remote embeddings are only used with explicit permission. It builds a local index under a project-specific directory, and integrates with agent tools such as OpenCode, which can choose to call it on its own without the prompt naming a tool.

The documented implementation is TypeScript and Node.js, with a separately developed Rust implementation.

Website: https://github.com/zvec-ai/zvec-grep
