Search the GTSE Knowledge Base for relevant information, returning file paths and excerpts.
Quickly locate relevant documentation, playbooks, skills, or templates within the knowledge base. Essential for answering questions, avoiding duplicate content, and building on existing knowledge.
query (required): Search terms or questioncategory (optional): Limit search to specific folder (e.g., sales, seo, skills)content_type (optional): Filter by type (playbook, skill, doc, template)max_results (optional): Maximum number of results (default: 5)Navigate to the KB root:
cd /path/to/GTSE-AI-HUB/docs
Determine search path based on inputs:
category specified: docs/{category}/content_type is skill: docs/skills/content_type is playbook: docs/playbooks/ or search for *playbook*content_type is template: docs/templates/docs/Primary search using grep (case-insensitive, with context):
grep -rnil --include="*.md" "{query}" {search_path} | head -{max_results}
For multi-word queries, search each term:
grep -rnil --include="*.md" -e "term1" -e "term2" {search_path}
For each matching file, extract relevant excerpt:
grep -B2 -A5 -i "{query}" {file_path}
For each result, parse frontmatter:
head -20 {file_path} | grep -E "^(title|description|parent|tags):"
Prioritize by:
Compile results into structured response.
Query: "How do we handle customer complaints?"
Search execution:
grep -rnil --include="*.md" -e "complaint" -e "customer" docs/
Output:
## Search Results for "customer complaints"
### 1. Customer Complaint Handling
**File:** `docs/skills/handle-complaint/SKILL.md`
**Type:** Skill
**Excerpt:**
> ## Purpose
> To resolve customer complaints efficiently while maintaining brand reputation...
### 2. Customer Service Scripts
**File:** `docs/customer-service/scripts.md`
**Type:** Doc
**Excerpt:**
> ### Handling Complaints
> 1. Acknowledge the issue
> 2. Apologize sincerely...
### 3. Returns & RMA Process
**File:** `docs/operations/returns-rma.md`
**Type:** Doc
**Excerpt:**
> When a customer is unhappy with their order...
---
*Found 3 relevant documents*
## Search Results for "{query}"
### {n}. {title}
**File:** `{relative_path}`
**Type:** {content_type}
**Tags:** {tags if available}
**Excerpt:**
> {2-5 lines of relevant content}
---
*Found {count} relevant documents*
find docs -name "*playbook*" -o -path "*/playbooks/*"
grep -rl "tags:.*\[.*{tag}.*\]" docs/skills/
find docs -name "*.md" -mtime -7 -type f
grep -rn "TODO\|FIXME\|WIP\|TBD" docs/
grep -rl "authors:.*{name}" docs/
If no results found:
update-kb skillskills/ for "how to" questionsplaybooks/ for process questions