Frequently Asked Questionsおもてなし
The basics
What is Miru?
Miru is code search built for AI agents. Your agent asks a question in plain language - "where is the auth middleware?" - and gets back the few chunks of code that actually answer it, each with a file path, a line range and the snippet itself. No grepping around the repo, no pulling whole files into context to find out they were the wrong files.
It works from an index of your codebase that Miru builds and keeps on your own machine. The index is created on the first search, updates incrementally as you edit, and needs no database to run. Search against it is hybrid: semantic embeddings to match on meaning, keyword matching for exact terms, then reranking to order the results.
Miru ships in two forms: a command-line tool, and an MCP server that plugs into your agent or IDE so the agent can search the codebase as a native capability. It is open source under the MIT licence, written in TypeScript on the Bun runtime.
Why does that matter?
Agents spend most of their tokens working out where to look, not writing code. In our controlled benchmark - 41 real questions on a large open codebase, three runs each, 246 runs in total - Claude Code with Miru was 20% cheaper on average, 11% faster and used 17% fewer turns than the same agent using grep. Best case on a single question was 50% cheaper.
How do I get started?
Three commands, assuming you have Bun 1.1+ installed:
bash
bun add -g @takara-ai/miru-code
miru setup # stores your API key
miru install # configures your IDE or agent
Restart the IDE and your agent has `search`, `locate`, `expand` and `find_related` available. Your first $10 of credit is on us, which is roughly 80M tokens.
Do I need a vector database?
No. The index is a local cache on your own machine, so there is no database to run, no infrastructure to plan for and nothing to keep in sync. It is also nothing to back up - if you delete it, the next search rebuilds it.
Does Miru replace grep?
No, and you shouldn't want it to. Miru is for orientation - finding where to look when you don't know the exact string. For exact literals like `REDIS_HOST`, an error code or a symbol name, use `locate`, which searches the same index for exact substrings. Grep is still the right tool once you know precisely what you're looking for.
Compatibility
Which agents and IDEs do you support?
Cursor, Claude Code, Gemini CLI, Kiro, OpenCode, GitHub Copilot, Codex, VS Code, Visual Studio (Windows) and Windsurf. `miru install` writes the config for whichever you pick. Windsurf currently gets experimental hooks only, not a full MCP entry.
Miru runs on macOS, Linux and Windows.
I use a programming language you don't support. What can I do?
Use it anyway - it will still work, just with coarser results.
Miru chunks source code in three tiers. First it tries AST chunking with tree-sitter, which gives syntax-aware boundaries (whole functions, whole classes) for 22 languages: bash, C, C++, C#, CSS, Dart, Elixir, ERB-style templates, Go, Haskell, HTML, Java, JavaScript, JSON, OCaml, PHP, Python, Ruby, Rust, Scala, Solidity and TypeScript. If that isn't available it falls back to structural heuristics, and failing that to line splits.
Everything that gets indexed is searchable regardless of tier, because search is hybrid - embeddings plus BM25 plus reranking - and the embedding model is not restricted to the AST list. Kotlin, Swift, Vue and SQL, for example, index on line splits today. The practical difference is that your snippets have less tidy boundaries, so the agent may need one extra `expand` call to get full context.
If your language matters to you, tell us at support@takara.ai and we'll look at adding the grammar. Miru is MIT licensed, so you can also add it yourself.
Can it index documentation and config, not just code?
Yes. Use `--content` to index `code`, `docs`, `config` or `all`.
Can it search a repository I haven't cloned?
Yes. Pass an `https://` git URL instead of a local path.
Custom agents and other tooling
We've built our own coding agent in-house. Can we use Miru with it?
Yes. Miru is agent agnostic and there are three ways in, depending on how your agent is built:
MCP server. If your agent speaks MCP, point it at Miru and it gets `search`, `locate`, `expand` and `find_related` as tools. This is the least work.
CLI with `--json`. Shell out to `miru search "..." ./src --json` and parse the result. Useful for scripted or non-MCP pipelines.
Library. Import it directly:
ts
import { MiruIndex } from "@takara-ai/miru-code";
const index = await MiruIndex.fromPath("./src");
const results = await index.search({ query: "BM25 tokenize", topK: 10 });
One thing to plan for: the retrieval only pays off if your agent actually reaches for it. `miru install` writes a short search policy into `CLAUDE.md` / `AGENTS.md` for the tools we support, telling the agent to prefer Miru over grep. With a custom agent you'll want the equivalent instruction in your own system prompt. Budget an hour or two of prompt tuning on top of the integration itself.
We've already built our own code search. Why would we switch?
You may not need to. The honest test is a side-by-side on your own repo and your own questions - that is the only comparison that means anything. Miru has a built-in benchmark mode that reports token savings per query against a grep baseline, so you can measure rather than take our word for it. What we'd expect to save you is the maintenance: no index infrastructure, no embedding model to host or upgrade, and the AST chunking and reranking already tuned.
We have non-developers using a coding agent. How easy is Miru for them?
After install, it is invisible. The agent decides when to search and calls Miru itself. There is nothing new for the user to learn and no interface to open. The install is the only developer-shaped part: install Bun, run three commands in a terminal, restart the IDE. That's about five minutes for someone comfortable with a command line, and it's a one-off. We don't have a graphical installer today.
For a team of non-technical users I would have IT ship it - either in the standard machine image or as a short setup script that runs the three commands with the API key already set (`miru setup --key YOUR_TOKEN` is non-interactive for exactly this). After that there is nothing to administer: no vector DB, no servers, no per-user configuration.
Models, security and deployment
What happens if I'm using a local LLM?
It works. Miru does retrieval, not generation, so it doesn't care which model your agent runs - local, hosted, open weights, anything. It is worth separating the two models involved:
Your agent's model. Entirely your choice. Miru never touches it.
Miru's embedding model. Used to index your code and to embed queries. By default this is our `ds1-code` model on the Takara endpoint.
So on a default install, your generation stays local but your code chunks are still sent to us to be embedded. If the point of running locally is that nothing leaves the machine, you have two options: run our embedding model in your own AWS account on SageMaker, or point `MIRU_OPENAI_BASE_URL` and `MIRU_OPENAI_EMBEDDING_MODEL` at any OpenAI-compatible embeddings endpoint, including one running locally.
The caveat, stated plainly: our benchmark numbers are measured with `ds1-code`. A substitute embedding model will change result quality, usually downwards, and we can't support retrieval quality on a model we didn't train. If accuracy matters more than convenience, the SageMaker deployment is the better route - same model, your perimeter.
Does my code leave my machine?
On the default global endpoint, yes - code chunks are sent over HTTPS to the Takara inference API to be embedded, both when the index is built and when a query is run. The index itself and your files stay local.
If that doesn't fit your compliance position, deploy the embedding model into your own AWS account via SageMaker. Code and index never cross your perimeter. `MIRU_WORKSPACE_ROOT` is also available as an opt-in boundary that restricts MCP indexing to a single directory.
Do you train on our code?
No we do not and we never save any of your code. See our Data Processing Agreement for further details.
Can we stop specific files being indexed?
We honour .gitignore and you can also setup an additional .miruignore file for additional fine grained control.
What are the deployment options?
Global endpoint - frictionless, no AWS account needed, pay as you go. Traffic leaves your network over TLS. Costlier at very high throughput.
In your own AWS account (SageMaker) - code never leaves your boundary and it works out cheaper for sustained high throughput. It needs an AWS account and more setup, and because the endpoint is always on it costs more at low throughput. Instances start at around $1.00/hour all-in for `ml.c5.large` and scale to about $25.69/hour for `ml.c5.18xlarge`.
Cost
How does pricing work?
$0.12 per 1M tokens on the global endpoint, $5 minimum purchase, $10 of starter credit. No rate limits - no cap on requests per minute or tokens per minute. Self-hosted deployments are priced per instance hour instead.
How much will it cost to index my repo?
Indexing is where most of the tokens go; searches after that are cheap. As a rough guide,
1M tokens is on the order of 100k lines of code, so a 500k-line repo costs roughly $0.60 to index, and incremental updates only cover what changed. Treat that as indicative rather than a quote - it varies with language and comment density.
How do I know it actually saves us money?
Measure it on your own repo. Miru has a benchmark mode that compares each search against a grep baseline and reports the token difference:
bash
miru benchmark on
# ... work normally for a day ...
miru benchmark status
miru benchmark off
`read_benchmark` gives you the cumulative rollup. We publish our own numbers and the full method at https://takara.ai/blog/we-benchmarked-miru-on-real-coding-questions-heres-what-happened, but your codebase and your questions are the test that counts.
Accounts and support
Do you have enterprise accounts?
Currently not. Self-serve on the global endpoint suits individual developers and small teams - one API key and you're running. We plan to introduce enterprise accounts in a future release.
How do multiple developers share an account?
You can have one API key per developer, or have a shared key - either works. Usage is attributable per key, so having a key per developer gives you better control and reporting.
What happens if the Takara endpoint is unavailable?
If the agent experiences an outage at the Takara endpoint search fail cleanly and let the agent fall back to grep and read, so your work will not be affected. We maintain a status page and run the endpoint across multiple regions so downtime should be minimal.
The index seems stale after a big refactor. What do I do?
The MCP server watches local files and updates the index incrementally, and package upgrades invalidate stale caches automatically. If you've done a large refactor from the CLI only, run `miru clear` to drop the cache and rebuild on the next search.
You haven't answered my question
Whoops - that happens sometimes. We would love to hear your question, contact us at support@takara.com.
Answers coming soon
How large a repo have you tested this on? Does it work on a monorepo?
How long does the first index take?
Where is the index cached?
I would like to use a vector index - how can I do that?
What's the roadmap for language grammars?