ADR-0053: Autonomous Provider Semantic Capability Matching Engine v0.3.6
Status
Accepted
Context
In decentralized multi-agent swarms within the ZQK Knowledge Kernel v0.3.6 runtime, autonomous agents frequently require external capabilities (e.g. "parse pdf table", "compute diff", "verify schema"). Exact keyword matching fails when provider descriptions or tool names vary in vocabulary or framing.
To enable intelligent capability discovery and routing, the runtime requires an Autonomous Provider Semantic Capability Matching Engine. The engine indexes registered provider capabilities into a lightweight vector/semantic space, computing cosine similarity over token embeddings to find the top-K optimal providers matching an agent's intent.
Decision
- Semantic Vector Index:
- Implement
SemanticCapabilityIndexmapping provider capabilities to n-dimensional feature vectors. - Support dynamic capability registration (IndexCapability) with schema metadata, tags, and description embeddings. - Cosine Similarity Matcher:
- Provide
FindNearest(queryVector []float64, topK int, threshold float64) []MatchResultranked by descending cosine similarity. - Managed Concurrency & Zero Naked Goroutines:
- Strict adherence to
POL-CONCURRENCYusing safe synchronization and zero naked goroutines.
Consequences
- Positive:
- Resilient tool and capability routing even with non-identical phrasing.
- Sub-millisecond vector similarity evaluation in-memory.
- Negative / Trade-offs:
- Requires standardized normalized vector representation across registered providers.