SourceCheck
SourceCheck verifies source-attributed claims inside a paragraph against a real paper or article and returns both a claim-by-claim audit and a corrected version of the text.
SourceCheck is a research-verification tool designed for essays, summaries, and AI-assisted writing. A user provides:
- a paragraph or short passage
- a source URL
- an optional citation hint
The system then:
- indexes the source with Nia
- extracts factual, source-attributed claims from the passage
- verifies each extracted claim against the source
- rewrites the paragraph conservatively using only grounded corrections
The current product is intentionally constrained to one source URL per check so the verification flow stays understandable, traceable, and reliable in a live demo.
Research writing and AI-generated summaries frequently contain subtle factual errors that are difficult to detect quickly:
- wrong benchmark numbers
- incorrect attribution of ideas or methods
- claims attached to the wrong citation
- unsupported implementation details presented as fact
Most current tools either summarize sources or generate text, but they do not clearly separate:
- what the paragraph claims
- what the source actually says
- what should be corrected
SourceCheck addresses that gap by using retrieval from the cited source as the grounding layer and returning a structured verification result rather than an opaque summary.
- Verify source-attributed claims against a real source URL.
- Extract claims from a paragraph rather than requiring perfect one-line inputs.
- Show users exactly which claims are confirmed, incorrect, partially correct, hallucinated, or unverifiable.
- Produce a corrected paragraph that preserves the original writing where possible.
- Multi-source citation resolution
- Full essay workflows spanning many sources
- Reference management
- Accounts, saved history, collaboration, or authentication
- General-purpose summarization of a source
SourceCheck is aimed at users who need a quick trust check on source-backed writing:
- students reviewing essay paragraphs
- researchers checking AI-generated summaries
- hackathon judges evaluating groundedness
- writers validating claims against a single cited paper
As a user, I want to paste a paragraph and the source it relies on so I can see:
- which claims are actually supported
- which claims are wrong or overstated
- how the paragraph should read after grounded corrections are applied
- one paragraph or short passage per request
- one source URL for the entire verification run
- optional citation hint to improve extraction or retrieval
- extracted factual claims with verdicts
- paragraph rewrite based on grounded corrections
- local development and demo usage
- verifying an entire paper or long essay end to end
- comparing a claim against multiple candidate sources
- automatic bibliography parsing
- automatic citation resolution from a works cited page
- deployment orchestration or hosting requirements as part of the product contract
The system must accept:
text: a paragraph or short passagesource_url: the source to verify againstcitation_hintoptional: a free-form reference hint such as paper title, author-year, or citation string
The system should reject empty text and empty source URLs.
The system must extract only factual, source-attributed, or clearly source-referential claims from the input paragraph.
The extraction stage should:
- ignore filler, framing, and non-factual prose
- preserve original wording where possible
- split compound factual statements when they are independently verifiable
- avoid inventing claims that are not present in the text
Each extracted claim must be verified against the user-provided source URL through Nia retrieval.
The backend must:
- index the source URL if needed
- wait until the source is ready
- search the source using the extracted claim and optional citation hint
- pass only retrieved evidence into the verdict synthesis step
Each claim must return one of the following verdicts:
confirmedincorrectpartially_correcthallucinated_citationunverifiable
The response must also include:
- confidence level
- what the claim says
- what the paper says
- correction when source-grounded
- explanation
- source metadata when available
The system must return a corrected version of the original paragraph.
The rewrite must:
- preserve original structure and tone where possible
- update only the claim spans that are clearly wrong and clearly correctable
- avoid adding unsupported facts
- leave unverifiable claims unchanged unless the verified output clearly warrants a neutral correction
The MVP is successful if it can reliably demonstrate the following on known test cases:
- extract the correct claim spans from a paragraph with filler text
- classify obvious supported and contradicted claims correctly
- avoid fabricating corrections for unrelated or unsupported claims
- produce a corrected paragraph that is visibly better than the input
- run end to end in a live local demo using a real paper URL
Nia is the source-grounding layer. Groq is used only to:
- structure extracted claims
- compare claims to retrieved evidence
- rewrite text conservatively from verified outcomes
Groq should not be used as a free-recall fact source.
The system supports two practical source types:
research_paperfor arXiv URLsdocumentationfor other URLs
For each paragraph verification request:
- index source once
- extract claims once
- search source per extracted claim
- synthesize verdict per claim
- rewrite paragraph once from the verified claim set
Frontend
-> collects paragraph, source URL, citation hint
-> calls POST /check-paragraph
-> renders original text, corrected text, summary, and claim cards
Backend
-> validates request
-> indexes source via Nia
-> extracts claims
-> searches Nia per claim
-> classifies verdicts with Groq
-> rewrites paragraph with Groq
-> returns structured response
External Services
-> Nia for indexing and search
-> Groq for extraction, verdict synthesis, and rewrite
Response:
{
"status": "ok"
}Compatibility endpoint for single-claim verification.
Request:
{
"claim": "GPT-4 achieves 87% on the HumanEval coding benchmark",
"citation": "OpenAI, 2023",
"source_url": "https://arxiv.org/abs/2303.08774"
}Response:
{
"claim": "GPT-4 achieves 87% on the HumanEval coding benchmark",
"source_url": "https://arxiv.org/abs/2303.08774",
"verdict": "incorrect",
"confidence": "high",
"what_claim_says": "GPT-4 achieves 87% on HumanEval",
"what_paper_says": "GPT-4 achieves 67.0% on HumanEval (0-shot)",
"correction": "GPT-4 achieves 67.0% on HumanEval, not 87%",
"paper_title": "GPT-4 Technical Report",
"arxiv_id": "2303.08774",
"arxiv_url": "https://arxiv.org/abs/2303.08774",
"explanation": "The source reports 67.0%, not 87%."
}Primary paragraph-verification endpoint.
Request:
{
"text": "In the report, GPT-4 achieves 67.0% on HumanEval. The report also introduced the Transformer architecture in 2017.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}Response:
{
"claims": [
{
"claim_id": 1,
"original_span": "GPT-4 achieves 67.0% on HumanEval",
"claim": "GPT-4 achieves 67.0% on HumanEval",
"verdict": "confirmed",
"confidence": "high",
"what_claim_says": "GPT-4 achieves 67.0% on HumanEval",
"what_paper_says": "GPT-4 achieves 67.0% on HumanEval in the 0-shot setting",
"correction": null,
"paper_title": "GPT-4 Technical Report",
"arxiv_id": "2303.08774",
"arxiv_url": "https://arxiv.org/abs/2303.08774",
"explanation": "The source directly supports the claim."
}
],
"summary": {
"confirmed": 1,
"incorrect": 1
},
"corrected_text": "In the report, GPT-4 achieves 67.0% on HumanEval. The report references the Transformer architecture, which was introduced by Vaswani et al. in 2017.",
"original_text": "In the report, GPT-4 achieves 67.0% on HumanEval. The report also introduced the Transformer architecture in 2017.",
"claims_checked": 2
}POST /check-paragraph
1. Validate text and source_url
2. Infer source type from URL
arxiv.org -> research_paper
otherwise -> documentation
3. Index the source via POST /sources
4. Poll the source until ready
5. Extract factual, source-attributed claims from the paragraph
6. For each extracted claim:
a. search the indexed source
b. synthesize a verdict from claim + retrieved evidence
7. Build summary counts
8. Rewrite the paragraph conservatively from verified outcomes
9. Return structured paragraph response
The source directly supports the claim.
The source discusses the same topic and directly contradicts the claim.
The claim contains a mix of supported and unsupported details.
The claim is being attributed to a source that says nothing relevant about that claim.
The source is relevant to the topic, but it does not provide enough detail to confirm or refute the claim.
The frontend should provide:
- a large text area for paragraph input
- a required source URL field
- an optional citation hint field
- a clear submit action
- a results view with:
- original text
- corrected text
- verdict summary counts
- one card per extracted claim
- source context section
The frontend should avoid presenting the product as a multi-source or whole-document checker.
Use https://arxiv.org/abs/2303.08774.
{
"text": "In the report, GPT-4 achieves 67.0% on the HumanEval coding benchmark in the 0-shot setting.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}{
"text": "The GPT-4 Technical Report introduced the Transformer architecture in 2017.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}{
"text": "According to the GPT-4 Technical Report, GPT-4 is a Transformer-based model and achieves 87% on HumanEval in the 0-shot setting.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}{
"text": "The GPT-4 Technical Report explains that there are 7 colors in a rainbow.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}{
"text": "The GPT-4 Technical Report states that GPT-4 was trained on 12 trillion tokens.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}{
"text": "A lot of technical reports are remembered for one or two headline facts, even though most of the document is really made up of setup, caveats, and evaluation framing. The GPT-4 Technical Report is similar in that sense: it spends a good amount of time explaining how the model is assessed and how its results should be interpreted. In the report, GPT-4 achieves 67.0% on the HumanEval coding benchmark in the 0-shot setting. The report also introduced the Transformer architecture in 2017, which later became the basis for GPT models. It additionally presents chain-of-thought prompting as a reasoning method first created by OpenAI in 2022. Beyond those points, much of the paper has the familiar texture of a serious research report, where the surrounding prose often matters for context more than for any single standalone claim.",
"source_url": "https://arxiv.org/abs/2303.08774",
"citation_hint": "GPT-4 Technical Report (2023)"
}Expected high-level result:
3 claims checked1 confirmed2 incorrect
Backend:
NIA_API_KEY=your_nia_api_key_here
GROQ_API_KEY=your_groq_api_key_here
REQUEST_TIMEOUT_SECONDS=300
NIA_POLL_INTERVAL_SECONDS=2
MAX_CLAIMS=5Frontend:
VITE_API_URL=http://localhost:8000SourceCheck/
backend/
app/
__init__.py
config.py
main.py
schemas.py
sourcecheck.py
.env.example
main.py
PRD-backend.md
requirements.txt
smoke_test.py
frontend/
public/
favicon.svg
src/
assets/
components/
gl/
Background.jsx
Navbar.jsx
PaperCard.jsx
SummaryBar.jsx
VerdictCard.jsx
pages/
About.jsx
Home.jsx
App.jsx
index.css
main.jsx
mockData.js
README.md
package.json
.gitignore
PRD.md
README.md
desc-devpost.md
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reloadBackend docs: http://localhost:8000/docs
cd frontend
npm installCreate frontend/.env.local:
VITE_API_URL=http://localhost:8000Run the app:
npm run devFrontend URL: http://localhost:5173
- Start backend and frontend locally.
- Open the frontend.
- Paste a known demo paragraph.
- Provide the source URL.
- Confirm the app returns:
- extracted claims
- summary counts
- corrected paragraph
With the backend running:
cd backend
SOURCECHECK_API_BASE=http://127.0.0.1:8000 python3 smoke_test.py- API keys are loaded from environment variables only.
- Local secret files such as
backend/.envandfrontend/.env.localare gitignored. - The repository should only contain placeholder values in
.env.exampleand documentation.