Output Formats for Agents
QMD supports multiple output formats tailored for different use cases:JSON - Structured Data
Perfect for programmatic processing:CSV - Spreadsheet/Table Format
Easy to parse and process:Markdown - LLM Context
Format designed for LLM prompts:XML - Structured Documents
XML format for tools that require it:Files List - Minimal Format
Just the essentials (docid, score, path, context):Agent Workflow Examples
Example 1: RAG Pipeline
Retrieve relevant context for a question:Example 2: Multi-Step Research Agent
Example 3: Automated Documentation Assistant
Example 4: Context-Aware Code Review
Using the MCP Server
For tighter integration, use QMD’s Model Context Protocol server. See MCP Server Setup.Best Practices
Use Hybrid Search
qmd query provides the best results for agent workflows by combining keyword + semantic + reranking.Filter by Score
Use
--min-score 0.5 to avoid low-quality results that waste LLM context.Leverage Docids
Docids are stable references that work even if files move. Store them for follow-up queries.
Use --all with Thresholds
Combine
--all with --min-score to get complete result sets above a quality threshold.Add Context Metadata
Use
qmd context add to describe collections. This metadata appears in results and helps agents understand sources.Batch Retrieval
Use
multi-get to retrieve multiple documents in one call instead of looping get commands.