Look up relevant research content to support coaching during quiz or teach-back sessions
Find and extract relevant research content for a given concept or question. Used during interactive coaching sessions to ground feedback in source material.
{{QUERY}} -- the concept, term, or question to look up{{RESEARCH_DIR}} -- path to the directory containing research markdown filesExtract key terms. Parse {{QUERY}} to identify the most important search terms. Consider synonyms and related terms (e.g., "caching" might also appear as "cache", "cached", "memoization").
Search across research files. Use Grep to find mentions of the key terms across all markdown files in {{RESEARCH_DIR}}. Search broadly first, then narrow down.
Rank results by relevance. Prioritize files and sections where:
Read the most relevant files. Read the top 1-3 files identified by the search. Do not read every file in the directory.
Extract focused excerpts. Pull out the specific paragraphs or sections that directly address {{QUERY}}. Do not return entire files. Each excerpt should be self-contained and useful for coaching.
Identify related topics. Note any other topics or concepts referenced in the excerpts that the learner might want to explore next.
Return a single JSON object:
{
"found": true,
"excerpts": [
{
"source": "research/03-caching-strategies.md",
"content": "The relevant paragraph or section text extracted from the file..."
},
{
"source": "research/07-performance.md",
"content": "Another relevant section from a different file..."
}
],
"relatedTopics": [
"cache invalidation",
"CDN configuration",
"TTL strategies"
]
}
found: boolean, whether any relevant content was locatedexcerpts: array of source-attributed content snippets (aim for 1-3)relatedTopics: array of related concept names found in or near the excerptsIf no relevant research content is found, return:
{
"found": false,
"excerpts": [],
"relatedTopics": []
}