mgrep: Your New tool to grep and read files and data on your machine, Time to ditch grep

mgrep: Your New tool to grep and read files and data on your machine, Time to ditch grep

What is mgrep?

mgrep is the CLI-native powerhouse that finally lets you grep by meaning, not just syntax. Instead of memorizing exact function names or wrestling with fragile regex, you simply ask natural questions like “where do we validate users?” and it instantly hunts down relevant logic across your code, PDFs, images, and documents.

It works by generating deep semantic embeddings, effectively understanding the intent behind your files to deliver results that traditional tools miss entirely.This isn’t just another search utility; it’s a fundamental shift in how you interact with your data.

By treating your entire project as a map of ideas rather than raw strings, mgrep cuts through noise and finds the specific functionality you remember but cannot name. It brings the resilience of human understanding to the command line, making your workflow faster, smarter, and infinitely more intuitive without sacrificing the speed you expect from a terminal tool.

Why using mgrep?

  • Natural-language search that feels as immediate as grep.
  • Semantic, multilingual & multimodal (audio, video support coming soon!)
  • Web search built-in — query the web alongside your local files with --web.
  • Smooth background indexing via mgrep watch, designed to detect and keep up-to-date everything that matters inside any git repository.
  • Friendly device-login flow and first-class coding agent integrations.
  • Built for agents and humans alike, and designed to be a helpful tool, not a restrictive harness: quiet output, thoughtful defaults, and escape hatches everywhere.
  • Reduces the token usage of your agent by 2x while maintaining superior performance

We have covered several groundbreaking open-source tools on our blog before, but mgrep stands out as a true game-changer for developers who demand both power and precision.

If you are tired of hitting walls with standard grep and want a solution that actually comprehends your codebase, this is the upgrade your terminal has been waiting for.

Why We Do Actually Like it?

Easy Answer, The Web Search Feature, check this cool feature out:

mgrep can also search the web alongside your local files. This is useful when you need to find documentation, tutorials, or answers to programming questions without leaving your terminal.

# Search the web and get a summarized answer
mgrep --web --answer "How do I integrate a JavaScript runtime into Deno?"

Web search queries the mixedbread/web store in addition to your local store, merging results based on relevance. Use --answer (or -a) to get a concise summary instead of raw results.

Features

  • Truly Multi-Format: It uses dedicated models for different content. Code, text, PDF text, and images are all encoded into the same vector space, so you can search across all of them with one query.
  • CLI-Native: It feels like a classic Unix tool. Pipe it, redirect it, use it in your scripts. It slots right into a developer's existing workflow.
  • Offline-First (mostly): While it can use cloud embedding APIs for high performance, it also supports local, offline models, keeping your data private.
  • Smart Chunking: It breaks down large documents and images into meaningful chunks before creating embeddings, so your results are precise and relevant, not just a whole-file match.

Install

The tool requires Python 3.9 version, and you can install it easily using the following command:

pip install mgrep

Use it

To use it all you need to run is:

mgrep "query about error handling" /path/to/your/project

License

The app is a free and open-source project that is released under our favorite open-source license: The Apache-2.0 License.

Resources & Downloads

GitHub - mixedbread-ai/mgrep: A calm, CLI-native way to semantically grep everything, like code, images, pdfs and more.
A calm, CLI-native way to semantically grep everything, like code, images, pdfs and more. - mixedbread-ai/mgrep