Repository navigation
Add web search and compaction feature - #13
Merged
Merged
Conversation
…alues The cache was a local of the boot, reachable only by the startup steps it was passed to. A host that wants the values a vocabulary slot holds — to gate a knowledge search on the product names the base publishes, say — had no way to reach the instance the refresh services write into.
…ing scoped by Two rules assumed a vocabulary: slot exists only to narrow a search, so the domain and the scope had to name the same facets. Check 2 refused a vocabulary: slot that scope.fromState did not name. The gate and the linker are useful on their own — they hold the extractor to values the provider published — and a host may read the domain for itself. Scoping is what fromState declares, and it is a separate decision. The two vocabulary reads then stripped the wildcard sentinel only for facets wildcard.facets names. The sentinel is stored in the collection, so a read of any facet path returns it, and it normalises to nothing — which refused the document one step later. wildcard.facets answers which scope conditions a deployment widens, so it was the wrong question to ask of a read.
…to find out Search is the one thing every knowledge store owes. Reading a facet vocabulary is a capability only some serve, and the two callers that need it found out by casting — which answers false on a wrapper, because a wrapper does not implement what it wraps. A cache or a log in front of a store would have cost the document its vocabulary, silently. IKnowledgeRetrievalPort.GetService is a default interface method, so no existing store changes: one that wraps nothing is already whatever it implements. A store that wraps another overrides it and forwards what it cannot answer. This is the shape Microsoft.Extensions.AI uses on IChatClient, IEmbeddingGenerator and six more, each with a Delegating base that forwards it, so a consumer already knows it from providers.embeddings.
A model year is a keyword, not a meaning. Asking a ranked search for the cards of the LCR 2023 returns the 2026 ones first, because two adjacent years read as near-identical to an embedding. A filtered scroll cannot make that mistake. IKnowledgeFacetReadPort is a capability, not a widening of IKnowledgeRetrievalPort: a store that cannot filter simply does not implement it, and a caller asks through GetService. The value is matched exactly and never widened by scope.wildcard — a caller asking for one model year wants that year, not that year plus every card shared across all of them. QdrantKnowledgeStore reached 407 lines with the new method, so the six members that decide what a KnowledgeScope means against a payload moved to QdrantScopeMatcher. They were one responsibility already, read two ways that have to agree: Qdrant applies the filter to a search, and the same rules are applied in process to a card fetched by a see_also link, which never passes that filter. The store is now 346.
A consumer resolves the one port and asks it for the capability it needs. Each capability is deliberately not registered beside it: that would hand out a second service for the same store, and a store serving none would have to be registered as null anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.