Back to Blog
Features5 min read

QMD: Give Your AI Agent a Search Engine for Its Own Memory

By Bot It Out Team

Your AI agent remembers things. Every conversation, every fact you share, every instruction you give — it all gets stored in the agent's memory system. But how well can your agent actually find what it stored?

The Problem with Vector-Only Search

By default, OpenClaw uses a SQLite-backed vector search for memory retrieval. It works by embedding text into numerical vectors and finding semantically similar content. This is great for conceptual searches like "what does the user prefer for breakfast" — but it falls apart for exact lookups.

Try asking your agent to recall a specific error code, a ticket number, a product SKU, or someone's phone number. Vector search treats these as abstract patterns, not literal strings. The result? Your agent "forgets" things it definitely stored.

This is not a hallucination problem. It's a search problem.

What QMD Does Differently

QMD (Query Markup Documents) is a local search engine created by Tobi Lütke that combines three search strategies:

  • BM25 full-text search — fast keyword matching that excels at finding exact terms, code symbols, error messages, and identifiers
  • Vector semantic search — the same conceptual similarity matching you already have
  • LLM re-ranking — merges results from both methods using Reciprocal Rank Fusion, then uses a language model to pick the most relevant matches

The result is hybrid search that handles both "what did the user say about their marketing strategy" and "find the Stripe webhook ID sk_live_abc123" equally well.

Runs Entirely on Your Instance

QMD requires zero external API keys. No OpenAI, no Pinecone, no cloud vector databases. Everything runs locally on your Bot It Out instance:

  • Local GGUF embeddings for vector search
  • Local BM25 index for keyword search
  • Local LLM re-ranking for result fusion

This means your agent's memory never leaves your server. No data sent to third parties, no per-query costs, no latency from external API calls.

When to Enable QMD

QMD is most valuable when your agents handle structured or technical information:

  • Customer support agents that need to recall ticket numbers, order IDs, and specific error messages
  • Research agents that accumulate detailed findings with specific names, dates, and citations
  • Development agents that store code snippets, function names, and configuration values
  • Business agents that track client names, contract terms, and financial figures

If your agent mostly handles casual conversation, the default SQLite backend works fine. But if your agent needs to be a reliable knowledge base, QMD is a significant upgrade.

How to Enable It

In your Bot It Out dashboard, navigate to your instance's Actions tab. You'll find the QMD toggle under Memory Backends. Enable it, and your instance will be redeployed with QMD configured. The agent automatically falls back to SQLite search if QMD encounters any issues, so there's no risk of downtime.

The Bottom Line

Your AI agent is only as useful as its ability to recall what it knows. Vector search alone leaves gaps — especially for the kind of precise, factual retrieval that business-critical agents need. QMD fills those gaps without adding complexity, cost, or external dependencies.

Ready to deploy your AI agent?

Get started free for 30 days.

Start Free