PitchHut logo
A smart CLI tool for searching files with relevance scoring.
Pitch

Greq combines the precision of a search engine with the efficiency of a command-line interface, allowing for intelligent searches within files. Unlike traditional tools, Greq uses advanced ranking algorithms and semantic scoring to provide the most relevant results, making it ideal for research and documentation searches.

Description

Greq is an advanced command-line interface (CLI) tool that enhances file searching capabilities, combining the best features of traditional search methods with modern semantic technology. By utilizing linguistic ranking algorithms such as BM25 and Text Embeddings, Greq efficiently scores and sorts files based on their relevance to user queries, effectively acting as a miniature search engine within the command line.

Key Features

  • Advanced Relevance Scoring: Unlike basic pattern-matching tools, Greq employs the BM25 ranking algorithm to evaluate text sections, offering precise results tailored to the search term.
  • Contextual Awareness: Greq segments files into overlapping chunks to provide better contextual results, ensuring users receive not only the matching segment but also surrounding content for enhanced understanding.
  • Natural Language Processing: Designed to perform exceptionally well with multi-word or natural-language queries, making it ideal for semantic searches, research tasks, and documentation reviews.
  • Fuzzy Search Capabilities: With support for fuzzy matching using overlapping sub-tokens, Greq allows searches even for incomplete words, accommodating common misspellings and variations.

How It Works

The tool follows a systematic approach to deliver search results:

  1. Document Chunking: Files are divided into overlapping sections.
  2. BM25 Scoring: Each section receives a relevance score based on statistical measures.
  3. Semantic Scoring: Sections are transformed into semantic vectors through local language models.
  4. Contextual Results: The output includes surrounding sections for better context.
  5. Final Ranking: Results are ranked according to their calculated relevance score.

Supported Queries and Usage Examples

Greq excels with various options:

# Perform a basic search with metadata and highlights
greq "machine learning" test/data -m -l

# Retrieve top results with expanded context
greq "rust programming" . --n 5 -C 2

# Fuzzy matching with sub-token support
greq "capo" test/data --sub-token 4
# Output in JSON format for integration with other tools
greq "error handling" src/ -f json

Hybrid Search

Greq combines traditional BM25 ranking with semantic embeddings for more robust search results:

# Enable hybrid search with balanced weighting
greq "machine learning algorithms" test/data --embedding-weight 0.5

This capability enhances search accuracy for exploratory and concept-driven queries, enabling users to discover related content and insights beyond simple keyword matching.

Installation and Removal

Greq can be swiftly installed via a single command or downloaded manually for various platforms. For uninstallation, a straightforward command is provided, ensuring a hassle-free removal process.

Conclusion

Greq is a powerful tool that revolutionizes file searching, making it an essential asset for developers, researchers, and anyone engaged in extensive documentation or text analysis. With its intelligent approach to search relevance, users can efficiently navigate vast amounts of text while minimizing unnecessary token usage.

0 comments

No comments yet.

Sign in to be the first to comment.