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 150 stars 6 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
73
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
11 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category