DEV Community

Cover image for Kensaku: Local Semantic File Search in Rust, with OCR and MCP for AI agents and Humans.
Gochi
Gochi

Posted on

Kensaku: Local Semantic File Search in Rust, with OCR and MCP for AI agents and Humans.

I Built Kensaku: A Local-First File Search Engine in Rust with Semantic Search, OCR, and MCP

Have you ever remembered exactly what a file contained but had absolutely no idea what you named it?

You remember the code you wrote, the document you downloaded, or the screenshot you saved. But searching for it means guessing filenames, opening folders, and trying different keywords.

I wanted to make that experience better, so I built Kensaku — an open-source, local-first desktop search engine that helps you find files by their names, contents, and meaning.

GitHub: https://github.com/yjid/kensaku

Why I built it

Traditional file search works well when you know what you're looking for. Search the exact filename or a phrase inside a document, and you can usually find it.

But what happens when you remember the idea rather than the words?

For example, you might remember a document explaining database indexing but not remember whether its filename contains database, index, notes, or something completely unrelated.

That's where semantic search becomes useful.

I wanted one local search tool that could combine multiple retrieval methods instead of forcing everything through filename matching alone.

What Kensaku does

1. Semantic search

Kensaku supports searching for files by meaning, helping you find relevant content even when your query doesn't exactly match the words in a file.

This complements traditional search rather than replacing it. Exact terms are still useful, and different retrieval methods have different strengths.

2. Full-text search with BM25

Kensaku also uses BM25 for full-text retrieval. This helps rank documents based on how well their textual contents match a query.

Combined with filename search and semantic retrieval, it gives you multiple ways to discover a file.

3. OCR and document extraction

Files aren't always clean, searchable text. Some contain scanned pages or image-based content.

Kensaku includes OCR-oriented workflows and document extraction to make more of this material searchable. The goal is to bring documents and other useful local content into the same search experience.

4. Search your local files through MCP

This is one of the parts I'm particularly interested in.

AI agents are becoming better at reasoning, writing code, and working with information. But finding the right information in your existing local files can still be a separate problem.

Kensaku exposes its local index through an MCP server, allowing compatible AI agents to query indexed files and retrieve relevant snippets.

Instead of maintaining a separate cloud knowledge base for this workflow, an agent can work with the index on your machine.

That creates an interesting possibility: the same search infrastructure can serve both direct human searches and AI-assisted workflows.

5. Built with Rust

Kensaku uses Rust and Tauri for its desktop application.

Semantic search uses a small, static quantized embedding table of approximately 7.7 MB, and semantic queries don't require a GPU.

The broader goal is to keep the application lightweight and make local search useful without requiring dedicated AI hardware.

Local-first by design

Kensaku is designed around local file search rather than cloud-based indexing.

Your files don't need to be uploaded to a hosted search service just to make them searchable. This is particularly useful for people who work with private documents, source code, research material, and personal archives.

The project is open source under the MIT license, so you can inspect the implementation, report problems, and contribute improvements.

It's still a work in progress

Kensaku is early, and there are still areas to improve.

I'd particularly like feedback on:

  • Semantic search relevance and ranking quality.
  • Indexing speed and resource usage on large collections.
  • OCR and document extraction coverage.
  • The MCP interface and how AI agents should interact with local files.
  • Installation experience and support across operating systems.

I'd rather get real feedback from developers using their own files than assume I've already solved every part of the problem.

Try it out

Repository: https://github.com/yjid/kensaku

Check out the source, try the available release, and let me know what works and what doesn't.

If the project sounds useful, please consider giving it a ⭐ on GitHub. Stars help more developers discover the project and motivate continued development.

Issues, honest feedback, and contributions are all welcome.

I'm building Kensaku in the open and looking forward to seeing what people do with it.

Top comments (0)