Hybrid Retrieval Specification
This specification defines the dual-layer strategy for navigating the vault, bridging the gap between human-curated Deterministic Links and AI-driven Semantic Discovery.
Tier 1: Deterministic Retrieval (Wikilinks)
- Mechanism: Standard
Wikilinksand MOC structures. - Precision: 100%.
- Use Case: Navigating established hierarchies (e.g.,
rust-moc->rust-ownership). - Agent Rule: Always follow explicit Wikilinks first. If a specific note is linked, assume it is the authoritative source for the context.
Tier 2: Semantic Discovery (ChromaDB)
- Mechanism: Vector similarity search via chromadb.
- Discovery: High.
- Use Case: Finding "Hidden Relationships" where explicit links do not yet exist (e.g., finding that a concept in
foundry-localrelates to a security pattern inmcp-security). - Agent Rule: Use
chroma_query_documentswhen a Wikilink traversal fails to resolve a query or when "exploration" is requested.
The Bridge: Semantic Link Recommendations
To prevent "Knowledge Islands," agents should use Tier 2 to strengthen Tier 1.
The "Discovery-Link" Workflow:
- Ingestion: After synthesizing a new note, generate a 2-sentence semantic summary.
- Query: Run
chroma_query_documentsusing that summary. - Cross-Reference: Compare the results with the current note's Wikilinks.
- Recommendation: If a result has a similarity score > 0.8 but is not linked, suggest adding a Wikilink to the "See Also" section.
Technical Implementation (Agent Instructions)
When tasked with "Researching" or "Connecting" knowledge:
- Map Traversal: Start at the relevant MOC.
- Semantic Expansion: For each key concept, query ChromaDB:
-
chroma_query_documents(query="[Concept Summary]", n_results=3)
-
- Synthesis: Combine the hard-linked facts with the semantically discovered context to provide a "Universal" answer.