expand-rag-glossary

Adds multilingual query-expansion entries to YAML glossaries for RAG retrieval.

Updated Nov 19, 2020
One-click install
npx skills add https://github.com/kwojtasinski-repo/ECommerceApp --skill expand-rag-glossary-kwojtasinski-repo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expand-rag-glossary
Source: https://github.com/kwojtasinski-repo/ECommerceApp/tree/main/.github/skills/expand-rag-glossary
Command: npx skills add https://github.com/kwojtasinski-repo/ECommerceApp --skill expand-rag-glossary-kwojtasinski-repo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyyaml.

What problem does it solve? Polish or German search queries fail to retrieve the correct English documentation in a RAG system even when the equivalent English query works, because the multilingual query-expansion glossary lacks entries for those foreign-language terms. ## Core Features & Use Cases - Diagnose language gaps: Distinguish a true language gap from indexing, scoring, or weighting problems by testing the English query first. - Dual-file glossary updates: Add new entries with English anchor terms and PL/DE patterns to both the Python (tools/rag/multilingual-glossary.yaml) and .NET (tools/rag-dotnet/multilingual-glossary.yaml) glossary copies. - Query-time validation: Test expansion via a Python REPL smoke test, a live MCP query_docs call, and the full eval benchmark — no re-indexing required. - Use Case: A German query like "Entitäts-Bezeichner TypedId Domänenmuster" returns wrong documents; add a glossary entry mapping bezeichner/kennung/entitäts to the English anchor "TypedId entity identifier typed domain primitive" and confirm the target doc ranks #1. ## Quick Start Ask the assistant to add a glossary entry so that the failing Polish or German query retrieves the correct English document, providing the failing query and the target document.

Frequently Asked Questions about expand-rag-glossary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix RAG queries in Polish or German that return wrong documents?

First confirm the English equivalent query returns the right document, proving it is a language gap. Then add a glossary entry mapping the foreign words to English anchor terms in both multilingual-glossary.yaml files; expansion happens at query time with no re-indexing.

How does multilingual query expansion work in a RAG system?

Before embedding, foreign-language words are detected via word-boundary regex and their English synonyms are appended three times so English terms dominate mean pooling at roughly 60-87% weight. This steers retrieval toward English documentation without re-indexing.

Do I need to re-index documents after updating the glossary?

No re-indexing is required because glossary expansion happens entirely at query time. After editing both YAML files, verify with a Python smoke test of _expand_query and a live MCP query_docs call.

Why does my English RAG query also fail to find the document?

If the English query fails too, the problem is not a language gap — the document may not be indexed, or there is a score threshold or weighting issue. Use a RAG diagnostic skill instead of adding glossary entries.

What words should not be added to the query-expansion glossary?

Never add English words, single or two-letter words, or highly generic terms like 'und' or 'jest' that appear in every query. Also avoid creating duplicate entries for an existing concept — extend the existing entry's patterns list instead.