name: kb-search
description: Token-light router for agentic_kb. Core loop: Search Knowledge when KB help is requested; Capture Reusable Knowledge when work teaches something durable; update stale existing knowledge when evidence shows it is outdated. Use on explicit KB search/use/update/capture/setup requests and when a task produces reusable or corrective knowledge worth proposing for KB_Update.
KB Search
Core Loop
- Search Knowledge: use KB retrieval when the user asks for KB-backed help.
- Capture Reusable Knowledge: when work reveals repeatable knowledge, propose KB_Update before finishing.
- Update Stale Knowledge: when retrieved KB content is wrong, incomplete, or outdated, propose KB_Update to correct the existing note.
- Keep KB entries short, objective, pointed, and token-efficient.
- This is how the KB and future agents get smarter.
Do not search the KB for ordinary questions. Do not silently edit the KB.
Load References Only If Needed
- Setup, central repo, sandbox allowlist:
references/setup-reference.md
- Capture Reusable Knowledge / KB_Update:
references/kb-update.md
- Command failure, indexing, Typesense/FAISS issues:
references/troubleshooting.md
- Windows/PowerShell:
references/windows-powershell.md
- Missing
rg: references/rg-installation.md
- Domains:
references/kb-domains.md
- Filter/search examples:
references/search-patterns.md
Path Order
Use first existing path:
$AGENTIC_KB_PATH
agentic_kb/
~/.agentic_kb/
- current repo root with
knowledge/
Central default: KB content/scripts in ~/.agentic_kb; installed skill in ~/.agents/skills/kb-search.
Search
Prefer smart search:
agentic_kb/scripts/smart_search.sh "query"
~/.agentic_kb/scripts/smart_search.sh "query"
scripts/smart_search.sh "query"
Exact fallback:
rg "query" agentic_kb/knowledge/
rg "query" ~/.agentic_kb/knowledge/
rg "query" knowledge/
Update
Ask first: Do you want me to update the KB from git for this session?
agentic_kb/scripts/update_kb.sh
~/.agentic_kb/scripts/update_kb.sh
scripts/update_kb.sh
Answer Rules
- Search.
- Read full relevant file(s); never answer from snippets alone.
- Cite as
<file path> -> <heading>.
- If absent, say
Not found in KB and suggest where to add it.
KB_Update
If work reveals reusable knowledge, propose KB_Update before finishing. Do not silently edit. After user confirms: search for duplicates, add/update the best note under the active KB knowledge/ path, follow KNOWLEDGE_CONVENTIONS.md, and cite the changed KB file. Load references/kb-update.md for details.