XHS Knowledge Retriever
Query the competitor-note RAG index for semantically relevant examples
XHS Knowledge Retriever
Query the competitor-note RAG index and get back the most relevant chunks.
Run
From workspace-xhs-agent/products/xhs-note-learning-cycle:
python3 skills/xhs-knowledge-retriever/scripts/retrieve.py --query "有娃家庭怎么选沙发"
With options:
python3 skills/xhs-knowledge-retriever/scripts/retrieve.py \
--query "有娃家庭怎么选沙发" \
--top-k 5 \
--output /tmp/retrieved.json
Check local readiness without running retrieval:
python3 skills/xhs-knowledge-retriever/scripts/retrieve.py --check-only
Runtime Python packages:
numpysentence-transformers
The script does not require API credentials. If the standard workspace layout is
not available, set XHS_KNOWLEDGE_ROOT to the local knowledge/xhs directory.
What it consumes
- Canonical Competitor RAG Storage (
index.json) - Canonical Competitor RAG Storage (
embeddings.npy) - Canonical Competitor RAG Storage (
metadata.jsonl)
What it produces
- JSON with the query, model, and top-k results including:
score(cosine similarity)chunk(the retrieved text)metadata(competitor name, note title, note URL, title pattern, content signals, etc.)
Rules
- Read only. It only queries the local index.
- Planner/Writer should call this before making creative decisions.
- Retrieved chunks are inspiration, not copy sources.
- Do not publish competitor text verbatim.
Related skills
- Downloads
- 550All time
- Security audit
- Pass
- Last updated
- 3mo ago
- Current version
- v0.1.0
- License
- MIT-0
