{"id":45729535,"url":"https://github.com/deepcitation/deepcitation","last_synced_at":"2026-04-12T04:04:32.816Z","repository":{"id":331566071,"uuid":"1126533443","full_name":"DeepCitation/deepcitation","owner":"DeepCitation","description":"The citation verification API.","archived":false,"fork":false,"pushed_at":"2026-04-09T23:59:53.000Z","size":76594,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T00:27:51.570Z","etag":null,"topics":["ai","citation","citations","fact-checking","hallucination-mitigation","hallucination-prevention","ocr","rag","react","source-verification","typescript","verifications"],"latest_commit_sha":null,"homepage":"https://deepcitation.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeepCitation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-02T05:20:13.000Z","updated_at":"2026-04-07T14:09:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/DeepCitation/deepcitation","commit_stats":null,"previous_names":["deepcitation/deepcitation-js","deepcitation/deepcitation"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/DeepCitation/deepcitation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepCitation%2Fdeepcitation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepCitation%2Fdeepcitation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepCitation%2Fdeepcitation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepCitation%2Fdeepcitation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepCitation","download_url":"https://codeload.github.com/DeepCitation/deepcitation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepCitation%2Fdeepcitation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31703503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","citation","citations","fact-checking","hallucination-mitigation","hallucination-prevention","ocr","rag","react","source-verification","typescript","verifications"],"created_at":"2026-02-25T09:06:48.086Z","updated_at":"2026-04-12T04:04:32.806Z","avatar_url":"https://github.com/DeepCitation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![DeepCitation cover](https://deepcitation.com/og-images/deepcitation-og-1200x630.png?v=2)\n\n\n\u003cdiv align=\"center\"\u003e\u003cstrong\u003eDeepCitation\u003c/strong\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\nBuild Trusted AI Products. \u003cbr /\u003e\nShow proof for every AI citation.\n\u003c/div\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\n[![CI](https://img.shields.io/github/actions/workflow/status/DeepCitation/deepcitation/ci.yml?style=flat-square\u0026label=CI)](https://github.com/DeepCitation/deepcitation/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-005595?style=flat-square)](https://opensource.org/licenses/MIT)\n[![Zero Dependencies](https://img.shields.io/badge/Zero%20Dependencies-trusted-005595?style=flat-square)](https://www.npmjs.com/package/deepcitation)\n[![~15KB](https://img.shields.io/badge/gzip-~15KB-005595?style=flat-square)](https://bundlephobia.com/package/deepcitation)\n\n\u003c/div\u003e\n\n\n\u003cdiv align=\"center\"\u003e\n\n[Documentation](https://docs.deepcitation.com) · [Get API Key](https://deepcitation.com/signup) · [Examples](./examples) · [Integration Guide](./INTEGRATION.md) · [Error Handling](./docs/error-handling.md) · [Terms](https://deepcitation.com/legal/terms-of-service) · [Privacy](https://deepcitation.com/legal/privacy)\n\n\u003c/div\u003e\n\n![DeepCitation demo](https://raw.githubusercontent.com/DeepCitation/deepcitation/main/examples/assets/deepcitation-demo.avif)\n\nWe 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.\n\nDeepCitation turns model citations into deterministic, inspectable proof.\n\n## Install\n\n```sh\nnpm install deepcitation  # or bun add / yarn add / pnpm add\n```\n\n## Quick Start\n\n```typescript\nimport { DeepCitation, extractVisibleText, wrapCitationPrompt } from \"deepcitation\";\n\nconst deepCitation = new DeepCitation({\n  apiKey: process.env.DEEPCITATION_API_KEY,\n});\n\n// 1) Process documents \nconst { deepTextPages } = await deepCitation.prepareAttachments([\n  { file: pdfBuffer, filename: \"report.pdf\" },\n]);\n\n// 2) Wrap prompts before calling your model\nconst { enhancedSystemPrompt, enhancedUserPrompt } = wrapCitationPrompt({\n  systemPrompt: \"You are a helpful assistant...\",\n  userPrompt: \"Summarize the key findings\",\n  deepTextPages,\n});\n\nconst response = await yourLLM.chat({\n  system: enhancedSystemPrompt,\n  user: enhancedUserPrompt,\n});\n\n// 3) Verify citations\nconst { verifications } = await deepCitation.verify({ llmOutput: response.content });\n// IMPORTANT: 'verifications' is a Record\u003cstring, Verification\u003e (object map, not an array).\n// Use Object.keys(verifications).length to count results, not .length.\n\n// 4) Strip citation metadata before showing model text to users\nconst visibleText = extractVisibleText(response.content);\n```\n\n\u003e **Complete integration guide**: See **[INTEGRATION.md](./INTEGRATION.md)** for golden rules, 5 ready-to-use recipes, and common mistakes to avoid. Read **[Error Handling](./docs/error-handling.md)** for production error patterns.\n\n## Components\n\nA 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.\n\n- [Citation](https://github.com/DeepCitation/deepcitation/tree/main/src/react/Citation.tsx)\n- [CitationDrawer](https://github.com/DeepCitation/deepcitation/tree/main/src/react/CitationDrawer.tsx)\n\n\n## Support\n\n**Works with any LLM** -- OpenAI, Anthropic, Google, AI SDK, local models, or any leading model.\n\n| \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://deepcitation.com/logos/color/openai.svg\"\u003e\u003cimg src=\"https://deepcitation.com/logos/openai.svg\" width=\"32\" height=\"32\" alt=\"OpenAI logo\"\u003e\u003c/picture\u003e | \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://deepcitation.com/logos/color/anthropic.svg\"\u003e\u003cimg src=\"https://deepcitation.com/logos/anthropic.svg\" width=\"32\" height=\"32\" alt=\"Anthropic logo\"\u003e\u003c/picture\u003e | \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://deepcitation.com/logos/color/google.svg\"\u003e\u003cimg src=\"https://deepcitation.com/logos/google.svg\" width=\"32\" height=\"32\" alt=\"Google Gemini logo\"\u003e\u003c/picture\u003e | \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/DeepCitation/deepcitation/main/docs/assets/vercel-white.svg\"\u003e\u003cimg src=\"https://deepcitation.com/logos/vercel.svg\" width=\"32\" height=\"32\" alt=\"Vercel AI SDK logo\"\u003e\u003c/picture\u003e |\n| --- | --- | --- | --- |\n| OpenAI ✔ | Anthropic ✔ | Gemini ✔ | AI SDK ✔ |\n\n## Try it now\n\nClone a working example and have citations running in under 2 minutes:\n\n```bash\n# Quickest start — Next.js chat with Vercel AI SDK\ngit clone https://github.com/DeepCitation/deepcitation.git\ncd deepcitation/examples/nextjs-ai-sdk\ncp .env.example .env.local  # add your API keys\nnpm install \u0026\u0026 npm run dev\n```\n\nFor RAG pipelines with LangChain.js and in-memory vector search:\n\n```bash\ncd deepcitation/examples/langchain-rag-chat\ncp .env.example .env.local  # add DEEPCITATION_API_KEY + OPENAI_API_KEY\nnpm install \u0026\u0026 npm run dev\n```\n\n## Examples\n\n- [Basic Verification](./examples/basic-verification)\n- [LangChain RAG Chat](./examples/langchain-rag-chat) — [Live Demo](https://langchain-rag-chat-deepcitation.vercel.app/)\n- [Mastra RAG Chat](./examples/mastra-rag-chat) — [Live Demo](https://mastra-rag-deepcitation.vercel.app/)\n- [Next.js AI SDK Chat App](./examples/nextjs-ai-sdk) — [Live Demo](https://nextjs-ai-sdk-deepcitation.vercel.app/)\n- [AG-UI Chat](./examples/agui-chat) — [Live Demo](https://agui-chat-deepcitation.vercel.app/)\n- [URL Citations](./examples/url-example)\n\n\n## Agent Skills\n\nVerify citations directly from your AI coding agent with the `/verify` skill — no app code needed. Works with Claude Code, Cursor, Windsurf, and other agents that support skills.\n\nInstall from [**DeepCitation/skills**](https://github.com/DeepCitation/skills).\n\n## Development\n\n### Running Tests\n\n```bash\n# Run unit tests\nnpm test\n\n# Run Playwright component tests\nnpm run test:ct\n\n# Run visual snapshot tests\nnpm run test:ct -- --grep \"visual snapshot\"\n```\n\n## Go deeper\n\n- [Full Documentation](https://docs.deepcitation.com)\n- [Examples](./examples) -- Basic verification, LangChain RAG chat, Next.js chat app, URL citations\n- [Integration Guide](./INTEGRATION.md) -- For AI coding assistants\n- [Error Handling Guide](./docs/error-handling.md) -- Production error patterns\n- [Styling Guide](./docs/styling.md) -- CSS custom properties and theming\n\n## Community\n\n- [Documentation](https://docs.deepcitation.com)\n- [Report an Issue](https://github.com/DeepCitation/deepcitation/issues)\n- [Join Discussions](https://github.com/DeepCitation/deepcitation/discussions)\n- [Become a Design Partner](https://github.com/DeepCitation/deepcitation/issues/new?labels=design-partner\u0026template=design_partner.md)\n\n## Contributing\n\nSee [CONTRIBUTING](./docs/CONTRIBUTING.md).\n\n## License\n\n[MIT](./LICENSE)\n\n\u003e Hosted API/service is subject to [Terms](https://deepcitation.com/legal/terms-of-service) and [Privacy Policy](https://deepcitation.com/legal/privacy). Patent pending. \"DeepCitation\" is a trademark.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepcitation%2Fdeepcitation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepcitation%2Fdeepcitation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepcitation%2Fdeepcitation/lists"}