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 (hhg)

Hyper hybrid grep: fast scanning + neural reranking

pip install hygrep
hhg "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

The binary name for hygrep is hhg.

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

Usage

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

Run hhg --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

Bash, C, C++, C#, Elixir, Go, Java, JavaScript, JSON, Kotlin, Lua, Mojo, PHP, Python, Ruby, Rust, Svelte, Swift, TOML, TypeScript, YAML, Zig

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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hygrep-0.0.6-cp313-cp313-macosx_11_0_arm64.whl (81.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

hygrep-0.0.6-cp312-cp312-manylinux_2_17_x86_64.whl (89.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hygrep-0.0.6-cp312-cp312-macosx_11_0_arm64.whl (81.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hygrep-0.0.6-cp311-cp311-manylinux_2_17_x86_64.whl (90.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hygrep-0.0.6-cp311-cp311-macosx_11_0_arm64.whl (81.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 706ffae7bbce0abd70923bb6697e9cafa4432d32e3c394eaf62c0b0639bf4320
MD5 0f0a3ba18e7d1daca3a24a0d9302034b
BLAKE2b-256 deca8a1fdbcb1b896b22a949a48595b9030ba6ad0402208750927865069f466b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 123f70373ca63cab4d07847af841f377aabaf13f084164e249ba2b291788f65e
MD5 4495a41f304ebdc67be8b3db901b6eec
BLAKE2b-256 9817c50a65d9115a9c30b3bc545c477e2b820dd496fcef065a1392922036202b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 ec348867d8194750198e7542b87e45950cc57dc55b0705d78a46003ed51f6ee8
MD5 64427dd363b2884e3311c08ebf225fa2
BLAKE2b-256 640b4dba8be50585b69fac1608a7f9828f58622e5468d0d615409aab88b9e5a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3298fe9a2f41ae1593b715d773fb0b9f72d315e03b7ffca646c540f9bc0bd0d9
MD5 d144e2de93bf948c190916e0a1ebd67a
BLAKE2b-256 ab6f5618218b186ffd83569164ac01e070df9d2708d0efc334d05f0f39b09872

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 cdb9e855cbd00f616d2fca89782702fe43faa610a591c09106774f8af05473bb
MD5 2dd462339b3ed60ae591ad0c4fd512f7
BLAKE2b-256 c8b7e789ba3042925c8fe6420184523eb6c88966e6c8c816f5ec82289d40d8df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8bbc25ff37d6faaacb10b03221799918109bf30a48212077bc72f0088d85ecea
MD5 7caa7df438352019bbac888f31312c43
BLAKE2b-256 99d342b25264e714fedfba50fdd95666e35036591360c107b48f09169a01d6a3

See more details on using hashes here.

Provenance

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