Permission-Safe Unified Search
Combines keyword, vector, and graph search while strictly enforcing who is allowed to see what.
A user whose access was revoked 5 minutes ago still gets sensitive docs served from an AI cache.
Every single search hit is permission-checked, and scope.revoked wipes stale cached results immediately.
What It Does (In Plain English)
Retrieval is the single search coordinator. It fans queries out to any loaded search kits (search-keyword, search-vector, search-graph), blends their hits using Reciprocal Rank Fusion (RRF), caches results safely, and instantly clears caches the moment a user’s permission is revoked.
Real-World Example
- 1Agent asks Retrieval: "What is the refund cap for VIP accounts?"
- 2Retrieval runs keyword + vector search filtered strictly to the caller’s active scopes.
- 3Top blended hits are injected cleanly into the agent’s prompt context.
When Should You Turn It On?
Add at Level 1 (review) alongside ingestion and at least one search kit (search-keyword or search-vector).
Safety level note: Level 1 · Review — Read-only. Can inspect and answer, never changes outside systems.
How to Add It (workspace.yaml)
kits:
- "@neusym/kit-retrieval@0.1.0"
- "@neusym/kit-search-keyword@0.1.0"
kitConfigs:
retrieval:
fusionStrategy: rrf
maxContextHits: 6Kits It Works With
Technical Details & Configuration Options (7 settings)
| Package | @neusym/kit-retrieval |
|---|---|
| Provides Ports | retrieval@1 |
| Requires Ports | scopes@1search-index@1 |
| Optional Ports | None |
| Publishes Events | None |
| Owned DB Collections | retrieval_cache |
Configuration Options (kitConfigs.retrieval)
| Setting | Type | Default | Description |
|---|---|---|---|
cacheEnabled | boolean | true | — |
maxContextHits | integer | 5 | — |
includeCandidatesInContext | boolean | false | — |
cacheTtlSeconds | integer | 300 | — |
maxCacheEntries | integer | 500 | — |
fusionStrategy | string | "rrf" | How hits from multiple retrievers are combined: 'rrf' (Reciprocal Rank Fusion) when 2+ retrievers contribute, or 'max' (highest raw score). |
rrfK | integer | 60 | Reciprocal Rank Fusion constant k (score contribution = 1 / (k + rank)). |