Lynx transforms developer intent into stable repository coordinates — symbols, files, and structural chunks — enabling downstream reasoning systems like Lea to operate on deterministic code primitives instead of fragile text spans.
Lynx discovers. Lea reasons.
Features • Ecosystem & Architecture • Design Principles • Installation • CLI Usage • MCP Server • Repository Layout • Contributing
- Symbol-first discovery with stable, deterministic identifiers rather than fragile text snippets.
- Multilingual Support: Tree-sitter parsing for structured symbol extraction and syntax-aware chunking:
- Rust (
.rs) - Go (
.go) - TypeScript / TSX (
.ts,.tsx) - JavaScript / JSX (
.js,.jsx) - Python (
.py)
- Rust (
- Hybrid Retrieval: Integrates BM25 lexical search (via Tantivy) with semantic vector search (via FastEmbed utilizing
bge-small-en-v1.5) using Reciprocal Rank Fusion (RRF) for optimal relevance. - Local-first, CPU-first: Zero cloud or GPU dependencies. Operates entirely offline with high-performance local indexing.
- Heuristic Signal Boosting:
- Definition Boost: Prioritizes symbol definitions over code references (1.5x score multiplier).
- Noise Suppression: Filters and penalizes mock, test, generated, and vendor code automatically.
- Integrations: Supports a minimal stdio Model Context Protocol (MCP) server and integrates natively with the Lea reasoning layer.
Lynx sits at the absolute beginning of the AI-native developer pipeline. It converts human queries or vague agent intents into exact coordinates in a repository, passing them off to reasoning engines like Lea for structural analysis.
graph TD
Query[Human Request / Agent Query]
Sub1[BM25 Search]
Sub2[Vector Embeddings Search]
RRF[Reciprocal Rank Fusion]
Heuristics[Heuristic Boosting / Definition & Noise Filters]
Coordinates[Precise Symbol Coordinates]
Lea[Lea Reasoning Engine]
Agent[Downstream Developer Agent]
Query --> |Classify & Tokenize| Sub1
Query --> |Generate Embedding| Sub2
Sub1 --> RRF
Sub2 --> RRF
RRF --> Heuristics
Heuristics --> Coordinates
Coordinates --> |Deterministic Symbol IDs| Lea
Lea --> |Structural Analysis / Impact Radius| Agent
- Discovery Only: Lynx does not perform reasoning, dependency analyses, or calculate impact radius. Its sole job is to answer: "Where is this concept located?"
- Speed First: Cold queries execute in
< 100ms, while cached or warm queries resolve in< 10ms. - Token Efficiency: Instead of dumping thousands of raw lines or dozens of files, Lynx provides the minimal, precise coordinates (symbol ranges, file coordinates) needed.
- Deterministic Base: Bypasses ranking completely for exact symbol lookups (
O(1)complexity) to guarantee repeatability.
Install the CLI directly from crates.io:
cargo install pizen-lynxThe CLI installs under the binary name lx.
Build the persistent .lynx index for a repository:
lx index /path/to/repoTest, mock, and generated files are skipped by default. Include them with --include-tests; rebuild an existing .lynx with --force:
lx index /path/to/repo --include-tests --forceFused lexical + semantic retrieval over the workspace, printing ranked evidence:
lx search "jwt validation token"
lx search "jwt validation token" --mode semantic --limit 5Resolve an exact symbol's identity coordinates bypassing rank fusion:
lx resolve LoginPrint the relation graph incident to a symbol (calls, contains, implements, ...):
lx relations ValidateEmit a token-budgeted ContextPackage as JSON:
lx context "user validation handler" --token-budget 2048Retrieval subcommands operate on a session index of the current workspace (git toplevel of the working directory); only lx index writes the .lynx artifact.
Lynx includes a built-in Model Context Protocol (MCP) server communicating over standard input/output (stdio). This allows LLMs and AI agents (like Claude Desktop) to query symbols and relations natively.
You can launch the server directly from the CLI:
lx mcpOr run the standalone binary directly (optional argument: workspace root):
cargo run -p pizen-lynx-mcp -- /path/to/repoThe server indexes its workspace at startup and speaks newline-delimited JSON-RPC 2.0 (initialize, tools/list, tools/call, ping).
| Tool | Arguments | Primitive |
|---|---|---|
search |
query, mode?, limit? |
Hybrid RRF search returning ranked Evidence |
resolve |
name |
Exact symbol lookup by fqdn or trailing name |
inspect |
symbol_hash |
Full evidence for a content hash |
relations |
symbol_hash, kind? |
Structural edges incident to a symbol |
similar |
symbol_hash |
Embedding-similarity neighbors |
context |
query, token_budget? |
Compiled, budget-bounded ContextPackage |
index_status |
path? |
Provenance and population counts of the served index |
Example tools/call frame:
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search","arguments":{"query":"authentication flow"}}}crates/
lynx-cli/ # CLI tool and subcommand handler (crate: pizen-lynx)
lynx-common/ # Shared utilities and core workspace structures (crate: pizen-lynx-common)
lynx-core/ # RRF pipeline, classification, indexing, and ranking (crate: pizen-lynx-core)
lynx-embed/ # Embedding abstraction and local FastEmbed provider (crate: pizen-lynx-embed)
lynx-mcp/ # Standalone MCP server over stdio (crate: pizen-lynx-mcp)
lynx-parser/ # Syntax parsing and Tree-sitter symbol extraction (crate: pizen-lynx-parser)
lynx-protocol/ # Shared serializable serialization protocols (crate: pizen-lynx-protocol)
lynx-storage/ # Tantivy lexical indexing & embedding persistence (crate: pizen-lynx-storage)
We welcome issues and pull requests! Ensure all formatters, lints, and tests pass successfully before submitting changes:
make ciMIT