Skip to content

v0.3.0

Latest

Choose a tag to compare

@zhourrr zhourrr released this 03 Nov 07:02
· 8 commits to main since this release
e7ab893

zg 0.3.0: Taking Local Search Performance Further

zg 0.3.0 rebuilds the core execution pipeline in Rust, bringing faster indexing, lower memory use, and quicker CLI startup. This release also introduces a simpler CLI, clearer terminal interactions, and more AI agent integrations.

Performance Improvements

We compared Node.js 0.2.2 and Rust 0.3.0 on an Apple M3 Pro with 18 GB of memory, running macOS 27.2 and Node.js v24.16.0. Indexing tests used four public BEIR corpora—SciFact, NFCorpus, ArguAna, and FiQA—with 75,128 documents, using the same local embedding model and settings.

Metric Node.js 0.2.2 Rust 0.3.0 Improvement
Package size, including dependencies 167.5 MiB 34.3 MiB 79.5% smaller
CLI startup time 153.1 ms 26.8 ms 82.5% less time
Total index build time 219.13 s 77.84 s 64.5% less time
Mean peak memory during indexing (RSS) 4,210.26 MiB 1,968.61 MiB 53.2% lower
Mean search latency (MCP) 20.93 ms 14.88 ms 28.9% lower

Indexing time is totaled across the four corpora; memory is the average of their peak RSS values. MCP search latency is measured with the model and index already loaded.

Across these corpora, total indexing time dropped from 3 minutes 39 seconds to 1 minute 18 seconds, while mean peak memory fell from 4.11 GiB to 1.92 GiB—less waiting and more room for editors, agents, and other development tools.

These gains come from improvements throughout the execution pipeline:

  • Native startup: Removes Node.js runtime initialization and JavaScript module loading from standalone CLI invocations.
  • More efficient computation: Uses native code, explicit numeric types, and contiguous arrays in text encoding and vector computation.
  • Fewer data conversions: Reduces intermediate copies and temporary allocations.
  • Shared resources: Reuses loaded tokenizers and model data on supported local inference paths, with computation scheduled by a native thread pool.

A Simpler CLI

The CLI adopts an rg-inspired “query + options” format. Search directly with zg, and use options such as --index and --status for management operations.

# Search by meaning; hybrid search is the default
zg "where are user permissions checked"

# Build an index for the current workspace
zg --index

# Find exact matches and show source line numbers
zg --rg -n "AuthService" src

Terminal colors, layout, and messages are now more consistent, with clearer model selection, indexing progress, and error guidance.

When searching an unindexed workspace for the first time in an interactive terminal, zg guides you through selecting a local or remote model, builds the index, and continues your query.

More Agent Integrations

This release adds support for GitHub Copilot, Grok Build, VS Code, and Pi, alongside existing integrations with Qwen Code, Claude Code, Codex, OpenCode, and others.

zg --install

Use the interactive installer to configure zg search tools for supported clients.

Bug Fixes

  • File change detection: Prevents stale deletion events from overriding the state of files recreated at the same path.
  • Search result locations: Fixes line-number offsets in some result previews.
  • Index management: Prevents background refreshes from recreating deleted indexes.
  • Agent configuration: Better preserves comments and unrelated settings when updating configurations.
  • Windows compatibility: Improves path handling and terminal colors.