Show HN: grepO: A grep that can consult LLMs and other black-box binaries (github.com)

🤖 AI Summary
grepO introduces a next-generation pattern matching tool that extends traditional regular expressions by integrating external “oracles” like large language models (LLMs), databases, or APIs into the matching process. Unlike standard regex, grepO’s semantic regular expressions (SemREs) include a novel construct—r & <q>—where a base pattern r is refined by querying an external oracle q. This means grepO doesn’t just match text syntactically but can semantically validate matches through black-box programs, enabling much richer and context-aware search queries. Technically implemented in Rust, grepO closely resembles GNU grep in usage but requires escaping of typical regex special characters and uses angle brackets <> to denote external queries. The default oracle example leverages OpenAI’s language models, allowing queries like identifying named entities—e.g., filtering substrings recognized as politicians. While currently a research prototype with limitations such as whole-line matching only, ASCII input support, and partial regex feature parity, grepO’s approach pioneers blending formal language theory with AI-powered semantic understanding. For AI/ML practitioners, it opens avenues for more intelligent, customizable text retrieval directly within familiar grep-like workflows, showcasing a novel synergy between classical pattern matching and modern AI oracles.
Loading comments...
loading comments...