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

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hygrep-0.0.5-cp313-cp313-macosx_11_0_arm64.whl (79.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

hygrep-0.0.5-cp312-cp312-manylinux_2_17_x86_64.whl (89.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hygrep-0.0.5-cp312-cp312-macosx_11_0_arm64.whl (79.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

hygrep-0.0.5-cp311-cp311-manylinux_2_17_x86_64.whl (89.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hygrep-0.0.5-cp311-cp311-macosx_11_0_arm64.whl (79.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp313-cp313-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4f9c939ec774713e26739299a0405a8925efa75c32bdd55249abd91dcf02deb9
MD5 79b38f2b160b78df290e812ed39f498d
BLAKE2b-256 5bf02b4d811d44dd0bdb2f6edd598052b334e2c73bc0302aaf2f6fc922965d48

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10c99cdb43da667da896d609713e743ac0cd087ec25848d15d0eb1b257bd495d
MD5 d5e9bb568c1cecc8e2accbd1a4c5e9b6
BLAKE2b-256 a9822fb29847e3008c5b96a490e3bffe4128fe0800e730e13c57dfe5621be757

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bbe7d0e90f0dd2a381713a272acc7fc9d9c896ec101c246c96a5ce342de40235
MD5 2268c9e579f013bb63e1c49952a1a270
BLAKE2b-256 1c5445e29a0b5e149b81f1029e9e9428624268240624b4f0d6763330171a9a78

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 191e0ce86c1b2e8bc07714d8e38803129c1e2255adedda064a658dadca05217d
MD5 e8425b7fa7139c51e25ca75b6e61817f
BLAKE2b-256 b4ac5ac1cbf20b2463bf7174e3f9830d99a7e588c7cc0ae93c2a02ff2b39bd6c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp311-cp311-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e71a2eb491e9af5c13abff3ada8b1931ef478df3a7299373092b3650c9baf4d8
MD5 f6eddd8b10087eb72a5f3edd28a96834
BLAKE2b-256 9f994200fa88afd67bbdf01c950f2f91fa0d30762ced2c16ed87f2aceda2af5c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hygrep-0.0.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42dc5f6881f5c3dbd99ac2b28da79d17a9c10d93da65020fb9d19e4b6c92574a
MD5 3ec03a46bfe7bfd96b3ded13e3ad8d79
BLAKE2b-256 9b9de02abfb6b935b56ffb3e6ea3ba541d06918d4f2094eecf96cb35dd978813

See more details on using hashes here.

Provenance

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