Skip to main content

Hybrid grep: fast scanning + neural reranking

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

hygrep

Hybrid grep: fast scanning + neural reranking

pip install hygrep
hygrep "auth logic" ./src

What it does

  • Semantic search: "auth" finds "login", "session", "token"
  • Smart context: Returns full functions/classes, not just lines
  • Fast: Parallel regex recall (~20k files/sec), then neural reranking
  • Zero indexing: Works instantly on any codebase

Install

pip install hygrep
# or
uv tool install hygrep
# or
pipx install hygrep

First search downloads the model (~83MB, cached in ~/.cache/huggingface/).

Usage

hygrep "query" [path]           # Search (default: current dir)
hygrep "error handling" . -n 5  # Limit to 5 results
hygrep "auth" . --fast          # Skip reranking (instant grep)
hygrep "test" . -t py,js        # Filter by file type
hygrep "config" . --json        # JSON output for agents/scripts
hygrep info                     # Check installation status
hygrep model                    # Show model info
hygrep model install            # Pre-download model (for CI/offline)
hygrep model clean              # Remove cached model

Run hygrep --help for all options.

Output

src/auth.py:42 [function] login (0.89)
src/session.py:15 [function] validate_token (0.76)

With --json:

[{"file": "src/auth.py", "type": "function", "name": "login", "start_line": 42, "score": 0.89, "content": "def login(user): ..."}]

Config

Optional ~/.config/hygrep/config.toml:

n = 10
color = "always"
exclude = ["*.test.js", "tests/*"]
cache_dir = "~/.cache/hygrep"  # Custom model cache (default: shared HF cache)

Supported Languages

Python, JavaScript, TypeScript, Go, Rust, C, C++, Java, Ruby, C#, Mojo

How it works

Query → Parallel regex scan → Tree-sitter extraction → ONNX reranking → Results
Stage What
Recall Mojo/Python parallel scanner (~20k files/sec)
Extract Tree-sitter AST (functions, classes)
Rerank ONNX cross-encoder (mxbai-rerank-xsmall-v1)

Development

git clone https://github.com/nijaru/hygrep && cd hygrep
pixi install && pixi run build-ext && pixi run test

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hygrep-0.0.3-cp313-cp313-manylinux_2_17_x86_64.whl (88.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hygrep-0.0.3-cp313-cp313-macosx_11_0_arm64.whl (78.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

hygrep-0.0.3-cp312-cp312-manylinux_2_17_x86_64.whl (88.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hygrep-0.0.3-cp312-cp312-macosx_11_0_arm64.whl (78.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hygrep-0.0.3-cp311-cp311-manylinux_2_17_x86_64.whl (88.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hygrep-0.0.3-cp311-cp311-macosx_11_0_arm64.whl (78.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file hygrep-0.0.3-cp313-cp313-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4e0f0475facfeee9d54e0171d99ff0cb418c87e9cbb3d68de853a76de2277cc9
MD5 f4d89b894fed45000b6254e35a35aa48
BLAKE2b-256 a747d1b44352c809bfeb6b715762997f9457950b307ac773b70f04fb807ec139

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp313-cp313-manylinux_2_17_x86_64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hygrep-0.0.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d529e9e985fd1e2f1b62798ad2d933c83eddd2a62ce5233ea1a79c16b7f9a95
MD5 95cf32a3a0ccbe2225301cc03bff3168
BLAKE2b-256 4418be5769459060ca7ebd992094ceecb0c0fcb5e1d8997e9afaa6a3d1cde13a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hygrep-0.0.3-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f23ca5e16c1cab72f920644f0dec885f16d4094d4bf094a8219ffeb22e3c0435
MD5 798e255de52f1d1fca90264c502914d8
BLAKE2b-256 cc46a6622f9d941686e77bfb60e551072cbfc3e5b6c86576aa33f15d623d5ef8

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp312-cp312-manylinux_2_17_x86_64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hygrep-0.0.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1048af5f693c3732315c9e9e15d82dca9e339a703800fee7ce6a7bc0ba8c2527
MD5 f1a8b1419111b0e2d52f32b5b58203af
BLAKE2b-256 a9496ec7d7a230399fefa943c743b8013670cea17c077a2dbd1f5a40d477cf7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hygrep-0.0.3-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4ff4e0aa2ca16b11d720656e099d674f5e627c6efd04212aaac7a195597e54ad
MD5 6f8665218e0fc68b5c4a55e2fc813607
BLAKE2b-256 dff195cab8299e220c18a04bb8c658f45d05ad8d824aa1ed588c397a21bd8b61

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp311-cp311-manylinux_2_17_x86_64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hygrep-0.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ecfb354c31036731c10a603a25f986fe3cb3196d5a6976d451f1339c851e691
MD5 66ff3c186e7f587f77d9f6691de9d541
BLAKE2b-256 a7960b545308838ceb68df7d311feb1564c195ec24e2275674b8229877447262

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on nijaru/hygrep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page