https://github.com/sayeedjoy/factdrop
ai powered fact-check engine
https://github.com/sayeedjoy/factdrop
ai aisdk fact-checking mcp-server misinformation misinformation-detection open-source openrouter verification
Last synced: 25 days ago
JSON representation
ai powered fact-check engine
- Host: GitHub
- URL: https://github.com/sayeedjoy/factdrop
- Owner: sayeedjoy
- Created: 2026-05-05T17:29:17.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-30T14:24:17.000Z (27 days ago)
- Last Synced: 2026-05-30T15:11:06.439Z (26 days ago)
- Topics: ai, aisdk, fact-checking, mcp-server, misinformation, misinformation-detection, open-source, openrouter, verification
- Language: TypeScript
- Homepage:
- Size: 9.28 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# FactDrop










FactDrop is an AI-powered fact-checking engine designed to make claim verification faster, more accessible, and more scalable. Instead of relying solely on manual fact-checking workflows, FactDrop combines large language models, web intelligence, fact-check databases, and source credibility analysis to automate much of the verification process.
## Stack
- Framework: Next.js 16, React 19, TypeScript 6
- AI: Vercel AI SDK, Anthropic, OpenAI, Google, xAI, Vercel AI Gateway, MCP
- API and data: tRPC, TanStack Query, Drizzle ORM, PostgreSQL, Zod
- Auth and UI: Better Auth, Tailwind CSS, Radix UI, Zustand, next-intl
- Search and media: Tavily, Exa, Firecrawl, Parallel, Vercel Blob, Cloudinary
- Editing and visualization: Lexical, CodeMirror, Recharts, ECharts
- Tooling and observability: Ultracite, Playwright, Vitest, Evalite, Langfuse, OpenTelemetry, Pino
## Quick Start
```bash
pnpm install
cp .env.example .env.local
pnpm check-env
pnpm db:migrate
pnpm dev
```
Dev server runs at `http://localhost:3000`.
Dev login shortcut (development only): `GET /api/dev-login`
## Scripts
```bash
pnpm dev # Start dev server (runs check-env + DB branch resolution first)
pnpm lint # Biome via ultracite
pnpm format # Biome format (auto-fix)
pnpm test:unit # Vitest only (needs local Postgres)
pnpm test:e2e # Playwright only (uses .env.local)
pnpm test # E2E + unit
pnpm test:types # Next typegen + full type-check
pnpm build # Production build (prebuild runs check-env)
pnpm check-env # Validate required env vars
```
## Configuration
`chat.config.ts` is the single source of truth for feature switches and model/gateway behavior.
Flow:
`chat.config.ts` -> `lib/config-schema.ts` -> `lib/config.ts`
Use this to configure:
- Gateway selection
- Enabled models and defaults
- Tool toggles (MCP, search, URL fetch, code execution, docs, research)
- Credit and rate-limit behavior
## Database Notes
- Schema: `lib/db/schema.ts`
- Migrations: `lib/db/migrations/`
- Production migration runner: `lib/db/migrate.ts` (runs when `VERCEL_ENV=production`)
- Database connection: set `DATABASE_URL` to your PostgreSQL instance
## Architecture Notes
- Most product routes live under `app/workspace/*`
- Legacy route aliases redirect to workspace routes via `next.config.ts`
- `lib/db/queries.ts` is server-only
- tRPC root router: `trpc/routers/_app.ts`
- Prefer `protectedProcedure` for authenticated endpoints
- Lazy prefetch pattern: call `prefetchQuery` (without `await`) in Server Components and hydrate on client
## Verification Dataflow
```mermaid
flowchart TD
A([User Query]) --> B{Image attached?}
B -- Yes --> C[Extract claim from image
OCR or describe via vision model]
B -- No --> D[Split into claims
LLM claim-splitter]
C --> D
D --> E{Single or multi?}
E -- Single --> F[Run pipeline once]
E -- Multi --> G[Run pipeline per sub-claim
in parallel via same pipeline]
F --> H
G --> H
subgraph PIPE [Per-claim pipeline]
H{Bangla?} -- Yes --> I[Translate to English
Add English query]
H -- No --> J[Run in parallel via Promise.all]
I --> J
J --> K[Web search
Tavily + Exa + Parallel + MCP
Concurrent and merged]
J --> L[Google Fact Check API]
K --> M{Results empty?}
M -- Yes --> N[Firecrawl fallback search]
M -- No --> O[Trust-rank sources
SourceCheck MCP: IFFY + IFCN + GDI + internal rules]
N --> O
O --> P[LLM final verdict
Rating + note]
L --> P
end
P --> Q([Output
Rating, note, ranked sources])
```
## Testing
- Unit tests: `pnpm test:unit` (Vitest)
- E2E tests: `pnpm test:e2e` (Playwright projects: `chat`, `reasoning`, `artifacts`, `dashboard`)
- Types: `pnpm test:types`
## Package Manager
Use `pnpm` only.
## License
Apache-2.0