<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ganesh J</title>
    <description>The latest articles on DEV Community by Ganesh J (@codemuscle00).</description>
    <link>https://dev.to/codemuscle00</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3985379%2Fba022292-811a-41e4-94fe-6f5846c7280f.jpg</url>
      <title>DEV Community: Ganesh J</title>
      <link>https://dev.to/codemuscle00</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codemuscle00"/>
    <language>en</language>
    <item>
      <title>Building an AI research copilot that catches its sources lying</title>
      <dc:creator>Ganesh J</dc:creator>
      <pubDate>Mon, 06 Jul 2026 07:00:24 +0000</pubDate>
      <link>https://dev.to/codemuscle00/building-an-ai-research-copilot-that-catches-its-sources-lying-go1</link>
      <guid>https://dev.to/codemuscle00/building-an-ai-research-copilot-that-catches-its-sources-lying-go1</guid>
      <description>&lt;p&gt;Research tools forget across sessions, and they never notice when two sources disagree. Crosscheck is a small copilot on top of &lt;a href="https://cognee.ai" rel="noopener noreferrer"&gt;cognee&lt;/a&gt;that does both: persistent memory of everything you feed it, and a hero feature that flags when sources contradict each other — e.g. "FooDB sustained 50,000 req/s" (2021) vs "only 10,000 req/s" (2024).&lt;/p&gt;

&lt;h2&gt;
  
  
  The obvious design — and why it wasn't enough
&lt;/h2&gt;

&lt;p&gt;The first instinct is to make contradiction detection a pure graph query: build cognee's knowledge graph, then look for the same entity+attribute with different values across sources. Elegant, but it breaks on a real local stack (llama3.1:8b via Ollama). Two failures show up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The knowledge graph flattens quantities.&lt;/strong&gt; The extractor turns "50,000 requests per second" into a generic &lt;code&gt;requests per second&lt;/code&gt; node and drops the number. The conflicting values never make it into the graph.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Entities get merged across sources.&lt;/strong&gt; Every mention of FooDB collapses to one node, so the two throughput claims dedup into a single edge — nothing left to compare.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So the graph is great for storage, visualization, and cited retrieval, but it can't be the &lt;em&gt;source of truth&lt;/em&gt; for a quantitative contradiction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: extract faithful claims, judge them structurally
&lt;/h2&gt;

&lt;p&gt;Crosscheck reads claims straight from each source's raw text — a thin, flat &lt;code&gt;(subject, predicate, object)&lt;/code&gt; extraction that keeps the number verbatim and tags it with the source id and timestamp. Extracting one value is easy even for a small local model, unlike a full graph schema. Then a two-stage engine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Structural pre-filter:&lt;/strong&gt; group claims by normalized (subject, predicate); flag pairs with the same key, different value, different source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM judge:&lt;/strong&gt; confirm each candidate actually contradicts ("cannot both be true"), with the reason.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On the FooDB pack this fires exactly once: 50k (2021) vs 10k (2024), confirmed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making cognee survive a weak local model
&lt;/h2&gt;

&lt;p&gt;Getting the graph to build at all on llama3.1:8b took three settings, all in &lt;code&gt;.env.example&lt;/code&gt;: switch cognee's structured-output framework to &lt;strong&gt;BAML&lt;/strong&gt; (its schema-aligned parsing tolerates loose JSON), neutralize the fragile chunk &lt;strong&gt;summarization&lt;/strong&gt; task (which small models can't satisfy and which Crosscheck doesn't use), and turn off &lt;strong&gt;multi-user access control&lt;/strong&gt; so a direct graph read sees the whole store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-improving
&lt;/h2&gt;

&lt;p&gt;A thin gap finder ranks sparsely-connected nodes and asks the LLM for the next research question — so the copilot tells you what it's missing. Everything persists in cognee's stores, so a fresh process re-answers without re-ingesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same engine, a second product: Argus
&lt;/h2&gt;

&lt;p&gt;Once the contradiction engine existed, it turned out to be domain-agnostic — "the same fact, two sources, two different values" is a shape that shows up far beyond research. So we pointed it at money. &lt;strong&gt;Argus&lt;/strong&gt; is a spend &amp;amp; contract &lt;em&gt;leakage*auditor: a contract line ("early-pay credit due: $2,400") and an invoice line ("credit applied: $0") are just a contradiction with a dollar gap. Argus reuses Crosscheck's &lt;code&gt;claims&lt;/code&gt; + &lt;code&gt;contradictions&lt;/code&gt; code **unchanged&lt;/em&gt;* and adds one thing — a deterministic dollar-impact number on each finding. On a small demo pack it surfaces $5,300 in leakage across three issues, each with the exact documents and dates a finance team could act on. Same engine, a completely different problem — which is the real point: catching sources that disagree is a primitive, not a feature.&lt;/p&gt;

&lt;p&gt;Runs fully offline on Ollama; an OpenAI or Gemini key is a drop-in alternative.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/CodeMuscle/crosscheck" rel="noopener noreferrer"&gt;https://github.com/CodeMuscle/crosscheck&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>opensource</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
