dharmik chandel

· 12 min read · falkordb graph-databases ai-agents misinformation hackathon

Every hoax has a family tree: building Lineage on FalkorDB

Contents · 9 sections
  1. 01Why "true or false" is the wrong answer
  2. 02The idea that made it work: a debunk has a reason
  3. 03Why this had to be a graph
  4. 04Four agents that talk only through the graph
  5. 05Watching it work
  6. 06Honesty is a design constraint, not a disclaimer
  7. 07What I learned
  8. 08How I built it
  9. 09What's next

Built solo for Graph Hacks 2026 (WeMakeDevs × FalkorDB): Track 1, Agents That Act on Connected Data, and Track 2, Agent Memory and Coordination.


In 2012, a chain email claimed NASA had confirmed that the Earth would go dark for three days.

In 2014, a satire site turned it into six days. In 2015 it came back as fifteen days, November 15 to 29. In 2016 a version picked up a Bible, end-of-days framing. In 2017 it grew a detail that made it sound official: NASA had sent a 1,000-page report to the White House.

Fact-checkers debunked it every single time: Snopes, PolitiFact, FactCheck.org, ThatsNonsense, EarthSky. And every single time it came back slightly different, and someone had to start over.

2012 Earth goes dark for three days chain email · debunked 2014 Earth goes dark for six days satire site · debunked 2015 Earth goes dark for fifteen days, November 15 to 29 debunked 2016 + a Bible, end-of-days framing debunked 2017 + a 1,000-page report to the White House debunked next the next version
One hoax, five versions. Each was debunked; each came back changed.

That is the problem I wanted to work on. A claim is never new. It is a mutation of something older. The fact-checks already exist; they just don't reach the next version, because the next version doesn't look like the last one.

So I built Lineage. You paste a claim, and it shows you the claim's family tree: where it came from, how it changed, who spread it, and whether an old debunk still applies to the new version, and why.

Why "true or false" is the wrong answer

My first idea was the obvious one: paste something, get back a truth score and a confidence score. The longer I thought about it, the less I trusted it. A score with nothing behind it is just a more confident-looking guess, and a fact-checking tool that guesses is worse than no tool at all.

So Lineage never gives a bare true/false. It gives an evidence trail with calibrated confidence: the verdict, the reason, the path through the graph that justifies it, and the real fact-check links at the end of that path. When it has no evidence, it says "Unknown", and I treat that as a feature, not a failure.

The idea that made it work: a debunk has a reason

Here's the question at the heart of Lineage. If the 2017 version was debunked, is the 2026 version debunked too?

It depends on why the 2017 version was false.

  • The NASA story was false because it was fabricated. NASA never said anything of the kind. Change the date, change the number of days, add a White House report: it is still fabricated. The debunk carries over.
  • Now imagine a claim debunked because it had the wrong figure: "60,000 people" when the real number was 40,000. If a later version fixes the number, the old debunk no longer applies. Carrying it over would be wrong.
  • Or a quote debunked as misattributed: the "Bill Gates' 11 rules for school" list, which Gates never wrote. A version that credits the real author, Charles J. Sykes, isn't another mutation. It's a correction.

That gave Lineage its core rule:

A debunk travels exactly as far as its reason still applies.

Every fact-check in the graph carries a basis (fabricated, misattributed, wrong_figure, misdated, overstated, missing_context), and every mutation edge carries its types (date_shift, number_change, attribution_change, exaggeration, context_stripped). Walking down a chain, a debunk survives a mutation only if its basis survives that type of change:

Debunk basis Survives Broken by
fabricated every mutation nothing
misattributed number, date, exaggeration, context re-attribution (a correction if it's the true author)
wrong_figure anything that keeps the figure a number change
misdated number, attribution, exaggeration a new date
overstated further exaggeration anything else
missing_context still-stripped copies anything else

Four global rules sit on top: only negative verdicts travel (a "true" rating never covers a mutated claim); confidence decays with every hop; anything unclear fails safe to "needs its own check"; and when a debunk stops, the answer names the mutation that stopped it.

Why this had to be a graph

Once I'd written the rule down, the data model followed: this problem is a graph. And I used FalkorDB as the only store. There's no Postgres on the side and no in-memory fallback. Stop FalkorDB and Lineage shows "Lineage cannot work without its graph" and stops.

PUBLISHED_BY FOUND SIGHTING_OF ABOUT MUTATED_FROM types · before after · confidence CHECKED_BY verdict · basis ORIGINATES_FROM Publisher AgentRun Sighting Finding Claim newer Claim older FactCheck Source confidence · evidence_url established
Lineage's graph model. MUTATED_FROM is the edge a debunk travels along.

Every product question maps onto a graph operation:

  • "Where did this come from?" is a variable-length path up MUTATED_FROM. Origins are collected along the whole chain, because fact-checkers pin an origin wherever they think the story started. When two of them disagree (Snopes traces the NASA hoax to a 2012 chain email; ThatsNonsense and EarthSky point at Huzlers.com), the claim gets two ORIGINATES_FROM edges, and Lineage shows "origin contested" instead of picking a winner.

  • "Does the old debunk apply?" is the key query, Q4. It finds every upward path from the new claim to a fact-checked ancestor, with each hop's mutation types and before/after text, and multiplies a decayed confidence along the way:

    MATCH path = (c:Claim {id: $id})-[:MUTATED_FROM*0..6]->(a:Claim)
    MATCH (a)-[chk:CHECKED_BY]->(f:FactCheck)
    RETURN [r IN relationships(path) | {types: r.types, confidence: r.confidence}] AS hops,
           {url: f.url, publisher: f.publisher, verdict: chk.verdict, basis: chk.basis} AS factCheck,
           reduce(conf = 1.0, r IN relationships(path) | conf * $decay * r.confidence) AS decayedConfidence
    

    The graph does the traversal; a small pure TypeScript function walks each path back down applying the basis table. That function is unit-tested against the three worked cases above.

  • Verdicts are never stored. They're derived at read time. Add one fact-check to an old version and every descendant's verdict changes on the next read, with no migration and no stale flags.

  • "How big is this story?" is FalkorDB's built-in algo.WCC. Weakly connected components over MUTATED_FROM group every variant into a family: "9 variants over 14 years."

  • "Have we seen this before?" is a vector search, in the same database. Each claim stores a 768-dimension embedding, and db.idx.vector.queryNodes finds its nearest neighbours together with their fact-checks in one query. Similarity search and graph traversal sit side by side, so I never had to sync two stores.

Four agents that talk only through the graph

Lineage runs four agents in sequence:

1 2 3 4 Extractor Linker Skeptic no LLM Writer writes reads FalkorDB graph AgentRun and Finding nodes · shared memory
The agents never pass data to each other. The graph is their only channel.
  • The Extractor splits pasted text into atomic, checkable claims, keeping "according to X" attached to the claim it qualifies, because who said it is part of the claim.
  • The Linker embeds each claim, runs the vector search, and asks the LLM to judge each candidate: same claim, mutation (with types and before/after text), related, or unrelated. Then it writes the new Claim and its MUTATED_FROM edges.
  • The Skeptic runs the inheritance and origin queries and applies the propagation rules. It uses no LLM at all. It can only lower confidence, never raise it, and every caution it raises traces back to a graph fact.
  • The Writer assembles the answer.

The design choice I'm proudest of: the agents never pass data to each other. Each one opens an AgentRun node, reads the previous agent's Finding nodes back out of FalkorDB with a query, and writes its own findings. The graph is their shared memory and their coordination layer. That also means the live trace in the UI isn't a fake progress bar: the page polls the graph every 0.7 seconds, and what you see is the graph filling up.

Watching it work

Paste a made-up 2026 version (clearly labelled synthetic demo data throughout the app):

"NASA confirms Earth will go dark for 15 days in November 2026, according to a 1,000-page report sent to the White House."

  1. The vector search finds the 2017 version at 0.968 similarity.
  2. The Linker records the new claim as a mutation of it: date_shift: "November 2017" → "November 2026".
  3. Q4 walks up the chain. The 2017 version was debunked as fabricated, and a date shift doesn't change that, so the debunk carries over at 0.85 confidence (0.9 decay × 0.95 edge confidence), backed by seven fact-checks from five different publishers.
  4. Q2 follows five hops back to 2012 and reports the origin as contested.
  5. The family tree draws itself as a dated chain, and a red pulse runs down each edge the debunk travels through.

Then paste a second mutation ("20 days this December"). It links to the claim you just added, a version that didn't exist a minute ago, and resolves straight from the graph at 0.73, one hop further away. The graph compounds: every check makes the next one faster.

Paste "the Sykes list of rules kids won't learn in school" and Lineage says correction: it credits the established true author of a misattributed list.

Paste "three cups of coffee a day adds ten years to your life" and its best match scores 0.72, under the 0.75 cutoff. No LLM judgement is spent on it, the Writer makes no model call, and the answer is "Unknown. No evidence in the graph."

Honesty is a design constraint, not a disclaimer

A tool about misinformation can't make things up. So the honesty rules are built in, not added as a disclaimer:

  • The LLM phrases; it never states facts. The Writer builds every fact (verdict, basis, confidence, links, chain, origins) in code from graph findings. The model only writes a headline and two sentences from a fact sheet with no URLs in it. If its reply contains a URL, or any number that isn't in the fact sheet, the reply is thrown away and replaced by a template sentence, and the rejection is logged in the trace.
  • Every FactCheck has a real URL. The seed data comes from public fact-checks (PolitiFact, FactCheck.org, ThatsNonsense, EarthSky, AFP, Check Your Fact, Tes, and Snopes as quoted by news coverage). Nothing that couldn't be cited was seeded.
  • When sources disagree, the graph says so. Which site published the 2017 version? FactCheck.org says twofeed.org; PolitiFact says NewsForMeToday.com. Both are stored, each with its source. When did the Gates attribution start? Sources disagree, so the conflict is stored as a note instead of being quietly resolved.
  • Synthetic is always labelled. Every demo input carries a synthetic flag and a visible badge.

What I learned

1. The "why" is the most valuable field in the database. Most fact-check data stores a rating. Adding a single basis field to the CHECKED_BY edge turned a lookup table into something that can reason about versions it has never seen.

2. Store the edges, derive the verdicts. My first instinct was to save a verdict on every claim. Deriving verdicts at query time means one new fact-check fixes an entire family at once, and every answer can show the path it came from.

3. Put the traversal in Cypher and the policy in code. I could have encoded the whole basis table inside a Cypher reduce. Splitting it, with the graph finding the paths and a tiny pure function judging them, made the rule easy to read, explain and test.

4. Check what your index actually returns. The vector index's cosine score turned out to be a distance, not a similarity (a claim against itself scores about 0). Q1 now computes 1 - vec.cosineDistance(...) explicitly, so "1" means "same meaning" everywhere in the code.

5. "Closest" beats "newest". When a new claim matched several generations of the same chain, the Linker first kept the newest one. Then the Sykes correction got attached to the speech version of the Gates list, although the text never mentions a speech. Breaking ties by embedding similarity fixed it, and a small graph query (SAME_CHAIN_PAIRS) finds which matches are ancestors of each other, so a claim links to the closest version of a chain instead of to every generation.

6. Not every agent needs a model. The Skeptic is plain rules. It's cheaper, it's deterministic, and when a judge asks "why is the confidence 0.85?", there's an exact answer.

7. Cutoffs save money, not decisions. Candidates under 0.75 similarity never reach the LLM. The model still makes the real judgement; the cutoff only stops me paying to hear "unrelated".

8. Build for the free tier you actually have. Halfway through the build, the model I'd chosen started returning a 404 for new users. Because no code names a model (it's one environment variable), switching took a minute. Every reply is cached by input hash, there's a daily call budget, and claim ids are derived from their text, so re-running a demo costs nothing. And because Gemini's free tier can't serve end users in some regions, the public deployment runs in recorded mode: the full pipeline replays real model replies recorded from actual runs, every graph query still runs live, and the page says clearly that it's a recording.

How I built it

I worked solo, with Claude Code (Anthropic) as my coding assistant. I designed Lineage: the graph model, the six queries and what each one must return, the propagation rule and its basis table, the four agents that coordinate only through the graph, the honesty rules and the demo story. Claude Code wrote the implementation to that design: the TypeScript, the Cypher text, the UI, the tests and the seed-file research. It also proposed implementation details along the way. The repo's AI_USAGE.md lists exactly who did what.

The stack: FalkorDB 4.22, Next.js 16 and TypeScript, Gemini for three of the four agents, and gemini-embedding-001 for the vectors.

What's next

Today the graph holds two hand-verified hoax families, so most new claims come back "Unknown". That's honest, but it's small. The next step is letting the graph grow itself from real, cited evidence, never from LLM guesses:

  • A Researcher agent. When the answer is Unknown, it queries Google's Fact Check Tools API (the ClaimReview index that fact-checkers publish) and adds each match as a FactCheck node with its real URL, so every later variant inherits from it.
  • Coverage as context, not evidence. News articles become Sightings for the timeline and the spread, but never count towards a verdict, because a viral hoax always has more articles than its debunk.
  • Proposed bases, reviewed. A rating says false, not why. The agent proposes a basis with low confidence until a person confirms it.

Misinformation doesn't die; it mutates. The only way to keep up is to remember the whole family. That's what the graph is for.


Links

all posts