Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Veralyze

Veralyze is an evidence-first verification platform for social and web content. It combines a FastAPI verification engine, a Next.js investigation dashboard, a browser extension capture flow, and a crawler-based graph backend.

The system evaluates content across three axes:

  • Axis 1: Content Authenticity
  • Axis 2: Contextual Consistency
  • Axis 3: Source Credibility

It then fuses the results into a single verdict with confidence bounds, trace logs, and explainability artifacts. Technical_Presentation

What Is In This Repository

  • frontend
    • Next.js 14 application (Verification Studio, dashboard, auth flow, API proxy routes).
  • backend
    • FastAPI verification engine with full 3-axis orchestration and fallback provider logic.
  • extension
    • Chrome extension plus a local Python bridge server that forwards captured content to the backend and exposes verification results to the frontend.
  • backend-Graph
    • Buffer-driven crawler pipeline for content, user, and propagation signals (JSON queue/results architecture).
  • supabase
    • SQL migration(s) for project data/auth foundation.

High-Level Architecture

  1. User submits text, URL, or image from the frontend, or captures content from the extension.
  2. Frontend calls /api/verify (or /api/proxy/analyze) server routes.
  3. Next.js routes proxy the payload to FastAPI POST /api/verify.
  4. FastAPI runs Axis 1 and Axis 3 in parallel, then Axis 2, then fuses scores.
  5. Response returns verdict, confidence interval, per-axis signals, radar metrics, evidence graph, and timeline logs.
  6. Extension flow can also use local bridge polling through http://localhost:8765/result.

For graph-oriented crawling, the extension/server side can push tasks into the graph buffer queue, and crawlers write outputs into result JSON files.

Repository Structure

.
|- backend/
|  |- main.py
|  |- verify.py
|  |- axis1_authenticity.py
|  |- axis2_context.py
|  |- axis3_source.py
|  |- fusion.py
|  |- prompts.py
|  |- config.py
|  |- schemas.py
|  |- requirements.txt
|  |- README.md
|  |- PROJECT_CONTEXT.md
|  `- TECHNICAL_INTERVIEW_SHOWCASE_PLAN.md
|- backend-Graph/
|  |- buffer/
|  |  |- tasks.json
|  |  `- results/
|  |     |- content.json
|  |     |- propagation.json
|  |     `- users.json
|  |- crawlers/
|  |  |- content/
|  |  |- propagation/
|  |  |- shared/
|  |  `- user/
|  |- ARCHITECTURE.md
|  `- README.md
|- extension/
|  |- manifest.json
|  |- background.js
|  |- server.py
|  |- content/
|  `- popup/
|- frontend/
|  |- app/
|  |- components/
|  |- lib/
|  |- package.json
|  `- tsconfig.json
|- supabase/
|  `- migrations/
|- EVALUATION_READINESS_PLAN.md
`- README.md

Core Features

  • Multi-modal verification input
    • text, URL, and image workflows with optional caption context.
  • Transparent scoring
    • per-axis scores and statuses, fused composite score, confidence interval.
  • Explainability
    • timeline logs, axis signals, capability usage list, and knowledge graph response nodes/edges.
  • Provider fallback strategy
    • graceful degradation to alternate LLM and heuristic paths when providers are unavailable.
  • Extension-to-web workflow
    • capture social content in browser, forward through local bridge, visualize result in frontend Verify page.
  • Graph backend pipeline
    • queue-based crawling architecture with independent content/user/propagation workers.

Quick Start (Frontend + Backend)

Prerequisites

  • Python 3.10+ (3.11 recommended)
  • Node.js 18+
  • npm

1) Start the backend (FastAPI)

cd backend
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn main:app --reload --port 8000

Backend endpoints:

  • GET http://localhost:8000/api/health
  • GET http://localhost:8000/api/capabilities
  • POST http://localhost:8000/api/verify

2) Start the frontend (Next.js)

cd frontend
npm install
npm run dev

Frontend default URL:

  • http://localhost:3000

Environment Variables

Backend (backend/.env)

# Search/context providers
SERPER_KEY=
SERPAPI_KEY=

# Authenticity providers
SIGHTENGINE_API_USER=
SIGHTENGINE_API_SECRET=
REALITY_DEFENDER_API_KEY=
REALITY_DEFENDER_BASE_URL=https://api.realitydefender.com

# Source checks
ABUSEIPDB_API_KEY=

# LLM fallback chain
GROQ_API_KEY=
GROQ_MODEL=llama-3.3-70b-versatile
XAI_API_KEY=
XAI_MODEL=grok-2-latest
GEMINI_API_KEY=
GEMINI_MODEL=gemini-1.5-flash
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=qwen3.5:4b

# App
ALLOWED_ORIGINS=http://localhost:3000
ENVIRONMENT=development

Notes:

  • SERPAPI_KEY is currently consumed by the graph content crawler client.
  • Backend capability flags auto-detect available providers from configured keys.

Frontend (frontend/.env.local)

NEXT_PUBLIC_FASTAPI_URL=http://localhost:8000
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

NEXT_PUBLIC_FASTAPI_URL is required for frontend API routes that proxy to FastAPI.

API Contracts (Verification)

Request

POST /api/verify

{
	"primary_type": "text",
	"text": "Example claim text",
	"url": "https://example.com/source",
	"caption": "Optional caption context",
	"image_b64": "...",
	"image_mime": "image/jpeg"
}

Supported primary types:

  • text
  • url
  • image

Backward-compatible fields also exist (content_type, content).

Response Highlights

Response includes:

  • verdict
  • composite_score
  • confidence_low, confidence_high
  • axis1, axis2, axis3
  • radar
  • graph (knowledge graph nodes/edges)
  • logs (timeline events)
  • capabilities_used

Extension Flow

The extension is located in extension/ and uses Manifest V3.

  • Content scripts target X/Twitter and Facebook pages.
  • A local bridge server receives extracted payloads and forwards them to FastAPI.
  • The frontend Verify page can poll bridge status/results when opened with ?source=extension.

Run the local bridge server

cd extension
python server.py

Default bridge endpoints:

  • POST http://localhost:8765/extract
  • GET http://localhost:8765/result

Load the Chrome extension

  1. Open Chrome extensions page (chrome://extensions).
  2. Enable Developer Mode.
  3. Click Load unpacked.
  4. Select the extension/ directory.

Graph Backend (backend-Graph)

The graph backend is a queue-based crawler subsystem:

  • Input queue: backend-Graph/buffer/tasks.json
  • Results:
    • backend-Graph/buffer/results/content.json
    • backend-Graph/buffer/results/propagation.json
    • backend-Graph/buffer/results/users.json

Each crawler is independent and communicates only through shared buffer files.

Run crawlers

From repository root:

python backend-Graph/crawlers/content/content_crawler.py --loop
python backend-Graph/crawlers/propagation/twitter_crawler.py --loop
python backend-Graph/crawlers/propagation/reddit_crawler.py --loop
python backend-Graph/crawlers/user/user_extractor.py --loop

Current status:

  • Content crawler runs live SerpAPI lookup (when SERPAPI_KEY is set).
  • User crawler computes user-level features from payload data.
  • Propagation crawlers are scaffolds ready for platform-specific traversal logic.

Supabase

Database/auth setup lives in supabase/migrations/.

  • Current migration: 001_init.sql

Frontend auth utilities are under frontend/lib/supabase/ and middleware hooks live in frontend/middleware.ts.

Additional Documentation

  • backend/README.md - backend-specific provider, fallback, and testing details.
  • backend-Graph/README.md - graph pipeline quick guide.
  • backend-Graph/ARCHITECTURE.md - deep architecture blueprint for trust graph evolution.
  • EVALUATION_READINESS_PLAN.md - checklist for evaluation hardening.
  • backend/TECHNICAL_INTERVIEW_SHOWCASE_PLAN.md - interview/demo narrative plan.

Troubleshooting

  • Frontend returns NEXT_PUBLIC_FASTAPI_URL is missing
    • Set NEXT_PUBLIC_FASTAPI_URL in frontend/.env.local and restart dev server.
  • Backend returns mostly skipped signals
    • Check configured keys and call GET /api/capabilities.
  • Extension bridge cannot reach backend
    • Confirm backend is running at http://localhost:8000 before sending extension captures.
  • Graph crawlers do not process tasks
    • Confirm pending tasks exist in backend-Graph/buffer/tasks.json with matching task_type and platform.

License

See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages