/verify citations
We believe AI citations should follow show, don't tell; they should prove their citations so you don't have to blindly chase them down yourself. DeepCitation replaces 'trust me' citations with a deterministic verification layer.
DeepCitation turns model citations into deterministic, inspectable proof.
The fastest way to use DeepCitation is to install the /verify Agent Skill and ask Claude to verify your AI claims.
npx skills add DeepCitation/skills
Or
- Download
verify.zip - Go to claude.ai/customize/skills
- Upload
verify.zip
Then ask Claude to /verify.
Install the package:
npm install deepcitation # or bun add / yarn add / pnpm addimport { DeepCitation, extractVisibleText, wrapCitationPrompt } from "deepcitation"; const deepCitation = new DeepCitation({ apiKey: process.env.DEEPCITATION_API_KEY, }); // 1) Process documents const { deepTextPages } = await deepCitation.prepareAttachments([ { file: pdfBuffer, filename: "report.pdf" }, ]); // 2) Wrap prompts before calling your model const { enhancedSystemPrompt, enhancedUserPrompt } = wrapCitationPrompt({ systemPrompt: "You are a helpful assistant...", userPrompt: "Summarize the key findings", deepTextPages, }); const response = await yourLLM.chat({ system: enhancedSystemPrompt, user: enhancedUserPrompt, }); // 3) Verify citations const { verifications } = await deepCitation.verify({ llmOutput: response.content }); // IMPORTANT: 'verifications' is a Record<string, Verification> (object map, not an array). // Use Object.keys(verifications).length to count results, not .length. // 4) Strip citation metadata before showing model text to users const visibleText = extractVisibleText(response.content);
Complete integration guide: See INTEGRATION.md for golden rules, 5 ready-to-use recipes, and common mistakes to avoid. Read Error Handling for production error patterns.
A set of high-quality React components to help you build production-ready attribution systems. Skip the complexity of reading multiple file formats, rendering multiple formats, coordinate mapping, and visual proof generation.
Works with any LLM -- OpenAI, Anthropic, Google, AI SDK, local models, or any leading model.
| OpenAI ✔ | Anthropic ✔ | Gemini ✔ | AI SDK ✔ |
Clone a working example and have citations running in under 2 minutes:
# Quickest start — Next.js chat with Vercel AI SDK git clone https://github.com/DeepCitation/deepcitation.git cd deepcitation/examples/nextjs-ai-sdk cp .env.example .env.local # add your API keys npm install && npm run dev
For RAG pipelines with LangChain.js and in-memory vector search:
cd deepcitation/examples/langchain-rag-chat cp .env.example .env.local # add DEEPCITATION_API_KEY + OPENAI_API_KEY npm install && npm run dev
- Basic Verification
- LangChain RAG Chat — Live Demo
- Mastra RAG Chat — Live Demo
- Next.js AI SDK Chat App — Live Demo
- AG-UI Chat — Live Demo
- URL Citations
# Run unit tests npm test # Run Playwright component tests npm run test:ct # Run visual snapshot tests npm run test:ct -- --grep "visual snapshot"
- Full Documentation
- Examples -- Basic verification, LangChain RAG chat, Next.js chat app, URL citations
- Integration Guide -- For AI coding assistants
- Error Handling Guide -- Production error patterns
- Styling Guide -- CSS custom properties and theming
See CONTRIBUTING.
Hosted API/service is subject to Terms and Privacy Policy. Patent pending. "DeepCitation" is a trademark.