mcpField
W
wiki-query

wiki-query

github.com/rohitg00Productivity2.9k140 installsUpdated 5w ago
Repository

About wiki-query

wiki-query searches wiki-builder pages using SQLite FTS5 BM25 retrieval. It helps users and agents find existing material across wikis, inspect related pages, and cite retrieved content rather than duplicate research.

Key features

  1. 01BM25 full-text search
  2. 02Search across all or selected wikis
  3. 03Find related pages
  4. 04JSON-friendly search results
  5. 05SessionStart topic-based hints

Use cases

  1. 01Check wiki coverage before adding a page
  2. 02Find existing answers to domain questions
  3. 03Verify wiki citations before quoting

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/rohitg00/pro-workflow --skill wiki-query

After installing, type/wiki-queryin Claude Code to confirm it loaded.

Bundled filesscripts/query.js

Details

From the project README

Wiki Query

FTS5 BM25 retrieval over wiki pages indexed by wiki-builder.

When to use

  • Before writing any new wiki page → check coverage first
  • User asks a domain question that may already live in a wiki
  • "Ask the wiki: "
  • Verifying citations before quoting a claim
  • SessionStart auto-load when prompt matches a known wiki topic

Commands

node $SKILL_ROOT/scripts/query.js search "<query>" [--wiki <slug>] [--limit 10] [--json]
node $SKILL_ROOT/scripts/query.js related <slug> <rel-path> [--limit 5]
node $SKILL_ROOT/scripts/query.js show <slug> <rel-path>

search with no --wiki ranks across all wikis. related finds adjacent pages by reusing the page's title + summary as the query.

Output

JSON-friendly. Each hit:

{
  "page_id": 12,
  "wiki_slug": "agent-memory",
  "rel_path": "wiki/concepts/episodic-memory.md",
  "title": "Episodic Memory",
  "snippet": "... [time-stamped] traces, distinct from semantic ...",
  "rank": -3.21
}

Lower (more negative) rank = better BM25 match.

Citing back

Every wiki hit must be cited as:

[wiki:<slug>] <title> — `<rel_path>`

Do not paraphrase a hit without showing the source.

SessionStart integration

When pro-workflow's SessionStart hook detects wiki-relevant terms in the user prompt, it runs query.js search "<prompt>" --limit 3 and injects top hits into the session as a hint:

[wiki-query] 3 relevant pages:
- agent-memory · wiki/concepts/episodic-memory.md
- agent-memory · wiki/papers/park-2023-generative-agents.md
- ...

Helps Claude recall existing knowledge instead of redoing research.

Limits (Phase 3.3.0)

  • BM25 only. Vector search arrives 3.3.2 with sqlite-vec.
  • No re-ranking. MMR diversity arrives with the research loop in 3.3.1.
  • Snippet window is 16 tokens around match — tune via --snippet-len.

Comments

Markdown supported