| name | jfox-search |
| description | Use when user wants to search notes, find information, look up knowledge in their Zettelkasten. Triggers on "搜索", "查找", "找一下", "查一下", "搜一下", "帮我找", "有没有关于", "search notes", "look up", "find", "find related notes", "search knowledge base", "notes about". |
JFox Knowledge Base Search
Search and retrieve notes from the Zettelkasten knowledge base.
Prerequisites
Knowledge base must be initialized (jfox init). If search index is stale, run jfox index rebuild first.
Search Strategy Selection
Choose the right search approach based on user intent:
| User Intent | Strategy | Command |
|---|
| Exact keyword or term | Keyword (BM25) | jfox search "<keyword>" --mode keyword --json |
| Concept or idea (fuzzy) | Hybrid (BM25+semantic) | jfox search "<concept>" --mode hybrid --json |
| Pure semantic similarity | Semantic | jfox search "<idea>" --mode semantic --json |
| Explore related topics | Graph traversal | jfox query "<topic>" --depth 2 --json |
| What links to note X | Backlinks | jfox refs --search "<title>" --json |
| What should I link to | Link suggestions | jfox suggest-links "<content>" --json |
Default strategy: --mode hybrid (best balance of precision and recall).
Workflow
Single Search
jfox search "<query>" --mode hybrid --top 10 --json
Parse the JSON output and present results as:
找到 N 条相关笔记:
1. [标题] (score: 0.85)
类型: permanent | 标签: tag1, tag2
摘要: 前100字...
2. [标题] (score: 0.72)
...
提示:使用 jfox show <note_id> 查看笔记完整内容。
Graph-Aware Search
For exploring connections around a topic:
jfox query "<topic>" --top 10 --depth 2 --json
This returns both search results AND their graph neighbors, giving a broader view of the knowledge landscape.
Backlink Discovery
To find what references a specific note:
jfox refs --search "<title>" --json
Link Recommendations
To find notes that should be linked from given content:
jfox suggest-links "<content>" --top 10 --threshold 0.6 --json
Default threshold is 0.6. Lower to 0.3-0.5 for broader suggestions, raise to 0.7-0.8 for stricter matching.
All Search Commands Reference
jfox search "<query>" --mode <hybrid|keyword|semantic> --top <N> --json
jfox search "<query>" --type permanent --json
jfox query "<query>" --top <N> --depth <D> --json
jfox suggest-links "<content>" --top <N> --threshold <T> --json
jfox refs --search "<title>" --json
jfox refs --note "<note-id>" --json
Multi-KB Search
All search commands support --kb <name> to target a specific knowledge base:
jfox search "<query>" --kb work --json
Error Handling
- "Index not found": Run
jfox index rebuild to build the search index.
- Empty results: Try broader query, switch mode to
hybrid, or lower --threshold.
- Slow search: First search loads embedding model (30-60s). Subsequent searches are fast. 可通过
jfox daemon start 启动守护进程避免重复加载。