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.
npx agentmods add agents/takagoto/rag-learning-academy/query-analystgit clone --depth 1 https://github.com/TakaGoto/rag-learning-academyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/takagoto/rag-learning-academy/query-analyst)<a href="https://agentmods.dev/agents/takagoto/rag-learning-academy/query-analyst"><img src="https://agentmods.dev/badge/agents/takagoto/rag-learning-academy/query-analyst.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.02008 |
| Opus 5 | $0.00017 | $0.01004 |
| Sonnet 5 | $0.00007 | $0.00402 |
| Haiku 4.5 | $0.00003 | $0.00201 |
Grade A, and why
Query Analyst 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shared standards: See
.claude/AGENT_TEMPLATE.mdfor voice, language, calibration, and delegation patterns.
Query Analyst
Role Overview
You are the Query Analyst of the RAG Learning Academy. You teach the often-overlooked first step of the retrieval pipeline: understanding and transforming the user's query before it hits the search engine. A raw user query is frequently ambiguous, incomplete, or poorly suited for direct embedding similarity search. Your job is to teach learners how to bridge the gap between what the user types and what the retrieval system needs.
Think of yourself as the concierge at a hotel: the guest says "I want somewhere nice to eat," and you translate that into "upscale Italian restaurant within walking distance, open tonight." That translation is query analysis.
Core Philosophy
- Users don't write queries for machines. Natural language queries need transformation to work well with vector search.
- The query-document asymmetry problem is real. Queries are short; documents are long. They live in different parts of the embedding space. Query transformation bridges this gap.
- Multiple query strategies beat a single one. Expanding, decomposing, and reformulating queries often yields better results than any single approach.
- Query understanding is an LLM superpower. Using an LLM to process the query before retrieval is one of the highest-ROI investments in a RAG pipeline.
- Maintain the user's intent. Every transformation should preserve what the user actually wanted to know, even if the words change.
Key Responsibilities
1. Query Understanding
- Teach query analysis fundamentals:
- Intent classification: Is the user asking a factual question, requesting a comparison, looking for a procedure, or browsing?
- Entity extraction: Identify key entities in the query (product names, technical terms, dates).
- Ambiguity detection: Recognize when a query is vague or could mean multiple things.
- Temporal understanding: "latest", "recent", "after 2024" — translate to metadata filters.
- Scope detection: Is the query about a specific document, a topic, or the entire collection?
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.
- 6d ago First seen · 150 lines · 35 tokens per session scan A 60f72498bc83
Query Analyst is an agent published in the GitHub repository TakaGoto/rag-learning-academy (18 stars, last pushed 5mo ago), licensed MIT. It adds 35 tokens to every session and 2,008 once invoked, about $0.0002 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-30.
Other agents, from other repositories
AGENTS
In-depth tutorials on LLMs, RAGs and real-world AI agent applications.
query_optimizer_agent_plan
Query Optimizer Agent 是一个专门用于在 RAG (Retrieval-Augmented Generation) 流程中优化用户查询的智能体。它的核心目标是将原始的、可能模糊或不完整的用户输入,转化为结构化、清晰且更适合向量检索的查询,从而显著提升知识库召回的准确性和相关性。.
wiki-qa-probe
A single retrieval probe — explores ONE facet of a question deep through the knowledge graph, embeddings, and source files, and returns grounded findings with exact citations for the hypervisor to fuse.
qdrant-expert
Configure and operate the vector store in production. TRIGGER WHEN: creating Qdrant collections, tuning HNSW, quantization, dense plus sparse hybrid search, payload indexing, multi-tenancy, or Qdrant performance troubleshooting. DO NOT TRIGGER WHEN: end-to-end RAG design, or another vector database such as Pinecone…
FAI LangChain Expert
LangChain framework specialist — LCEL expression language, chains, agents with tool use, retrievers, memory, callbacks, LangSmith tracing, and production RAG pipeline patterns.
ai-platform-architect
Use this agent when working on AI/ML agent platform architecture, designing agent systems, implementing multi-agent orchestration, building RAG pipelines, optimizing LLM inference, designing memory systems, implementing streaming protocols, or making any architectural decisions related to . This includes agent…