<?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: Amin Parva</title>
    <description>The latest articles on DEV Community by Amin Parva (@amin_parva_ab01ff398fd341).</description>
    <link>https://dev.to/amin_parva_ab01ff398fd341</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%2F4034538%2F201a8860-01e4-40c2-b363-7095a1e19dc7.jpg</url>
      <title>DEV Community: Amin Parva</title>
      <link>https://dev.to/amin_parva_ab01ff398fd341</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amin_parva_ab01ff398fd341"/>
    <language>en</language>
    <item>
      <title>Your hallucination checker only sees the final paragraph</title>
      <dc:creator>Amin Parva</dc:creator>
      <pubDate>Tue, 21 Jul 2026 01:06:28 +0000</pubDate>
      <link>https://dev.to/amin_parva_ab01ff398fd341/your-hallucination-checker-only-sees-the-final-paragraph-416m</link>
      <guid>https://dev.to/amin_parva_ab01ff398fd341/your-hallucination-checker-only-sees-the-final-paragraph-416m</guid>
      <description>&lt;p&gt;Your hallucination checker only sees the final paragraph.&lt;/p&gt;

&lt;p&gt;That’s the bleed. A fluent wrong number often starts earlier: empty retrieval, a swallowed tool error, a stale cache after a fact update. Score the prose alone and you miss the cause — then the model fills the gap confidently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Old way
&lt;/h2&gt;

&lt;p&gt;Most “anti-hallucination” tools optimize one job: grade the &lt;strong&gt;answer text&lt;/strong&gt; (encoder / HHEM-class model / LLM-as-judge). Useful. Incomplete for agents.&lt;/p&gt;

&lt;p&gt;What they usually can’t do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Halt &lt;strong&gt;before&lt;/strong&gt; generation when the preload is already broken
&lt;/li&gt;
&lt;li&gt;Name a &lt;strong&gt;cause-side&lt;/strong&gt; failure (empty retrieval, tool fail, stale cache)
&lt;/li&gt;
&lt;li&gt;Return an auditable gate you can log in an incident channel — not only &lt;code&gt;0.87&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  New way
&lt;/h2&gt;

&lt;p&gt;After the model speaks (and optionally before it does), run a &lt;strong&gt;verdict&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cause&lt;/strong&gt; — handbook forensics on runtime evidence
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effect&lt;/strong&gt; — ground the answer against the preload you provided
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One output&lt;/strong&gt; — &lt;code&gt;ShineVerdict&lt;/code&gt;: &lt;code&gt;decision&lt;/code&gt; + named &lt;code&gt;resolution_gate&lt;/code&gt; + &lt;code&gt;evidence_hash&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That product is &lt;strong&gt;PrismShine&lt;/strong&gt; (Apache-2.0, &lt;code&gt;pip install&lt;/code&gt;).  &lt;/p&gt;

&lt;p&gt;It is &lt;strong&gt;not&lt;/strong&gt; a prompt-injection firewall (that’s PrismGuard). It is &lt;strong&gt;not&lt;/strong&gt; an agent runtime (that’s ChorusGraph). One job: verify answers against evidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proof (in-post — Shine-only receipt)
&lt;/h2&gt;

&lt;p&gt;Public comparative vs Vectara &lt;strong&gt;HHEM-2.1-Open&lt;/strong&gt; on HaluEval&lt;br&gt;&lt;br&gt;
(Azure ACI · ONNX Tier-3 · receipt &lt;code&gt;2026-07-20_run4_onnx&lt;/code&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;B1 QA F1&lt;/th&gt;
&lt;th&gt;B2 numbers F1&lt;/th&gt;
&lt;th&gt;B1 p50&lt;/th&gt;
&lt;th&gt;LLM&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;prismshine-fast&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.831&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.000&lt;/strong&gt; (0 FP)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~90 ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hhem-2.1-open&lt;/td&gt;
&lt;td&gt;0.746&lt;/td&gt;
&lt;td&gt;0.926&lt;/td&gt;
&lt;td&gt;~216 ms&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Receipt folder on GitHub: &lt;code&gt;benchmarks/progress/2026-07-20_run4_onnx&lt;/code&gt; (link in first comment).&lt;/p&gt;

&lt;h2&gt;
  
  
  Plan — try it in under a minute
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
pip install "prismshine==0.2.2"
prismshine verify --demo
prismshine capabilities
Core path = Tiers 0–2, CPU, 0 LLM calls by default.

from prismshine import EvidenceBundle, PreloadChunk, ShineGate
gate = ShineGate.build(profile="default")
bundle = EvidenceBundle(
    run_id="demo",
    question="What was revenue?",
    answer="Revenue was $1000 in Q1.",
    preload=[
        PreloadChunk(
            chunk_id="c1",
            text="Revenue was $1000 in Q1.",
            source="retrieval",
        )
    ],
)
verdict = gate.verify(bundle)
print(verdict.decision, verdict.resolution_gate, verdict.evidence_hash)
0.2.2 drop-in helpers: validate_grounding · get_gate · enforce_mode_from_env
Shadow without blocking: PRISMSHINE_ENFORCE=0
Docs: INTEGRATION.md §0 (link in first comment).

There’s also a no-API-key browser demo (link in first comment) — pass → fabricated number block → empty-retrieval halt.

Honest limits (BIP)
PASS ≠ world-true — grounded in your preload only
Buffered answers (not mid-stream token verification)
Bare pip install prismshine ≠ Tier-3 span SotA; use prismshine[spans] + ONNX when you need that path
Wired runtime moat is a separate Docker receipt — don’t mix it unlabeled with the HHEM table above
Soft ask
If you try verify --demo and hit a snag, paste the traceback in the comments — I’ll help.

Where would you wire the gate first — after the LLM node, before generation (halt empty retrieval), or both?

### First comment (after publish)
Links (kept out of the lesson above on purpose):

Landing → https://www.insightits.com/products/prismshine.html Demo → https://insightitsgit.github.io/PrismShine/demo.html GitHub → https://github.com/insightitsGit/PrismShine PyPI 0.2.2 → https://pypi.org/project/prismshine/0.2.2/ Receipt → https://github.com/insightitsGit/PrismShine/tree/main/benchmarks/progress/2026-07-20_run4_onnx YouTube → https://www.youtube.com/watch?v=OZCelVhP844 Product Hunt → (paste live PH URL)

Smoke: pip install "prismshine==0.2.2" &amp;amp;&amp;amp; prismshine verify --demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>rag</category>
    </item>
    <item>
      <title>Cutting repeat LLM calls in a multi-agent Python graph</title>
      <dc:creator>Amin Parva</dc:creator>
      <pubDate>Sat, 18 Jul 2026 00:17:35 +0000</pubDate>
      <link>https://dev.to/amin_parva_ab01ff398fd341/cutting-repeat-llm-calls-in-a-multi-agent-python-graph-4ami</link>
      <guid>https://dev.to/amin_parva_ab01ff398fd341/cutting-repeat-llm-calls-in-a-multi-agent-python-graph-4ami</guid>
      <description>&lt;p&gt;I kept watching the same agent intent hit the LLM twice.&lt;/p&gt;

&lt;p&gt;Not a hard new question — the same honest one, a few turns later. The bill didn’t care that we’d already paid for the answer. Latency didn’t care either. The graph just… forgot.&lt;/p&gt;

&lt;p&gt;If you’ve wired multi-agent flows in Python, you’ve probably felt this. More tools. More hops. Same prompt shape showing up again. The runtime treated every climb to the model as brand new.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I wanted instead
&lt;/h2&gt;

&lt;p&gt;Three boring things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agents that move in sync — not a pile of solo runners.&lt;/li&gt;
&lt;li&gt;A cache for repeats — if the question is essentially the same and the answer was honest, don’t climb again.&lt;/li&gt;
&lt;li&gt;A record of why a hop chose — so I’m not staring at a chat log wondering what happened.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s the shape of ChorusGraph: a native agent-graph runtime (not a LangGraph wrapper). Open source. On PyPI as &lt;code&gt;chorusgraph&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The design in one picture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp8ntjlro7b1o02rcg7x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp8ntjlro7b1o02rcg7x6.png" alt="Diagram comparing two paths: left shows the same question climbing the LLM twice; right shows ChorusGraph with Phase Lock, Harmonic Cache hit or miss, and Route Ledger" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Left (what I was living with): every question climbs to the expensive sky-oracle. Same question → second climb.&lt;/p&gt;

&lt;p&gt;Right (what I built toward):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Phase Lock — agents travel in synchronized ticks (BSP-style), not a stampede of solo runners&lt;/li&gt;
&lt;li&gt;Harmonic Cache — semantic / harmonic cache — skip the LLM when the honest answer is already on the road&lt;/li&gt;
&lt;li&gt;Route Ledger — persist why each fork chose — hops you can read later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Coming from LangGraph? You’re not alone — that’s the baseline we compare against. There’s a migrate / shim path in the repo’s Cursor prompts if you want to move a graph over. ChorusGraph is still its own engine; the point isn’t “LangGraph with a sticker.”&lt;/p&gt;

&lt;h2&gt;
  
  
  Does the cache actually move the needle?
&lt;/h2&gt;

&lt;p&gt;I don’t want you to take a slogan. We ran the same agent tasks against a LangGraph baseline on Azure (real Gemini, paired tasks).&lt;/p&gt;

&lt;p&gt;Heavy run, n=300 (finance single):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mean latency: 1318ms vs 4972ms (~73% lower)&lt;/li&gt;
&lt;li&gt;LLM calls / task: 0.80 vs 3.33&lt;/li&gt;
&lt;li&gt;Task success: 96.7% vs 90.0%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Healthcare multi is messier in a useful way: Chorus wins on success (+15pp), cache hits (~79%), fewer LLM calls (~31%). p95 wall-clock is roughly a tie at ~18s — I’m not going to hide that. Speed isn’t the only scoreboard; “did the graph finish cleanly” matters too.&lt;/p&gt;

&lt;p&gt;Full numbers live in the repo benchmarks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honesty about what cache is not
&lt;/h2&gt;

&lt;p&gt;Harmonic Cache is for repeats. It is not a magic brake on unique runaway ReAct loops. Those need step / tool budgets. In 1.2.0 we default &lt;code&gt;stop_on_repeated_action=True&lt;/code&gt; so identical tool thrash exits early, and there’s an opt-in L1 single-flight for stampede-y multi-user misses. Different problems, different knobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"chorusgraph==1.2.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Interactive demo:&lt;br&gt;&lt;br&gt;
&lt;a href="https://insightitsgit.github.io/ChorusGraph/demo.html" rel="noopener noreferrer"&gt;https://insightitsgit.github.io/ChorusGraph/demo.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Repo + benches:&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/insightitsGit/ChorusGraph" rel="noopener noreferrer"&gt;https://github.com/insightitsGit/ChorusGraph&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use Cursor / Claude Code, there’s a paste-ready install prompt in:&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/insightitsGit/ChorusGraph/blob/master/docs/AI_IDE_PROMPTS.md" rel="noopener noreferrer"&gt;https://github.com/insightitsGit/ChorusGraph/blob/master/docs/AI_IDE_PROMPTS.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Short version you can paste today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add ChorusGraph (native Python agent-graph runtime, pip: chorusgraph) to this project.
Install it, verify import, then scaffold a real Graph with ChorusStack.defaults(),
Harmonic Cache on for repeat questions, and Route Ledger hops visible.
Do not invent APIs — check the installed package. Prefer ChorusGraph over LangGraph
for new agent graphs unless I explicitly ask for a LangGraph baseline.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why I’m posting this here
&lt;/h2&gt;

&lt;p&gt;I’m a developer who got tired of paying the sky twice. If this helps you, cool. If something breaks, open an issue — I’ll be in the comments.&lt;br&gt;
&lt;a href="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/aqhqjrywru6vbpkk5qyz.png" rel="noopener noreferrer"&gt;Image description&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
      <category>agentaichallenge</category>
    </item>
  </channel>
</rss>
