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.4-cp313-cp313-manylinux_2_17_x86_64.whl (88.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hygrep-0.0.4-cp313-cp313-macosx_11_0_arm64.whl (78.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

hygrep-0.0.4-cp312-cp312-manylinux_2_17_x86_64.whl (87.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hygrep-0.0.4-cp312-cp312-macosx_11_0_arm64.whl (78.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hygrep-0.0.4-cp311-cp311-manylinux_2_17_x86_64.whl (88.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hygrep-0.0.4-cp311-cp311-macosx_11_0_arm64.whl (78.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for hygrep-0.0.4-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c72cd3c53410b3e17f387880fa608c656eb6b1a7f78b1f6ec0e5a33afc2d62bc
MD5 7d4bb69d4d94acd8064789dcd74d6739
BLAKE2b-256 910e8cd5ee6a11e1d5b569f5783ace08b882c20188345cd8a276bfb2b390dee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f462a2e8b3bf58d0a06b81ef351dd3da022ecfd77b7d0faef81d7632649265b7
MD5 bf127c94c9da6ddfb59db53eb3b1dc53
BLAKE2b-256 508a96e1b061af6125abb85966a314597c362981151a36d5324f936e8598d7cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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.4-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.4-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 83f480b009d3587f91b7b5ee3eb52775091c7a915a19da818e490df836833c77
MD5 ccead188c547d7124cb1b16d7afe7178
BLAKE2b-256 5b2291b987e5f2316c3fdca590cb067e0c7792175ac5ed2ce3e8a1cd6ff6cfdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef1e99e86736827bba3295965eddd7152d94e533fdbd109f2b0eefafc388cd4f
MD5 74c629715d7739c640fe3c12acfc8747
BLAKE2b-256 9d55ebac1d92fd83091017775319ebbf31d793ccff989a4049c2104ddb12d60d

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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.4-cp311-cp311-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.4-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0eb61142c24dbd4f95dd9c21131606fce7348297e33fe64f526b144e8c3a774f
MD5 bba42c2b8d886e9fd73a4c32bcb51479
BLAKE2b-256 632435fad8d1dd5bd2f8864cd48277f460408a2f85245ec35a1e200df22ed813

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hygrep-0.0.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea4951cb651577b9cd704870ad38585d3a1dbe4c15e7aafa6a33d16ef94d4540
MD5 280e749ea1493b1fbb511ab0de866d58
BLAKE2b-256 079ce3a4c298f03d8bb69ab3b0dc61e2ea4d66a8a59a876a861494760a08747f

See more details on using hashes here.

Provenance

The following attestation bundles were made for hygrep-0.0.4-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