qmd AGENTS.md

A project instruction document for qmd, a Rust program that searches a local knowledge base using text, meaning-based, and combined search.

In plain words
What is it for?
Use it when developing or maintaining qmd and its search engine, local language-model features, or AI-agent integration.
Why use it?
It gives coding agents the repository's architecture, build requirements, and known issues so they can work consistently.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/tidyinfo/qmd/agents-md
Clone the repo
git clone --depth 1 https://github.com/tidyinfo/qmd

Made for: Codex, OpenCode.

Per session 1,522 This file is loaded in full into every session.
When invoked 1,522 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01522 $0.01522
Opus 5 $0.00761 $0.00761
Sonnet 5 $0.00304 $0.00304
Haiku 4.5 $0.00152 $0.00152

Measured 3d ago against content hash 165e411af794, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

qmd AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

QMD — Developer & Agent Guide

This document describes the project architecture, build instructions, and known issues for contributors and AI coding agents working on this repository.


Project Overview

qmd is a local knowledge-base search engine written in Rust. It provides:

  • BM25 full-text search via SQLite FTS5
  • Vector semantic search via sqlite-vec (statically linked)
  • Hybrid search with RRF (Reciprocal Rank Fusion) score merging
  • LLM query expansion (local GGUF model or remote OpenAI-compatible API)
  • MCP server for AI agent integration (JSON-RPC 2.0)

Single binary (~10 MB), no runtime .so dependencies beyond glibc 2.17+.


Repository Structure

qmd-standalone/
├── Cargo.toml              # Workspace root
├── qmd/                    # Core library
│   └── src/
│       ├── lib.rs          # Public API
│       ├── store.rs        # DB layer — FTS5, vec0, structured_search
│       ├── search.rs       # Query validation, RRF, snippet extraction
│       ├── embed.rs        # Embedding engine (llama.cpp GGUF)
│       ├── generate.rs     # Generation engine for query expansion
│       ├── rerank.rs       # Cross-encoder reranker
│       ├── collections.rs  # Collection management
│       ├── chunker.rs      # Smart chunking (900-token target, 15% overlap)
│       ├── ingest.rs       # File ingestion pipeline
│       └── ...
├── qmd-cli/                # CLI binary + MCP server
│   └── src/
│       ├── main.rs         # Commands: search, vsearch, query, embed, mcp, …
│       └── mcp.rs          # MCP JSON-RPC server implementation
├── tests/
│   └── integration_test.sh # Shell-based integration tests
└── scripts/
    └── build.sh            # Build helper

Build

Requirements

Component Version Notes
Rust 1.83+ rustup update stable
glibc 2.17+ Runtime only (CentOS 7+, Ubuntu 13.04+)

Standard Build

export AWS_LC_SYS_NO_PREFIX=1
export CFLAGS="-fno-builtin-memcmp"
cargo build --release
# binary: target/release/qmd

Read the full file on GitHub · 184 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 184 lines · 1,522 tokens per session scan A 165e411af794

Subscribe to this mod's changes

qmd AGENTS.md is an instructions file published in the GitHub repository tidyinfo/qmd (5 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 1,522 tokens to every session, about $0.0076 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

exomem AGENTS.md

AGENTS.md instructions for Artexis10/exomem, a project described as: Self-hosted MCP server that makes your Obsidian/markdown vault searchable — text, PDFs, Office docs, images, audio — from any MCP client. Hybrid retrieval over a typed, governed corpus, sub-second at 50k notes; your files stay plain markdown.

Artexis10/exomem · 4 tokens

exomem CLAUDE.md

Claude Code instructions for Artexis10/exomem, covering exomem — instructions for claude, openspec closure is part of delivery, openspec is the sole specification system, memory boundary and codex worker protocol (gpt-5.6 fan-out).

Artexis10/exomem · 3,048 tokens

siyuan AGENTS.md

AGENTS.md instructions for siyuan-note/siyuan, covering agents.md, 1. non-negotiable constraints, do not hand-edit, verification and prohibited operations and 2. project-specific rules.

siyuan-note/siyuan · 4,668 tokens

obsidian-wiki copilot-instructions.md

Copilot instructions for Ar9av/obsidian-wiki, covering obsidian wiki — copilot context, project overview, key concepts, skills reference and coding conventions.

Ar9av/obsidian-wiki · 689 tokens

pi-llm-wiki AGENTS.md

Instructions for zosmaai/pi-llm-wiki, covering agents.md, project, tech stack, file layout and conventions.

zosmaai/pi-llm-wiki · 594 tokens

easy-notion-mcp CLAUDE.md

Instructions for Grey-Iris/easy-notion-mcp, covering easy-notion-mcp, open source context, .meta/ publication policy (hybrid, 2026-07-02), standing priorities and commands.

Grey-Iris/easy-notion-mcp · 4,152 tokens