An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# FactDrop


FactDrop

![Next.js](https://img.shields.io/badge/Next.js-16-000000?logo=next.js&logoColor=white)
![React](https://img.shields.io/badge/React-19-20232A?logo=react&logoColor=61DAFB)
![TypeScript](https://img.shields.io/badge/TypeScript-6-3178C6?logo=typescript&logoColor=white)
![tRPC](https://img.shields.io/badge/tRPC-11-398CCB?logo=trpc&logoColor=white)
![TanStack Query](https://img.shields.io/badge/TanStack%20Query-5-FF4154?logo=reactquery&logoColor=white)
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-Database-4169E1?logo=postgresql&logoColor=white)
![Drizzle](https://img.shields.io/badge/Drizzle%20ORM-0.45-C5F74F?logo=drizzle&logoColor=111111)
![Better Auth](https://img.shields.io/badge/Better%20Auth-1.5-111111)
![Tailwind CSS](https://img.shields.io/badge/Tailwind%20CSS-4-06B6D4?logo=tailwindcss&logoColor=white)
![pnpm](https://img.shields.io/badge/pnpm-Only-F69220?logo=pnpm&logoColor=white)

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.


FactDrop product interface

## 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