Add an off-by-default glossary match to `knowledge.search`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- clickhouse, python
- Domain
- backend-api-design, search
Research direction
Start with server/memory/app/search/term_leg.py, server/memory/domain/definitions.py, and server/memory/domain/definition_check.py to understand governed name matching, then inspect the lexical leg in server/knowledge/api/models_knowledge.py. The issue defines five acceptance cases, but leaves a broad design and rollout evidence open. Done means the optional behavior meets those cases, preserves the context budget, and has the paired comparison and latency evidence described.
Written by the indexing model from the issue text.
Description
Company
ClickHouse
Component
Knowledge (documents)
Use case
In #1457 a team asks for the rule for an active account using an internal abbreviation. The authoritative definition uses the full term, and another team uses the same abbreviation for a different metric. That issue specifies the comparison against hybrid document search and its fixture, and leaves the mechanism open.
A comparison needs a defined treatment. memory.search already serves a governed definition when the query names its term or an alias. knowledge.search has no such step, so a query that uses only the abbreviation finds a passage only where the source text happens to contain it.
Describe the solution you'd like
An option on knowledge.search, off by default, as the treatment #1457 measures. This is a proposal; nothing is implemented or measured.
- Match. The query runs through the exact name matching
memory.searchhas for governed definitions. It adds no model call and no table. - Expand. A named definition adds lexical candidates for its other names. Passages that enter only this way take at most a fixed share of
top_kand never displace a direct match. The context budget is unchanged. - Ambiguity. When more than one scope, within the caller's access and the reply's audience, defines the matched alias differently, the reply returns the alternatives and expands nothing. The request names the scopes compared, because the existing match reads the addressed namespace only.
- Receipt. The reply carries the definition's key, version and content hash, and marks each passage that entered through an added name.
- Nothing stored. No retrieval hint is kept, so a demotion, a revoked grant or an erasure needs no cleanup path: each search reads the definitions as they are then. The existing match reads without sequential consistency, so a promotion on another replica a moment earlier can miss one search.
- The definition is navigation evidence. An answer still needs a current, authorized source passage, as #1457 requires.
What Loom has that this builds on:
server/memory/app/search/term_leg.pymatches a query against governed names within a work budget.server/memory/domain/definitions.pyfolds and compares names;server/memory/domain/definition_check.pydecides which definitions are governed.- The lexical leg of
knowledge.search(server/knowledge/api/models_knowledge.py) takes the added candidates.
Acceptance fixture, the four cases #1457 names plus one:
- An alias absent from the source text returns the required passage with the option on and not with it off.
- An alias two scopes define differently returns both alternatives and expands nothing.
- After a definition is promoted again with a changed alias list, a search that reads the new promotion uses the new revision only.
- A query with no glossary term returns the baseline's hit list, unchanged.
- After a demotion or a revoked grant no passage is marked.
Evidence still needed before rollout:
- The comparison #1457 specifies, on the same fixture and context budget, as a paired result with an interval. Proposed rule: widen exposure only if the lower bound of the recall gain is above zero and wrong-source matches do not rise.
- Wrong-source matches from a short alias that is also a common word.
- p95 latency with the added candidates.
- Whether
memory_shared_definitions_maxcaps a glossary of the size a team maintains.
Describe alternatives you've considered
- Put the glossary in the reader's prompt. That spends the context budget on every query and ignores scope.
- Ask a model which glossary entries the query uses. That adds a model call to each search, and #1457 asks for exact matches.
- Keep a separate glossary table for documents. That is a second copy of the governed definitions with its own review and erasure path.
Where the need comes from
An AI tool suggested this feature
Additional context
Found by source review; no search was run and no comparison was made.
Related: Proposed as part of #1457. Roadmap: #1232.
- Dominant language
- Python
- Stars
- 221
- Forks
- 35
- Avg merge
- 14h 21m
- Merged PRs (30d)
- 873
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ClickHouse/loom
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
ClickHouse/loom#2014 ·
Maintainers usually reply within 1 day
-
Options of loom period-digest, reextract, reconcile-status and demote-activity-narration print no help textPossibly taken @VanshajPoonia claimed this today. Openbug good first issue help wanted up-for-grabs
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/loom#1988 · 1 comment ·
Maintainers usually reply within 1 day
-
A compiler-tier checkout fetch from a shallow mirror never records its headPossibly taken @KaloyanNaumov claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
ClickHouse/loom#2016 ·
Maintainers usually reply within 1 day
-
Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limitPossibly taken @KaloyanNaumov claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
ClickHouse/loom#2012 ·
Maintainers usually reply within 1 day
-
loom participant retire cannot retire an orphaned participant after container replacement or host rebootPossibly taken @l0K1ngg claimed this today. Openbug help wanted up-for-grabs
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ClickHouse/loom#2007 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
DMB documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ubuntu/ubuntu-project-docs#921 ·
Maintainers usually reply within 1 day
-
⏳ Pending feedback 🐛 Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
jumpserver/jumpserver#18282 · 1 comment ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
future-agi/future-agi#5274 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GenericMappingTools/pygmt#5014 · 1 comment ·
Maintainers usually reply within 1 day