lexical-kb

Solid

Query a portable, embedding-free lexical knowledgebase bundled as a `.skill`. Use when the user references this KB or asks a question whose answer is in its corpus ({{SOURCE}}). Retrieval is BM25 over a precomputed inverted index — there is no embedding model, so YOU expand the query into search terms before searching. Bundle holds index.json + chunks.jsonl + search.js + search.py; pure stdlib, no install, no network.

AI & Automation 134 stars 7 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
71
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# lexical-kb — query an embedding-free knowledgebase This KB has **no semantic search and no embedding model**. Retrieval is pure lexical BM25 over a precomputed inverted index. That design moves one job onto you: bridging the gap between how the user phrases a question and how the corpus phrases the answer. An embedding model would do this with a vector; here **you are the semantic layer** — you expand the query into terms before searching. Corpus: {{SOURCE}} ({{CHUNK_COUNT}} chunks). ## The retrieval protocol — follow every step A raw user question fed straight to BM25 underperforms: it matches only the exact words the user happened to use. The expansion step is what makes lexical retrieval competitive with embeddings. Do not skip it. 1. **Read the question. Extract `core` terms** — the essential nouns, proper nouns, and identifiers the answer MUST contain. These carry full weight. 2. **Generate `expand` terms** — synonyms, morphological variants (plural/verb forms), acronym expansions and contractions, and adjacent concepts. These carry lower weight. This is the work the missing embedding model would have done. Be generous: 5–15 expansion terms is normal. 3. **Run the searcher.** It ships in this bundle in two equivalent runtimes — `node search.js` or `python3 search.py`, identical flags and identical results. Use whichever your environment has. Pass the user's original question via `--query` AND your term groups — expansion is **additive**, it ...

Details

Author
oaustegard
Repository
oaustegard/claude-skills
Created
9 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

creating-kb

Builds a portable, embedding-free knowledgebase from a set of files and delivers it as a self-contained `.skill` bundle (BM25 index + bundled searcher + query protocol). Use when a user wants to turn uploaded files, a folder, or a corpus into a searchable knowledgebase they can hand to any agent — phrased as "make a knowledgebase", "build a KB skill", "package these docs for retrieval", "create a searchable bundle", or references to a `.skill` KB. The output runs anywhere with Node or Python — no model, no install, no network. Distinct from `bm25` (ephemeral in-session search) and `building-github-index` (markdown project-knowledge index).

134 Updated yesterday
oaustegard
AI & Automation Listed

recall-knowledge

Recall knowledge base entries by meaning, not just keywords — hybrid search (lexical ripgrep + local vector embeddings + see-link graph) over `.claude/knowledge/entries/`. Use when looking for prior knowledge, decisions, pitfalls, or context that may be worded differently from the query (e.g. a Japanese query vs English identifiers, or synonyms the entry does not literally contain). Falls back to ripgrep-only when the vector index or its dependencies are absent. On-demand only — it is NOT wired into the per-prompt hook (that stays ripgrep for instant, model-free injection).

3 Updated yesterday
LevNas
AI & Automation Listed

knowledge-retrieval

Cross-store hybrid lexical retrieval, bidirectional [[wikilink]] backlinks, and rename-tracking over the .agent/ knowledge bases. Zero dependency. Use to find relevant knowledge across memory/experiences/references/decisions, discover who links to a note, or safely rewrite links after renaming a note.

1 Updated today
Kucell