deepcitation
Zero-friction fact-checking for AI agents. Verify LLM output against source documents with visual proof.
SKILL.md
| Name | deepcitation |
| Description | Zero-friction fact-checking for AI agents. Verify LLM output against source documents with visual proof. |

Documentation · Get API Key · Examples · Agent Integration · Terms · Privacy
</div>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.
Install
With bun
bun add deepcitation
With npm
npm install deepcitation
With yarn
yarn add deepcitation
With pnpm
pnpm add deepcitation
Quick Start
import { DeepCitation, extractVisibleText, wrapCitationPrompt } from "deepcitation";
const deepCitation = new DeepCitation({
apiKey: process.env.DEEPCITATION_API_KEY,
});
// 1) Process documents
const { deepTextPromptPortion } = 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",
deepTextPromptPortion,
});
const response = await yourLLM.chat({
system: enhancedSystemPrompt,
user: enhancedUserPrompt,
});
// 3) Verify citations
const { verifications } = await deepCitation.verify({ llmOutput: response.content });
// 4) Strip citation metadata before showing model text to users
const visibleText = extractVisibleText(response.content);
Heads up:
verificationsis aRecord<string, Verification>object, not an array. UseObject.keys(verifications).lengthto count results, not.length.
Components
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.
Support
Works with any LLM -- OpenAI, Anthropic, Google, AI SDK, local models, or any leading model.
| <img src="https://deepcitation.com/logos/openai.svg" width="32" height="32" alt="OpenAI logo"> | <img src="https://deepcitation.com/logos/anthropic.svg" width="32" height="32" alt="Anthropic logo"> | <img src="https://deepcitation.com/logos/google.svg" width="32" height="32" alt="Google Gemini logo"> | <img src="https://deepcitation.com/logos/vercel.svg" width="32" height="32" alt="Vercel AI SDK logo"> |
|---|---|---|---|
| OpenAI ✔ | Anthropic ✔ | Gemini ✔ | AI SDK ✔ |
Try it now
Clone a working example and have citations running in under 2 minutes:
# Next.js chat app with streaming citations
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
Examples
Development
Running Tests
# Run unit tests
npm test
# Run Playwright component tests
npm run test:ct
# Run visual snapshot tests
npm run test:ct -- --grep "visual snapshot"
Go deeper
- Full Documentation
- Examples -- Basic verification, 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
Community
Contributing
See CONTRIBUTING.
License
Hosted API/service is subject to Terms and Privacy Policy. Patent pending. "DeepCitation" is a trademark.