Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

mikro

mikro is a CLI that implements the RLM (Recursive Language Models) algorithm. It lets LLMs navigate large codebases and document collections programmatically through a persistent Python REPL, instead of stuffing everything into context.
The RLM algorithm comes from recent research. mikro's public CLI surface has been stable since version 1 (August 2026), and its version number records the build date, so read the changelog to learn about breaking changes. Questions are welcome on Discord.

How it works

Traditional RAG retrieves chunks and hopes for the best. mikro takes a different approach:
  1. Prompt externalization: Your context (files, directories) is loaded into a Python REPL as the context variable. Only metadata appears in the LLM message history. The LLM never sees raw context in its messages.
  2. Iterative REPL loop: The LLM writes Python code in ```repl``` blocks. mikro executes each block in a persistent subprocess, feeds results back, and the LLM iterates until it has the answer.
  3. Recursive sub-calls: Inside REPL code, the LLM can spawn child queries:
    • llm_query(prompt) — single LLM completion
    • llm_query_batched(prompts) — concurrent LLM calls
    • rlm_query(prompt) — spawn a full child RLM session
    • rlm_query_batched(prompts) — parallel child RLM sessions
  4. Termination: The loop ends when the LLM calls FINAL("answer") or FINAL_VAR("variable_name"), or when max iterations is reached.

Why use mikro?

ApproachContext handlingBest for
RAGRetrieve chunks, stuff into promptSimple Q&A over small docs
Full contextDump everything into system promptSmall codebases, high cost
mikro (RLM)LLM navigates programmaticallyLarge codebases, complex analysis
mikro (CAG)Cache full context at provider levelRepeated queries, batch Q&A
mikro handles codebases and document collections that are too large for a single context window, while keeping costs low through programmatic navigation and provider-level caching.

Part of the Automagik ecosystem

mikro works standalone or as part of a Genie workflow. Use it as a research tool inside agent sessions, as a batch processor for document interrogation, or as a library in your own tools.

Requirements

  • Node.js 22.19.0 or later
  • Python 3.10+ (for the REPL subprocess)
  • git (the installer clones the mikro repository)
  • An LLM API key (Google Gemini, Anthropic, OpenAI, or any pi/ai provider), or a local Lemonade gateway through mikro's station/ provider, which needs no key
Quickstart
Install, configure, and run your first query in under five minutes.
CLI Reference
Every command, flag, and output mode documented.
Configuration
mikro.yaml format, config commands, and companion files.
Batch Mode
Bulk interrogation, caching, and cost estimation.
Cache Mode (CAG)
Cache full context at the provider for 50 to 90% cheaper repeated queries.