Skill Details
Runtime
(claude-5-sonnet)
Example user message
[userMessage]: Architect a hybrid context retrieval pipeline for an Enterprise Legal SaaS platform indexing 500,000 regulatory contracts, compliance laws (GDPR, HIPAA), and case precedents. Queries range from exact statute citations (e.g., "Article 33(1) GDPR breach notification window") to complex causal multi-hop queries (e.g., "How do sub-processor data transfers under AWS Ireland affect HIPAA BAA obligations?"). Provide the complete 4-section retrieval architecture report.
Example agent response
=== HYBRID CONTEXT RETRIEVAL ARCHITECTURE: ENTERPRISE LEGAL SAAS ===
1. 4-LAYER QUERY ROUTING & MODALITY BLUEPRINT
• Layer 1 (Dense Semantic Vector): 3072d OpenAI text-embedding-3-large with HNSW cosine index for broad conceptual legal interpretations and synonym matching.
• Layer 2 (Lexical BM25 Sparse): Inverted index tuned for exact legal statute citations (e.g., "Article 33(1)", "45 CFR § 164.308") with 2.5x boosting on exact alphanumeric matches.
• Layer 3 (Knowledge Graph Traversal): Neo4j graph linking `Regulation` -> `Obligation` -> `Sub-processor` -> `Jurisdiction` for multi-hop cross-compliance reasoning.
• Layer 4 (Temporal Index): Chronological timeline filter prioritizing amendments and latest supervisory authority enforcement actions post-2024.
2. RECIPROCAL RANK FUSION (RRF) & RERANKING FORMULA
• Multi-Stream Scoring: RRF Score(d) = [ 0.45 / (60 + Rank_sparse) ] + [ 0.35 / (60 + Rank_dense) ] + [ 0.20 / (60 + Rank_graph) ].
• Cross-Encoder Reranking: Top-50 fused candidates routed through BGE-Reranker-Large to produce final Top-7 chunks (under 3,200 total tokens).
3. DOCUMENT INGESTION & CHUNKING STRATEGY
• Clause-Boundary Chunking: Documents segmented by legal headings and sub-clauses (500–700 tokens, 15% overlap) to prevent splitting operative clauses across chunks.
• Metadata Injection: Each chunk header prefixed with `[Doc: GDPR] [Article: 33] [Jurisdiction: EU] [Effective_Date: 2018-05-25]`.
4. PRODUCTION CONSTRAINTS & QUALITY BENCHMARKS
• Latency Target: P95 retrieval latency < 180ms across all 3 streams before LLM synthesis.
• Accuracy Benchmark: Target Hit Rate @ 5 >= 94.5% and MRR @ 10 >= 0.88 on legal benchmark test suites.
By purchasing this skill, you agree to our terms of service
CLAUDE-5-SONNET
Query routing decision trees, hybrid dense-sparse vector schemas, knowledge graph ontology maps, temporal index decay models, reciprocal rank fusion (RRF) algorithms, chunking strategy benchmarks. Ideal for AI engineers, LLM architects, enterprise RAG developers, and technical founders optimizing complex context retrieval systems.
...more
Added 3 days ago
