Loading...
Loading...
3-Phase Knowledge Search strategy for the RLM Factory ecosystem. Auto-invoked when tasks involve finding code, documentation, or architecture context in the repository. Enforces the optimal search order: RLM Summary Scan (O(1)) -> Vector DB Semantic Search -> Grep/Exact Match. Never skip phases.
npx skill4agent add richfrem/agent-plugins-skills rlm-searchAlways start at Phase 1. Only escalate if the current phase is insufficient. Never skip to grep unless Phases 1 and 2 have failed.
Phase 1: RLM Summary Scan -- 1ms, O(1) -- "Table of Contents"
Phase 2: Vector DB Semantic -- 1-5s, O(log N) -- "Index at the back of the book"
Phase 3: Grep / Exact Search -- Seconds, O(N) -- "Ctrl+F"rlm_profiles.jsonrlm-initcat .agent/learning/rlm_profiles.json| Profile | Typical Contents | Use When |
|---|---|---|
| Docs, protocols, research, markdown | Topic is a concept, decision, or process |
| Plugins, skills, scripts, Python files | Topic is a tool, command, or implementation |
| (any custom) | Project-specific scope | Check |
# Search docs/protocols cache
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile project "vector query"
# Search plugins/scripts cache
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile tools "vector query"
# Ambiguous topic -- search both (recommended default)
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile project "embedding search" && \
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile tools "embedding search"
# List all cached entries for a profile
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile project --list
# JSON output for programmatic use
python3 plugins/rlm-factory/skills/rlm-search/scripts/query_cache.py \
--profile tools "inject_summary" --json# Semantic search across all indexed content
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py \
"nearest-neighbor embedding search implementation" \
--profile knowledge --limit 5
# More results for broad topics
python3 plugins/vector-db/skills/vector-db-agent/scripts/query.py \
"ChromaDB parent child retrieval" \
--profile knowledge --limit 10# Scoped search (preferred -- use paths from Phase 1 or 2)
grep_search "VectorDBOperations" \
plugins/vector-db/skills/vector-db-agent/scripts/
# Ripgrep for regex patterns
rg "def query" plugins/vector-db/ --type py
# Find specific config key
rg "chroma_host" plugins/ -l| Diagram | What It Shows |
|---|---|
| search_process.mmd | Full 3-phase sequence diagram |
| rlm-factory-architecture.mmd | RLM vs Vector DB query routing |
| rlm-factory-dual-path.mmd | Dual-path Super-RAG context injection |
START: I need to find something in the codebase
|
v
[Phase 1] query_cache.py -- "what does X do?"
|
+-- Summary found + sufficient? --> USE IT. Done.
|
+-- No summary / insufficient detail?
|
v
[Phase 2] query.py -- "find code for X"
|
+-- Chunks found + sufficient? --> USE THEM. Done.
|
+-- Need exact line / symbol?
|
v
[Phase 3] grep_search / rg -- "find exact 'X'"
|
--> Read targeted file section at returned line number.inventory.py --missing