dspy-citations

Installation
SKILL.md

Add Structured Citations to DSPy Outputs

Guide the user through adding structured citations to DSPy outputs so AI answers can be traced back to specific source passages.

What are DSPy Citations

dspy.experimental.Citations provides structured source attribution for LM outputs. Instead of inline quotes, you get machine-readable citation objects that identify exactly which passage from which document supports each claim. Works natively with Anthropic's Citations API and falls back to prompt-based extraction for other providers.

When to use Citations

Use Citations when... Use something else when...
You need to verify which document supports a claim Simple RAG where inline quotes are enough
Legal/compliance requires source traceability Output does not reference source material
Users need clickable references back to source docs You only have one source document
You want machine-readable citation metadata Human-readable quotes in text are sufficient
Building fact-checking or grounding verification The task is creative generation (no sources)

Step 1: Set up Documents

Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
2
GitHub Stars
5
First Seen
6 days ago
Security Audits