explainable-retrieval
Skill8 starsChanged 7 months agoMITView on GitHub
Provide traceability, source attribution, and explainable results for RAG systems.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rag-skillsSkill
- choosing-a-chunking-frameworkSkill
- contextual-chunk-headersSkill
- hierarchical-chunkingSkill
- semantic-chunkingSkill
- chunkingSkill
- sliding-window-chunkingSkill
- rag-for-code-documentationSkill
- rag-for-multimodal-contentSkill
- data-type-handlingSkill
- index-versioning-and-reindexingSkill
- production-rag-deploymentSkill
- deploymentSkill
- generation-evaluation-metricsSkill
- rag-evaluation-frameworksSkill
- retrieval-evaluation-metricsSkill
- evaluation-metricsSkill
- optimize-retrieval-latencySkill
- performance-optimizationSkill
- agentic-rag-routingSkill
- multi-agent-rag-orchestrationSkill
- rag-agentsSkill
- adaptive-retrievalSkill
- context-enrichment-windowSkill
- crag-corrective-ragSkill
- graph-ragSkill
- hybrid-search-bm25-denseSkill
- hyde-hypothetical-document-embeddingsSkill
- hype-hypothetical-prompt-embeddingsSkill
- multi-pass-retrieval-with-rerankingSkill
- query-transformation-strategiesSkill
- raptor-hierarchical-retrievalSkill
- self-ragSkill
- retrieval-strategiesSkill
- choosing-vector-db-by-datatypeSkill
- qdrant-for-production-ragSkill
- qdrant-setup-ragSkill
- vector-databasesSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Create a structured response containing summary, individual claims with citations, confidence scores, and source information.
- Distinctive: line 85
When trust and accountability are critical requirements
- Distinctive: line 87
When users need to understand response provenance
- Distinctive: line 92
When using closed-source content where attribution is restricted
- Distinctive: line 94
When added complexity isn't justified by use case requirements
- Distinctive: line 107
Response Quality: No degradation in answer accuracy due to citation requirements
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Explainable retrieval adds citations, source attribution, and traceability to RAG systems. Users can see which documents support each claim, verify information sources, and understand how responses were generated - critical for applications requiring trust and accountability.
Problem Statement
Traditional RAG systems lack transparency:
- Black Box Responses: Users can't verify information sources
- No Traceability: Impossible to trace claims to source documents
- Trust Issues: Unclear whether responses are hallucinated or grounded
- No Attribution: Credit not given to original content creators
- Debugging Difficulty: Hard to diagnose why wrong answers were generated
Key Concepts
- Citation Generation: Linking response claims to source documents
- Source Attribution: Identifying which documents contributed to each claim
- Confidence Scoring: Assessing how well claims are supported by context
- Traceability: Maintaining links from responses to original sources
- Explainable Retrieval: Providing reasoning for retrieval decisions
Implementation Guide
Step 1: Implement Source Tracking
Maintain links from retrieved content to source documents throughout the pipeline.
Why: Without source tracking, it's impossible to provide accurate citations. Every piece of retrieved content must maintain its provenance.
Store source identifiers, titles, URLs, and positions as metadata for each retrieved document.
Step 2: Implement Claim-Supported Generation
Generate responses with explicit support for each claim.
Why: Claim-supported generation produces responses that are structured for citation, with each claim clearly linked to supporting evidence.
Direct the LLM to generate responses with inline citation markers (e.g., [Source 1]) for each claim.
Step 3: Parse and Extract Citations
Extract citation information from generated responses.
Why: Parsed citations enable structured output that can be displayed as clickable links, verified against sources, and used for filtering.
Parse the generated response to extract claims and their associated source identifiers.
Step 4: Implement Confidence Scoring
Assess how well each claim is supported by its cited sources.
Why: Confidence scoring helps users understand which claims are well-supported and which might be weakly supported or potentially hallucinated.
For each claim-source pair, have the LLM rate the strength of support on a numeric scale.
Step 5: Build Explainable Response Structure
Combine claims, citations, and confidence scores into a structured response.
Why: A structured response format enables clean display of information with clear attribution, making it easy for users to verify and understand.
Create a structured response containing summary, individual claims with citations, confidence scores, and source information.
Step 6: Implement Citation Display
Format citations for user-facing display.
Why: Clear citation display makes it easy for users to click through to sources, verify information, and understand response provenance.
Format the structured response with clickable links, visual indicators of confidence, and clear association between claims and sources.
Step 7: Build Complete Explainable Retrieval Pipeline
Combine all components into a cohesive system.
Why: A complete pipeline ensures that every aspect of the response - from claims to citations to confidence scores - is properly tracked and displayed.
For implementation patterns, see LlamaIndex node postprocessors, the Attributed Quote Generation paper, and the LangChain RAG guide.
When to Use This Skill
- Building RAG systems for research, legal, or medical applications
- When trust and accountability are critical requirements
- For applications where source verification is necessary
- When users need to understand response provenance
- For compliance with regulations requiring transparency
When NOT to Use This Skill
- For casual applications where speed matters more than explainability
- When using closed-source content where attribution is restricted
- For systems with very short, simple responses
- When added complexity isn't justified by use case requirements
- For real-time systems where display formatting isn't feasible
Related Skills
- Self-RAG - Support assessment and reflection
- Context Enrichment Window - Better source context
- Graph RAG - Relationship-based attribution
Metrics & Success Criteria
- Citation Accuracy: High precision in linking claims to correct sources
- Support Quality: Confidence scores correlate with actual claim accuracy
- User Trust: Users report higher confidence in responses
- Verification Rate: Users frequently verify cited sources
- Response Quality: No degradation in answer accuracy due to citation requirements
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

