Capability Discovery Guide
Replace static tool dumps with per-turn semantic retrieval — ~90% token reduction while improving accuracy.
Table of Contents
- Overview
- Three-Tier Context Model
- CapabilityDescriptor
- CapabilityGraph Relationships
- CAPABILITY.yaml Format
- Agent Self-Discovery via Meta-Tool
- Integration with PromptBuilder
- Configuration
Overview
At scale (20+ tools, 40 skills, 20 channels), dumping every tool schema into the system prompt creates ~20,000 tokens of static context per turn — most of it irrelevant to the current task. This is context rot: degraded output quality as irrelevant context accumulates.
The Capability Discovery Engine solves this with a three-tier model:
User message
↓
CapabilityIndex.search(userMessage) // semantic vector search
↓
CapabilityGraph.rerank(results) // boost related capabilities via graph
↓
CapabilityContextAssembler.assemble(reranked) // token-budgeted tier assembly
↓
CapabilityDiscoveryResult → system prompt // ~1,850 tokens total
Token budget comparison:
| Approach | Tokens per turn |
|---|---|
| Static dump (20 tools + 40 skills + 20 channels) | ~20,000 |
| Discovery Engine (Tier 0 + 1 + 2) | ~1,850 |
| Reduction | ~90% |