citations-retrieval

Implement Anthropic's Citations API and RAG patterns for source-grounded responses.

18|2|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/markus41/claude --skill citations-retrieval
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: citations-retrieval
Source: https://github.com/markus41/claude/tree/main/.claude/skills/citations-retrieval
Command: npx skills add https://github.com/markus41/claude --skill citations-retrieval

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables AI agents to provide responses grounded in specific source documents, ensuring accuracy and preventing hallucinations by citing exact passages.

Core Features & Use Cases

  • Document Citations: Automatically attribute AI-generated text to its source documents with precise location tracking.
  • RAG Implementation: Build Retrieval-Augmented Generation systems to extend the AI's knowledge base beyond its training data.
  • Use Case: When answering a question about company policy, the AI can cite the exact section of the policy document it used, allowing users to verify the information.

Quick Start

Use the citations-retrieval skill to answer a question using the provided document and cite the sources.

Frequently Asked Questions about citations-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ground AI responses with verifiable document citations to prevent hallucinations?

To ground AI responses and prevent hallucinations, this Skill implements Anthropic's Citations API and Retrieval-Augmented Generation (RAG) patterns. It attributes generated text to specific source documents with precise location tracking, ensuring factual accuracy.

What is contextual retrieval and how does it work for source attribution?

Contextual retrieval is a technique within Retrieval-Augmented Generation (RAG) that extracts cited text passages to provide precise source attribution. It ensures AI-generated answers are directly linked to exact locations in the original source documents for verification.

How do I build a RAG system that cites exact passages from source documents?

Building a RAG system with exact passage citations is achieved by implementing the Citations API patterns provided. This Skill facilitates extraction of cited text and precise location tracking, extending the AI's knowledge base beyond its training data.

Can I use this approach to answer questions about company policy and cite the exact section used?

Yes, you can answer questions about company policy and cite the exact section used. The Skill attributes AI-generated text to specific source documents with precise location tracking, allowing users to verify the information immediately.

Does this RAG implementation support multi-format citation for different document types?

Yes, this RAG implementation supports multi-format citation across different document types. It facilitates precise source attribution and extraction of cited text, enabling the construction of verifiable, trustworthy AI systems using diverse source materials.

When should I use retrieval-augmented generation instead of relying on the AI's training data?

You should use retrieval-augmented generation when answering queries about specific or updated information like company policies. RAG extends the AI's knowledge base beyond its training data, grounding responses in source documents to prevent hallucinations.