<?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>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>
