This is a submission for the Sanity Challenge, Path One: Ship an Agent That Queries Real Content
A few weeks ago, I was checking my DEV.to dashboard and noticed something weird in the Traffic Sources panel. Views were coming from websites I'd never heard of โ random blogs, content farms, sites I'd never visited, let alone posted on.
So I clicked through. And there it was: my article, word for word, on someone else's website. Some had credited me. Most hadn't.
That moment of "wait, is this... stolen?" is something every content creator eventually hits. But figuring out whether a repost is actually plagiarism or a legitimate cross-post with credit is surprisingly hard. You have to manually compare the text, check if they mentioned your name, see if they linked back. And if they didn't? Good luck drafting a DMCA notice from scratch.
It's an AI-powered content provenance agent with three core capabilities: ๐ The Scanner โ Paste any DEV.to article URL. OriginTrace extracts distinctive phrases, searches the entire web via Google (Serper API), scrapes up to 15 candidate pages, and runs a multi-signal overlap analysis (word overlap, 5-gram shingling, LCS ratio) to determine if they copied your content. โ๏ธ The Verdict Engine โ For every copy found, OriginTrace doesn't just say "it's a match." It checks structured attribution evidence: Does the copy mention the original author's name? Does it link back to the original post? Does it use attribution phrases like "via" or "originally published on"? Based on these boolean signals, it renders a verdict: creditedsyndication (legal, no action needed) or unattributedrepost (DMCA time). ๐ฌ The Sanity AI Agent โ This is the heart of the Path One submission. A conversational AI agent powered entirely by the Sanity Knowledge Base and Context MCP. It lets you talk to your provenance data. Ask it: "Which copycat had the highest overlap but still credited me?" or "Draft a DMCA takedown for the worst offender." The agent dynamically queries the structured content in Sanity and gives you actionable, source-backed answers.
Every article, every provenance check, every attribution signal, and every DMCA template is persisted as structured JSON documents in Sanity's Content Lake โ creating an immutable, queryable ledger of who copied what, when, and whether they gave credit.
๐บ Video Walkthrough: {% youtube https://youtu.be/TwWIvjhjD44?si=ANvmh-rh4qwooPwH %}
To test the Sanity AI Agent: (Note: For the best experience, please scan a DEV.to post on the homepage first so the Sanity Knowledge Base has your structured data to query!) Visit origintrace.onrender.com/chat and try asking: "Which article has the highest overlap percentage?" "Did the top copycat credit the original author?" "Draft a DMCA takedown notice for the worst offender."
The AI Agent querying Sanity via Context MCP, with transparent "Agent Thoughts" blocks showing its reasoning process.
A structured response: the agent analyzed boolean attribution fields from Sanity, rendered a verdict table, and concluded that no DMCA was needed because the copy properly credited the author.
The scanner homepage โ paste a DEV.to URL and the programmatic pipeline crawls the web for copies.
Scan results with overlap percentages, attribution verdicts, and DMCA generation โ all backed by Sanity.
OriginTrace's AI Agent doesn't do keyword search. It queries typed fields in Sanity โ booleans, integers, enums, and string arrays โ to answer questions that would be impossible with unstructured text.
The agent connects to Sanity Context MCP and queries the Content Lake. It needs to: Filter provenanceCheck documents where verdict != "nomatch" Sort by overlapPercent (a number field) descending Check attribution.hasAuthorName (a boolean) and attribution.hasOriginalLink (a boolean) Read attribution.signals (a string array) for the exact credit items found
No keyword search in the world can answer that. The answer requires comparing a number against booleans across multiple documents. That's why structured content matters.
article โ The canonical source of truth. When a user scans a DEV.to URL, the pipeline fetches the article, extracts its content, and persists it in Sanity with a reference to its author. This establishes the provenance claim.
provenanceCheck โ The evidence record. Every candidate copy found on the web gets its own check document containing: overlapPercent (number) โ similarity score from the multi-signal NLP engine verdict (enum) โ creditedsyndication, unattributedrepost, or nomatch attribution (object) โ structured booleans: hasAuthorName, hasOriginalLink, hasAttributionPhrase, isProperlyAttributed, plus signals[] and missing[] arrays dmcaTemplate (text) โ a pre-generated legal takedown notice reconciledEntries (array) โ matched passages between original and copy
author โ Referenced by articles, contains name and handle for attribution matching.
