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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hygrep-0.0.2-cp313-cp313-macosx_11_0_arm64.whl (78.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

hygrep-0.0.2-cp312-cp312-manylinux_2_17_x86_64.whl (88.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hygrep-0.0.2-cp312-cp312-macosx_11_0_arm64.whl (78.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hygrep-0.0.2-cp311-cp311-manylinux_2_17_x86_64.whl (88.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hygrep-0.0.2-cp311-cp311-macosx_11_0_arm64.whl (78.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 89d0886cedbb86822212cdc824a59eeb198158c194077dc4707ba375c94dd6ca
MD5 95f1d1bfee862048ed7d02bd54d23b15
BLAKE2b-256 c3bf4b4a71b355c141e39436a3dccae85f9ea6bad15ba3e992430e06b6828fdf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 230386e4efd4e65bf7833507436a41a887ddbb8021d132d8c999c89b03c3697e
MD5 9e180a6f9079a6ee49f6082dadac4ca0
BLAKE2b-256 bc5ec00b7ad3045129abe24c629fe72637b7cc36b8169c302acbccaaabad69d0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ec5e6f53af2840835a85d203f9a7ef4e12d75d94ec30dda705c9daf6f782b18e
MD5 c85a3fa300415704b4759928e2ba0d10
BLAKE2b-256 385773fb0046368c175f3469d0b57066f42b5db1910733c9338c94328d5ecb6f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0230324f69b23dc3ed43fd5d98d129b53fdeedc1a3402ab0c7fe53afb0b92be
MD5 12f1d3b96851cce1d9ce5591310b56e7
BLAKE2b-256 447d2868e87474df56a5e9edccf7d4ac7c82ded9270a4364ae61260f00b5c14e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7e40eb4827d856356abf631ecf462f146719812f0eb6eba5531fd971364e2b48
MD5 fcf4521fa5c83b189d7f7777eff6bb5e
BLAKE2b-256 0d3b4def7cd7fcfd78fd1d0d5d98baa77c1feda520f17ceaf099045366169d93

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4d48bc441d51cc5a9cb0871d7a0ac1b39926e053d3c38eee1b152bd381f5d38
MD5 467b1e2aa0dddb795fe59b62079f4df6
BLAKE2b-256 3fd37f0838fb3636c3d7fe596766d380832662f1239b45f24e8e717354a0f5bd

See more details on using hashes here.

Provenance

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