Project Info
About the Project Tweet FactChecker is a one-click fact-checking tool for X/Twitter posts. The idea is simple: when a user sees a suspicious tweet, they can click a “Fact Check” button directly inside the browser. The extension sends the tweet to a backend pipeline, where multiple agents extract claims, evaluate evidence, critique the reasoning, and return a concise verdict in an overlay.
Inspiration
Social media moves faster than truth. A misleading post can spread widely before most people have time to verify it. We wanted to build something that fits naturally into the place where misinformation appears: the timeline itself. Instead of asking users to copy a tweet, open another tab, search manually, and compare sources, Tweet FactChecker brings the verification workflow directly into the browser. Our goal was to make fact-checking feel lightweight enough that people would actually use it in the moment. What It Does Tweet FactChecker adds a fact-checking layer to X/Twitter: A browser extension detects tweets and injects a fact-check button. When clicked, the extension sends the tweet text to a FastAPI backend. The backend runs a multi-agent pipeline: ClaimAgent extracts checkable claims from the tweet. EvaluatorAgent searches for supporting or contradicting evidence. CriticAgent reviews the reasoning and catches weak conclusions. ClaimAgent extracts checkable claims from the tweet. EvaluatorAgent searches for supporting or contradicting evidence. CriticAgent reviews the reasoning and catches weak conclusions. The system aggregates the results into a final verdict. The extension displays the conclusion in a clean floating overlay. Conceptually, the pipeline turns a tweet into structured reasoning: tweet \rightarrow claims \rightarrow evidence \rightarrow critique \rightarrow verdict How We Built It The project is split into two main parts: extension/: a TypeScript + Vite + Manifest V3 browser extension backend/: a Python 3.12 FastAPI service The extension handles tweet extraction, UI injection, API calls, and result rendering. The backend owns the fact-checking pipeline, shared contracts, mock responses, real-agent wiring, and integration smoke tests. A key design decision was to keep the data contract frozen between frontend and backend. The Pydantic models in backend/contracts/models.py mirror the TypeScript types in extension/src/types.ts, so both sides agree exactly on the shape of requests and responses. We also built the system so it can run in two modes: Mock mode for local development without API keys Real agent mode using USE_REAL_AGENTS=1 for the full multi-agent pipeline This made it easier to develop the UI and backend independently while still preserving an end-to-end path. Challenges We Faced One of the hardest parts was keeping the frontend and backend synchronized. Since the extension depends on exact response shapes, even a small contract mismatch could break the overlay rendering. Freezing and mirroring the contract helped reduce that risk. Another challenge was designing the agent pipeline so it did more than produce a single rushed answer. We wanted the system to separate claim extraction, evidence evaluation, and critique, because fact-checking requires more than just confidence. It requires structured reasoning. We also had to balance real-world usability with development speed. The browser extension needed to feel immediate, while the backend needed enough structure to support mock testing, real agents, and future expansion. What We Learned We learned that fact-checking is not just a search problem. It is a workflow problem. A useful system needs to identify what is actually being claimed, evaluate evidence carefully, and explain the result in a way users can understand quickly. We also learned the value of strict contracts between frontend and backend. By treating the response schema as a shared source of truth, we made the system easier to test, debug, and extend. Most importantly, we learned that AI agents are most useful when they have clear roles. Splitting the pipeline into claim extraction, evaluation, and critique made the final result more reliable than a single all-purpose step. What's Next Next, we want to improve source citation quality, support multi-claim tweets more deeply, add richer verdict explanations, and make the extension more robust across different X/Twitter layouts. We also want to experiment with confidence scoring and user feedback so the system can better communicate uncertainty instead of pretending every answer is absolute.
Tweet FactChecker
X/Twitter 推文一键事实核查:浏览器扩展抓推文 → 后端多 agent 管道核查 → 浮层展示结论。
架构
extension/ (TypeScript + Vite + MV3) ← 1号 worktree: frontend
抓推文 → 注入"核查"按钮 → 浮层显示结论
│ POST /factcheck (契约见 backend/contracts ↔ extension/src/types.ts)
▼
backend/ (FastAPI + Python)
contracts/ 共享数据契约(Pydantic)——三线命脉,已冻结
agents/ claim / evaluator / critic ← 2号 worktree: agent-layer
core.py 单断言管道 + 结果收敛
orchestrator.py 串 claim→evaluator→critic ← 3号 worktree: engine-wiring
mocks/ 固定数据 mock,全线联调用
app.py HTTP 入口(默认挂 mock 编排器)
核查管道:推文 → ClaimAgent 抽断言 → EvaluatorAgent 搜证初判 → CriticAgent 复核 → 聚合
模型分层:claim=claude-haiku-4-5,evaluator/critic=claude-sonnet-4-6。
并行开发(git worktree)
main 已冻结 contracts + engine 骨架 + mocks。三条线在 worktree 上并行:
git worktree add ../factchecker-frontend -b frontend # extension/
git worktree add ../factchecker-agent-layer -b agent-layer # backend/agents/
git worktree add ../factchecker-engine-wiring -b engine-wiring # backend/orchestrator + core
# 第4个终端留在 main,做监督 / 集成
各线均依赖 backend/contracts(Python)/ extension/src/types.ts(TS)的冻结契约。
本地运行(全 mock,无需 API key)
Python 钉死 3.12(三线统一,避免 3.9 的
X | None/ Pydantic 建类炸裂)。
cd backend
python3.12 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reload # http://localhost:8000/factcheck
pytest # 契约单测 + mock 链路 HTTP 集成测试
python smoke.py # 集成冒烟(双链路):mock 始终跑,real 需 key
集成冒烟(双链路)
三线合并回 main 后一键验证,过真实 HTTP 表面(ASGI):
python smoke.py # 仅 mock(硬门槛)
USE_REAL_AGENTS=1 ANTHROPIC_API_KEY=sk-... python smoke.py # mock + real
cd ../extension
npm install
npm run build # 产物 dist/ → Chrome 加载已解压扩展
接入真实 Claude agent:export USE_REAL_AGENTS=1(待 engine-wiring 落地组装)。
Analysis
View
Metric
- 15
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- FastAPIIn code
- PythonIn code
- TypeScriptIn code
4 of 4 appear in the indexed code.
AI coding agents
- Claude CodeConfig · Commits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
105 KB
Source files
32
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
taohaoze7-prog/tweet-factchecker
41 files · 142 KB · @ c11767a
Structure
Application logic
27 files · 66%Domain rules, services and shared utilities.
+2 more
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python68%
- TypeScript20%
- Markdown12%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
backend/requirements.txt
pypi · 7- anthropic
- fastapi
- httpx
- pydantic
- pytest
- pytest-asyncio
- uvicorn[standard]
extension/package.json
npm · 33 development-only dependencies.
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.