Purpose
Vex is a fast hybrid structured + semantic code search tool, positioned as "high-speed hybrid code search built for AI agents." It builds a local index via tree-sitter, allowing developers or agents to query symbols, reference relationships, and call structures in a codebase at low cost and with low token usage.
Main Capabilities
- Exact symbol lookup:
vex check FooUsed to determine whether a symbol exists, suitable for questions like "Does Foo exist?" - Ranked hybrid search:
vex searchUsed for exploratory queries like "find things related to dots and retries," returning relevance-ranked results; when there is no literal matching symbol, nearby information such as callers or imports may surface. - Three-channel hybrid retrieval: structural FST (names) + BM25 (rare terms in the body) + semantic HNSW (meaning), fused via Reciprocal Rank Fusion.
- Persistent call graph:
vex callers/vex calleesRead from a persistent index built during indexing, about 4ms, rather than a real-time tree-sitter scan. - Impact analysis and references: supports commands such as usages and impact; 8 languages with a binder can provide
--strict-level refactoring-grade reference analysis. - AST patterns and indexed grep: supports query methods such as pattern and grep.
- Token efficient: on average, queries save about 6x tokens compared with grep, and up to 217x on minified JS/CSS;
vex showextracts only the symbol body. - Multilingual coverage: 19 languages are indexed by tree-sitter, divided into three coverage tiers: 8 binder languages (Rust / TypeScript / Python / C# / C++ / Go / Java / Kotlin) support type-aware
--strictusages; 15 T1+T2a languages support indexed pattern prefiltering; all 19 support basic structural and semantic search. - Pluggable embedder: through the Embedder trait + registry, MiniLM-L6-v2 can be replaced with future code-specific models (such as BGE, CodeBERT).
- Multi-repository workspace (v1.22.0): via
.vex-workspace.tomldeclare multiple sibling repositories, together with--workspacefan out grouped by repository. - Staleness detection: before searching, compare the git HEAD at index time with the current HEAD, and if it has changed, prompt that the index is stale.
Usage
After installation, run vex index to build the index, then you can use vex check Foo、vex search、vex usages Foo --strict and other commands. The install script supports VEX_VERSION pinned versions,VEX_INSTALL_DIR specifying the install directory,VEX_NO_MCP=1 skipping vex-mcp. Precompiled binaries cover some platforms; Linux requires glibc 2.34 or later (Ubuntu 22.04+, Debian 12+, RHEL/Rocky/AlmaLinux 9+), and older systems or musl and aarch64 require building from source. Source installation requires a C/C++ toolchain (GCC 12 or later), libssl-dev, and pkg-config; the first vex index --semantic will download an approximately 86 MB embedding model; structural search requires no download. GPU acceleration is built into the precompiled binaries: Windows uses DirectML, macOS arm64 uses CoreML, and NVIDIA CUDA requires building from source with it enabled.
The configuration file .vex.toml can be placed in the project root to customize behavior; CLI arguments override the configuration; you can also use --config <path> / $VEX_CONFIG or place it in a parent directory to avoid polluting the repository. The index itself is stored in the cache directory and is not written into the repository.
Suitable Scenarios
Suitable for fast symbol search and code exploration in AI agent workflows, especially scenarios that require repeatedly querying the same codebase and care about token efficiency. For precise questions like "Does Foo exist?" "Show its body" "Who calls it?", you should use vex check / vex show / vex usages --strict, they bypass the ranker.
Limitations
Vex is a static analysis indexing tool, not a language server: it does not support jumping to third-party package definitions, rename refactoring, type checking, or hover documentation, and an LSP should continue to be used for these.vex search is a ranked hybrid result rather than an exact name lookup; when a literally named symbol does not exist in the index, BM25 may surface callers or imports as definitions. It cannot see dynamic dispatch, such as decorator routing, string-parsing factories, reflection, or macro expansion; you can use vex grep as a textual fallback.vex callers coverage outside function scope is uneven; class-level decorators remain invisible.vex usages quality varies by language; the 8 binder languages provide refactoring-grade --strict, while the remaining 11 use identifier scanning and have a higher false-positive rate.