<?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: Abu Bakar Siddik</title>
    <description>The latest articles on DEV Community by Abu Bakar Siddik (@abubakarsiddik).</description>
    <link>https://dev.to/abubakarsiddik</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%2F2235214%2Ffa7dcfd8-28b9-4cd9-8849-a1c0495cc770.jpeg</url>
      <title>DEV Community: Abu Bakar Siddik</title>
      <link>https://dev.to/abubakarsiddik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abubakarsiddik"/>
    <language>en</language>
    <item>
      <title>Go AI Agent Framework With Retries, Budgets and Human Approval</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Fri, 27 Nov 2026 09:10:58 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/go-ai-agent-framework-with-retries-budgets-and-human-approval-2l9b</link>
      <guid>https://dev.to/abubakarsiddik/go-ai-agent-framework-with-retries-budgets-and-human-approval-2l9b</guid>
      <description>&lt;p&gt;One of my team's main projects has an AI-heavy backend written in Go. I work mostly in Python, where agent frameworks are mature, so I know what the Go side was missing: an agent that's a normal value inside the service, not a Python process reached over a queue. The loop itself takes an afternoon. Deciding what happens at each place it can break is what became &lt;a href="https://github.com/abubakarsiddik31/golem" rel="noopener noreferrer"&gt;Golem&lt;/a&gt;, an open-source Go AI agent framework.&lt;/p&gt;

&lt;p&gt;This post is about that second part: bad tool calls, provider errors, loops, cost and human sign-off, and where each one lands in a run. It also covers how Golem compares with the other Go options and when you should pick something else. It describes v1.2.0, released on 16 November 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  What breaks once the agent loop is running?
&lt;/h2&gt;

&lt;p&gt;The loop is short. The model reads a conversation, asks for a tool, you run it, you feed the result back and repeat until the model answers. Each step then fails in its own way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The provider returns a 429 or a 503 halfway through a run.&lt;/li&gt;
&lt;li&gt;The model calls a tool with arguments that don't match your schema.&lt;/li&gt;
&lt;li&gt;The model returns JSON that is almost the shape you asked for.&lt;/li&gt;
&lt;li&gt;The model asks for the same tool call again and again.&lt;/li&gt;
&lt;li&gt;A tool needs a person to approve it before anything irreversible happens.&lt;/li&gt;
&lt;li&gt;A run dies on turn six and you lose the first five turns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Python has good answers to several of these. &lt;a href="https://ai.pydantic.dev" rel="noopener noreferrer"&gt;Pydantic AI&lt;/a&gt; showed that an agent can have typed dependencies and validated output, and I used it as a reference. But copying Python mechanisms into Go would have given me something un-Go-like: decorators are awkward, runtime validation hides what the compiler could check, and exceptions as control flow don't suit a language that returns errors. So the question I started from was what an agent should look like if you begin with Go's strengths.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Golem?
&lt;/h2&gt;

&lt;p&gt;Golem is an open-source Go library for building agents. The repository started on 16 August 2026, and v1.0.0 on 25 October 2026 froze the API under a rule written down in &lt;a href="https://github.com/abubakarsiddik31/golem/blob/main/docs/adr/0041-the-v1-freeze.md" rel="noopener noreferrer"&gt;ADR 0041&lt;/a&gt;: semantic versioning, additive changes only below v2, checked by an API diff against the previous tag.&lt;/p&gt;

&lt;p&gt;The short version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agents are generic: &lt;code&gt;Agent[Deps, Output]&lt;/code&gt;. Dependencies and the final output are real types.&lt;/li&gt;
&lt;li&gt;The module has no dependencies outside the standard library, and needs Go 1.26 or newer.&lt;/li&gt;
&lt;li&gt;Adapters cover OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, and local models through Ollama or LM Studio.&lt;/li&gt;
&lt;li&gt;An MCP client works over stdio and streamable HTTP, and an MCP server exposes one agent as a tool.&lt;/li&gt;
&lt;li&gt;Retries, fallback models, self-correction, usage limits, loop detection, streaming and run events are built in.&lt;/li&gt;
&lt;li&gt;A deterministic fake model lets you test agents offline.&lt;/li&gt;
&lt;li&gt;It ships with 39 guides, every example runs offline, and statement coverage is 81.6%.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go get github.com/abubakarsiddik31/golem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The layering is plain. Your service owns the dependencies, the core owns the run, and everything that touches the outside world sits behind a small interface.&lt;/p&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%2Fwf4lys2eztbd5190jgpq.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%2Fwf4lys2eztbd5190jgpq.png" alt="Your Go service calls the golem core, which talks to two ports: model.Model, implemented by provider adapters, and tool.Tool, implemented by MCP servers and common tools. The core imports only the standard library" width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why build agents in Go at all?
&lt;/h2&gt;

&lt;p&gt;Agent work is mostly waiting on a network, so it's fair to ask whether the language matters. I think it does once the agent leaves the notebook. An agent service holds many conversations at once, calls tools concurrently, streams tokens to clients and has to shut down cleanly. Goroutines, &lt;code&gt;context.Context&lt;/code&gt; and a single static binary fit that shape. A deployed agent can be one small container image with no interpreter, no virtualenv and no dependency tree to audit.&lt;/p&gt;

&lt;p&gt;The compiler is the second reason. When a tool depends on a database handle and a tenant ID, I want the compiler to tell me if I pass the wrong one. In Golem that's a type parameter, not a convention.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does a first agent look like?
&lt;/h2&gt;

&lt;p&gt;This is the smallest working agent, from the README:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;APIKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"OPENAI_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="s2"&gt;"gpt-4o-mini"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;panic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DecodeFunc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;panic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Background&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RunContext&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Why is Go ideal for AI agents?"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Tokens: %d input, %d output\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;InputTokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Usage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OutputTokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You build the agent once with &lt;code&gt;golem.New&lt;/code&gt; and run it many times. It needs a model and an output decoder, and the decoder is the line where untrusted model text becomes a value your program is willing to use. Everything else is an option function. The result carries the typed output, the full normalized conversation and cumulative token usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do typed tools and dependencies work?
&lt;/h2&gt;

&lt;p&gt;Most agent bugs I've seen live in tools. A tool needs a database, an HTTP client or a user identity, and frameworks often solve that with globals or closures, which makes tools hard to test. In Golem a tool is a typed value, and its &lt;code&gt;Exec&lt;/code&gt; function receives the run's dependency value directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Users&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;getUser&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MustNew&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Tool&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="s2"&gt;"get_user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Look up a user name by their ID."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Schema&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RawMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`{
        "type": "object",
        "properties": {"id": {"type": "integer"}},
        "required": ["id"]
    }`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Exec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RawMessage&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="no"&gt;ID&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="sb"&gt;`json:"id"`&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Unmarshal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Result&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Users&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"User not found"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decoder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WithTools&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RunContext&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Deps&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Database&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Users&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Alice"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Who is user 42?"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The schema is written by hand and the arguments arrive as raw JSON. That's deliberate. Arguments are untrusted model output, and I'd rather you see the validation than have reflection do it somewhere you can't read. It costs a few more lines per tool, and in return a tool's behavior is visible in the file where it's defined.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens when a run goes wrong?
&lt;/h2&gt;

&lt;p&gt;A Golem run is a transparent loop, and each failure has a named place to land.&lt;/p&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%2Fudcxxmp77i7y31mq45i8.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%2Fudcxxmp77i7y31mq45i8.png" alt="One Golem run: a prompt becomes a request, goes to the model and a usage check, then either runs tools and loops back or decodes a typed result. Tools and decoders can retry, fail, defer or cancel, and any step can end in a RunError that keeps the partial evidence" width="800" height="676"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How does an agent correct bad output?
&lt;/h3&gt;

&lt;p&gt;When the model returns bad output or bad tool arguments, the cheapest fix is often to say what was wrong and ask again. A decoder or tool does that by returning an error that wraps &lt;code&gt;*model.ModelRetry&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ModelRetry&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Errorf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"n must be positive, got %d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The run feeds that message back to the model. Self-correction is opt-in, with separate budgets from &lt;code&gt;WithOutputRetries&lt;/code&gt; and &lt;code&gt;WithToolRetries&lt;/code&gt;, so a model can't argue with your validator forever. With no budget, the same error fails the run at a named stage with its cause intact. A failure the model should simply see, like a missing file, is &lt;code&gt;&amp;amp;tool.Failed{Reason}&lt;/code&gt;: the model gets the reason as a tool result and no retry budget is spent.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you survive provider errors?
&lt;/h3&gt;

&lt;p&gt;Transient provider errors (408, 429, 5xx and transport faults) are retried with &lt;code&gt;WithMaxAttempts&lt;/code&gt;. The default is one attempt, so retries are opt-in. Backoff starts at 500 ms, doubles and caps at 30 seconds unless you supply your own. Tool and decode failures are never retried by this mechanism, since they aren't transport problems.&lt;/p&gt;

&lt;p&gt;When retrying isn't enough, &lt;code&gt;model.NewFallback(primary, backup)&lt;/code&gt; tries models in order. For streams there's one rule: a fallback only happens before the first fragment is forwarded, because after the caller has seen output, switching models would replay it.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you stop a runaway agent?
&lt;/h3&gt;

&lt;p&gt;Two limits cover it. &lt;code&gt;golem.UsageLimit&lt;/code&gt; bounds input, output and total tokens, model requests and tool calls, and a dollar cost if you supply a price table with &lt;code&gt;WithPrice&lt;/code&gt;. Token counts come from the provider's reported usage, so a token limit only trips when the provider reports usage, while requests and tool calls are counted by the run itself. Pricing is yours to supply, because I don't want to ship a table that goes stale between releases, and the library says plainly that the cost estimate is only as good as your rates and isn't a billing guarantee.&lt;/p&gt;

&lt;p&gt;The second limit is loop detection, added in v1.2.0 (&lt;a href="https://github.com/abubakarsiddik31/golem/blob/main/docs/adr/0051-loop-detection.md" rel="noopener noreferrer"&gt;ADR 0051&lt;/a&gt;). &lt;code&gt;WithLoopDetection(maxRepeats)&lt;/code&gt; counts calls to the same tool with canonically equal arguments across the whole run, and fails the run before the offending call executes. That ordering is the point: a model that polls a tool can't repeat a side effect while you wait for the check. &lt;code&gt;WithLoopPolicy&lt;/code&gt; adds checks for repeated results, alternating A-B calls and repeated final text, with a choice between stopping the run and nudging the model.&lt;/p&gt;

&lt;p&gt;Oversized tool output is the quieter cost. &lt;code&gt;WithToolOutputLimit&lt;/code&gt; caps a tool result before it enters the conversation, keeps the head and tail, and appends a marker with the original size (&lt;a href="https://github.com/abubakarsiddik31/golem/blob/main/docs/adr/0050-tool-output-limits.md" rel="noopener noreferrer"&gt;ADR 0050&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  What do you keep when a run fails?
&lt;/h3&gt;

&lt;p&gt;When a run fails on turn six, you still want turns one to five. Golem attaches them to the error as &lt;code&gt;RunError.Partial&lt;/code&gt;: the conversation through the last completed turn, the usage so far and the counts of requests and tool executions. Pass &lt;code&gt;Partial.Messages&lt;/code&gt; to &lt;code&gt;RunWithHistory&lt;/code&gt; to resume instead of starting over, which matters when the run has already spent real money.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does an agent wait for a person?
&lt;/h3&gt;

&lt;p&gt;Some tools shouldn't run without sign-off: deleting files, moving money, sending email. A tool defers by returning an error wrapping &lt;code&gt;*tool.Deferred&lt;/code&gt;, of kind &lt;code&gt;tool.DeferApproval&lt;/code&gt; or &lt;code&gt;tool.DeferExternal&lt;/code&gt;. The other tool calls in that batch execute, and &lt;code&gt;Run&lt;/code&gt; returns successfully with &lt;code&gt;Result.Pending&lt;/code&gt; listing what's waiting. No further model call happens.&lt;/p&gt;

&lt;p&gt;You resume with &lt;code&gt;RunWithDeferredResults&lt;/code&gt;, passing the paused conversation and a decision for each pending call. Approved calls run, denied calls tell the model it was denied, and external results are inserted as given. Because a pause is a returned value, you can store it, show it in a UI and resume it hours later from another process. The reasoning behind that boundary is in &lt;a href="https://abubakar-siddik.com/essays/can-we-really-make-ai-safe" rel="noopener noreferrer"&gt;the case for keeping meaningful actions with people&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Can a Go agent use MCP?
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt; is now the usual way to expose tools to agents, so Golem includes a client. &lt;code&gt;mcp.NewStdio&lt;/code&gt; starts a server as a subprocess, &lt;code&gt;mcp.NewHTTP&lt;/code&gt; connects to a remote endpoint, and &lt;code&gt;mcp.AsTools&lt;/code&gt; turns the server's tool list into ordinary &lt;code&gt;tool.Tool&lt;/code&gt; values with the server's own schema. A server error flagged as &lt;code&gt;isError&lt;/code&gt; comes back as a correctable &lt;code&gt;ModelRetry&lt;/code&gt;, and protocol or transport failures fail the run instead of being quietly corrected.&lt;/p&gt;

&lt;p&gt;The guide says one thing I agree with: don't reach for MCP when a typed Go tool is one function away. A subprocess speaking JSON-RPC has more moving parts than a function call.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you test an agent without a model?
&lt;/h2&gt;

&lt;p&gt;Agent tests are usually flaky (a real provider) or meaningless (mocked HTTP). Golem ships &lt;code&gt;testmodel&lt;/code&gt;, a scripted in-memory model that plays back the responses you queue and records the exact request the agent sent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;testmodel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nc"&gt;Role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RoleAssistant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"pong"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decoder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Background&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;golem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RunContext&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ping"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can assert on the normalized request, the ordered messages in &lt;code&gt;Result.Messages&lt;/code&gt; and which stage failed, with no network, keys or sleeps. The repository's CI runs its suite with the race detector, plus a fuzz target on the message JSON format.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it compare with other Go agent frameworks?
&lt;/h2&gt;

&lt;p&gt;I compared Golem with the three other Go options I'd look at: &lt;a href="https://github.com/tmc/langchaingo" rel="noopener noreferrer"&gt;langchaingo&lt;/a&gt;, &lt;a href="https://github.com/cloudwego/eino" rel="noopener noreferrer"&gt;Eino&lt;/a&gt; and &lt;a href="https://github.com/firebase/genkit" rel="noopener noreferrer"&gt;Genkit&lt;/a&gt; for Go. I read each repository's source tree and &lt;code&gt;go.mod&lt;/code&gt; on 27 November 2026. Dependency counts are the non-indirect lines in the require block, so they're approximate, and frameworks move fast, so check upstream before you depend on a detail.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Golem&lt;/th&gt;
&lt;th&gt;langchaingo&lt;/th&gt;
&lt;th&gt;Eino&lt;/th&gt;
&lt;th&gt;Genkit (Go)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Direct dependencies&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;About 60&lt;/td&gt;
&lt;td&gt;About 10&lt;/td&gt;
&lt;td&gt;About 40&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;License&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;td&gt;MIT&lt;/td&gt;
&lt;td&gt;Apache-2.0&lt;/td&gt;
&lt;td&gt;Apache-2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP client&lt;/td&gt;
&lt;td&gt;In the core module&lt;/td&gt;
&lt;td&gt;Not in the repository&lt;/td&gt;
&lt;td&gt;Separate &lt;code&gt;eino-ext&lt;/code&gt; module&lt;/td&gt;
&lt;td&gt;Plugin in the repository, client and server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pause for human approval&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;tool.Deferred&lt;/code&gt;, resumable&lt;/td&gt;
&lt;td&gt;Not found&lt;/td&gt;
&lt;td&gt;Interrupt and resume in &lt;code&gt;adk&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Tool approval middleware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Retry and model fallback&lt;/td&gt;
&lt;td&gt;Built into the run&lt;/td&gt;
&lt;td&gt;Not found&lt;/td&gt;
&lt;td&gt;Retry and failover in &lt;code&gt;adk&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Retry and fallback middleware&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Design centre&lt;/td&gt;
&lt;td&gt;One explicit agent loop with typed dependencies&lt;/td&gt;
&lt;td&gt;LangChain-style chains and agents&lt;/td&gt;
&lt;td&gt;Graph and workflow composition&lt;/td&gt;
&lt;td&gt;Flows with OpenTelemetry tracing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things stand out. Golem is the only one with no dependencies outside the standard library, and the only one where a tool receives a typed dependency value for the run. I haven't found an equivalent of &lt;code&gt;RunContext[Deps]&lt;/code&gt; in the others, but I haven't audited every API, so read that as what I found, not a proof.&lt;/p&gt;

&lt;p&gt;The other half is that Golem is not alone on the guardrails. Genkit's Go module ships MCP, retry, fallback and tool approval as plugins and middleware, and Eino's &lt;code&gt;adk&lt;/code&gt; package has retry, failover and interrupt-and-resume. Only langchaingo lacks them in the repositories I read. The Golem README understated Genkit on this.&lt;/p&gt;

&lt;p&gt;The others are ahead in other places. Eino's graph model is more expressive than Golem's linear loop for branching, parallel and multi-agent pipelines, and it has more community components. langchaingo covers more providers and vector stores. Genkit has first-party Google tooling and tight Gemini integration. What Golem offers is a smaller surface: one runtime for a single agent inside a service, with the controls in the core module instead of in add-on packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  When should you pick something else?
&lt;/h2&gt;

&lt;p&gt;Pick Golem if you want agents inside a Go service, typed dependencies, a module with nothing else to audit and tests that run offline. Pick something else if your agent is mostly prompt experimentation, if you need a graph engine for complicated multi-agent pipelines, or if you need a large catalog of prebuilt integrations today. Python is still ahead on that last one, and I won't pretend otherwise. Golem also has no evaluation harness and no durable workflow engine, and v1.0.0 lists both as non-goals.&lt;/p&gt;

&lt;p&gt;Herbie, a self-hosted chat and workflow app I built, runs its Go backend on Golem. I don't have production numbers to publish yet, so everything above is design reasoning plus what the repository's tests and examples show.&lt;/p&gt;

&lt;p&gt;The documentation site has a guide for each feature, and &lt;code&gt;examples/&lt;/code&gt; has runnable programs for nearly all of them, several with no API key.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project page: &lt;a href="https://abubakar-siddik.com/projects/golem" rel="noopener noreferrer"&gt;the Golem overview and capability matrix&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Repository: &lt;a href="https://github.com/abubakarsiddik31/golem" rel="noopener noreferrer"&gt;github.com/abubakarsiddik31/golem&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://abubakarsiddik31.github.io/golem/" rel="noopener noreferrer"&gt;abubakarsiddik31.github.io/golem&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;API reference: &lt;a href="https://pkg.go.dev/github.com/abubakarsiddik31/golem" rel="noopener noreferrer"&gt;pkg.go.dev/github.com/abubakarsiddik31/golem&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Issues and pull requests are welcome. If you try it and something feels un-Go-like, I want to hear about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is Golem?&lt;/strong&gt;&lt;br&gt;
Golem is an open-source AI agent framework for Go. It provides typed agents, tools with dependency injection, structured output, MCP support, and controls like retries, usage limits, loop detection and human approval.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does Golem have external dependencies?&lt;/strong&gt;&lt;br&gt;
No. It uses only the Go standard library.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which LLM providers does it support?&lt;/strong&gt;&lt;br&gt;
OpenAI, Anthropic, Google Gemini, AWS Bedrock, Azure OpenAI, and local models through Ollama, LM Studio or any OpenAI-compatible endpoint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I test agents without calling an API?&lt;/strong&gt;&lt;br&gt;
Yes. The &lt;code&gt;testmodel&lt;/code&gt; package gives you a deterministic fake model, and the examples run offline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does it support MCP?&lt;/strong&gt;&lt;br&gt;
Yes. The &lt;code&gt;mcp&lt;/code&gt; package is a client for stdio and streamable HTTP servers, and &lt;code&gt;mcpserver&lt;/code&gt; exposes an agent as an MCP tool.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://abubakar-siddik.com/essays/golem-go-ai-agent-framework" rel="noopener noreferrer"&gt;abubakar-siddik.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>ai</category>
      <category>opensource</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Connection Pool Exhausted by Slow LLM Calls: 50 to 1,500 Users</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Fri, 27 Nov 2026 08:12:39 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/connection-pool-exhausted-by-slow-llm-calls-50-to-1500-users-1gd2</link>
      <guid>https://dev.to/abubakarsiddik/connection-pool-exhausted-by-slow-llm-calls-50-to-1500-users-1gd2</guid>
      <description>&lt;p&gt;A connection pool runs dry under LLM load because requests hold connections while they wait, not because the pool is small.&lt;/p&gt;

&lt;p&gt;We fixed it in two steps: release the database connection before the slow LLM call, then move pooling into PgBouncer's statement mode. That took our backend from about 50 to about 1,500 concurrent AI requests on 20-25 database connections. This post is for engineers running long LLM requests on FastAPI, SQLAlchemy and Postgres. It covers what failed, what fixed it and what it costs.&lt;/p&gt;

&lt;p&gt;The numbers come from our own load tests, which stopped at 1,500 concurrent requests for a backend with 10,000 total users. We haven't gone beyond that. A team did this work, and I'm writing up what we learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did our connection pool run out at 50 concurrent requests?
&lt;/h2&gt;

&lt;p&gt;The app worked until about 50 requests ran at once. Then it slowed down, and it took us weeks to see why: each request held a database connection while it did AI work, so the pool became a hard ceiling.&lt;/p&gt;

&lt;p&gt;We used &lt;a href="https://fastapi.tiangolo.com/tutorial/dependencies/" rel="noopener noreferrer"&gt;FastAPI's dependency injection&lt;/a&gt; to open one session per request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/chat"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;get_session&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's fine for a normal API. Our AI requests were different, because each one was an &lt;a href="https://abubakar-siddik.com/essays/golem-go-ai-agent-framework" rel="noopener noreferrer"&gt;agent run that could outlive the request&lt;/a&gt;. One looked like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user submits a query, the session opens and a connection is acquired.&lt;/li&gt;
&lt;li&gt;We retrieve context from vectors (5-10 seconds, connection idle).&lt;/li&gt;
&lt;li&gt;We call the LLM (10-30 seconds, connection still idle).&lt;/li&gt;
&lt;li&gt;The agent refines the response (5 seconds, connection still idle).&lt;/li&gt;
&lt;li&gt;The session closes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The connection did almost no work and was held for the whole request. With 50 users at once, 50 connections sat idle, the pool filled up and new requests queued behind them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you check whether your requests hold connections while they wait?
&lt;/h2&gt;

&lt;p&gt;Ask Postgres while a load test runs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="cm"&gt;(*)
FROM pg_stat_activity
WHERE datname = current_database()
GROUP BY state;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://www.postgresql.org/docs/current/monitoring-stats.html" rel="noopener noreferrer"&gt;Postgres docs&lt;/a&gt; define &lt;code&gt;idle in transaction&lt;/code&gt; as a backend in a transaction that isn't executing a query, and &lt;code&gt;idle&lt;/code&gt; as one waiting for a new client command. If many connections sit in either state while requests are inside an LLM call, you're holding connections you aren't using. Which state you see depends on when your session opens its transaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why doesn't a bigger application-level pool fix it?
&lt;/h2&gt;

&lt;p&gt;Pooling exists because a new connection is expensive. Each one opens a TCP socket, negotiates TLS, authenticates and initializes a session before any query runs.&lt;/p&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%2Fycxgs71uhrzjwu80o0u4.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%2Fycxgs71uhrzjwu80o0u4.png" alt="Four setup steps run before the first query on a new Postgres connection: TCP handshake, TLS negotiation, authentication and session setup, together roughly 10 to 50 milliseconds" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Setup usually takes 10-50ms, depending on network latency and database load, and PostgreSQL also starts &lt;a href="https://www.postgresql.org/docs/current/connect-estab.html" rel="noopener noreferrer"&gt;a separate backend process for every connection&lt;/a&gt;, so thousands of open connections cost memory long before the database is busy. A pool keeps connections open and lends them out to skip that cost.&lt;/p&gt;

&lt;p&gt;The first thing we tried was &lt;a href="https://docs.sqlalchemy.org/en/20/core/pooling.html" rel="noopener noreferrer"&gt;SQLAlchemy's built-in pool&lt;/a&gt;, which keeps &lt;code&gt;pool_size&lt;/code&gt; connections open and allows &lt;code&gt;max_overflow&lt;/code&gt; extra ones under load. A typical configuration looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"postgresql://user:password@localhost/db"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;poolclass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;QueuePool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;pool_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="c1"&gt;# keep 20 connections open&lt;/span&gt;
    &lt;span class="n"&gt;max_overflow&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;# allow up to 10 more&lt;/span&gt;
    &lt;span class="n"&gt;pool_pre_ping&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;  &lt;span class="c1"&gt;# test a connection before using it&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ours was a pool of 25, and we kept exhausting it. Bigger pools hit the same wall. At 1,500 concurrent requests, each holding a connection for 20-40 seconds, we'd have been 60 times over capacity. A pool only helps if connections come back quickly, and ours stayed checked out for the whole request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you stop holding a connection while the LLM works?
&lt;/h2&gt;

&lt;p&gt;Do this first, because it needs no new infrastructure. The one-session-per-endpoint pattern was the real bottleneck, so we changed when code asks for a connection: do the AI work with no database access, then open a session, write and close it straight away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/agentic-rag"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;agentic_rag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# 1. AI work, no database access&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;retrieve_rag_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 10s&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 20s&lt;/span&gt;

    &lt;span class="c1"&gt;# 2. Now we need the database: get it, use it, release it&lt;/span&gt;
    &lt;span class="n"&gt;session&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Session&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ChatLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"response"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fib0f9liu06n28jm7wpw7.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%2Fib0f9liu06n28jm7wpw7.png" alt="Two timelines of one AI request. Before, a database connection is held through retrieval, the LLM call and refinement. After, no connection is held until a short write at the end" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Which PgBouncer pool mode fits long-running AI requests?
&lt;/h2&gt;

&lt;p&gt;Releasing connections early shortens how long each one is held. &lt;a href="https://www.pgbouncer.org/config.html" rel="noopener noreferrer"&gt;PgBouncer&lt;/a&gt; then shares a small set of server connections across every application process. It sits between the application and PostgreSQL, and its &lt;code&gt;pool_mode&lt;/code&gt; decides when a connection goes back to the pool:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Connection is released&lt;/th&gt;
&lt;th&gt;Fits&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Session&lt;/td&gt;
&lt;td&gt;When the client disconnects&lt;/td&gt;
&lt;td&gt;Web apps with login and logout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transaction&lt;/td&gt;
&lt;td&gt;When the transaction finishes&lt;/td&gt;
&lt;td&gt;Traditional REST APIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Statement&lt;/td&gt;
&lt;td&gt;When the query finishes&lt;/td&gt;
&lt;td&gt;Long-running AI workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&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%2Ftkfav82fvafmofcf5yot.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%2Ftkfav82fvafmofcf5yot.png" alt="Left, two application processes each keep their own pool and open many connections to Postgres. Right, the processes connect to PgBouncer, which keeps a small shared set of connections to Postgres" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Transaction mode wasn't enough. If you call an LLM inside a transaction, the connection stays held and idle for the whole call. Statement mode releases it the moment the query finishes, even though the request is still running.&lt;/p&gt;

&lt;p&gt;The cost is real. The PgBouncer docs say transactions spanning multiple statements are disallowed in this mode, so each statement has to stand alone. Code that expects several statements to roll back together no longer works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Don't do this in statement mode&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ProcessLog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flush&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# connection goes back to the pool&lt;/span&gt;

&lt;span class="nf"&gt;external_api_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# no connection held here&lt;/span&gt;

&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ProcessResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# may use a different connection&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How do you set up PgBouncer for this?
&lt;/h2&gt;

&lt;p&gt;Deploy PgBouncer on a dedicated server or container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d \
  -v /path/to/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini \
  -p 6432:6432 \
  pgbouncer:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set statement mode in &lt;code&gt;pgbouncer.ini&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;pool_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;statement&lt;/span&gt;
&lt;span class="na"&gt;max_client_conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;
&lt;span class="na"&gt;default_pool_size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;default_pool_size&lt;/code&gt; is the number of server connections per user and database pair, and &lt;code&gt;max_client_conn&lt;/code&gt; is how many clients may connect to PgBouncer itself. Both are in the &lt;a href="https://www.pgbouncer.org/config.html" rel="noopener noreferrer"&gt;PgBouncer config reference&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then turn off application-level pooling. SQLAlchemy's &lt;code&gt;NullPool&lt;/code&gt; opens a connection on checkout and closes it on release, so PgBouncer does all the pooling:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;create_engine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"DATABASE_URL"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# points at PgBouncer&lt;/span&gt;
    &lt;span class="n"&gt;poolclass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;NullPool&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The name "null pooling" comes from this SQLAlchemy class. Statement mode is the PgBouncer side of the same setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do you watch it in production?
&lt;/h2&gt;

&lt;p&gt;PgBouncer has an admin console. Connect with &lt;code&gt;psql&lt;/code&gt; and use the commands in the &lt;a href="https://www.pgbouncer.org/usage.html" rel="noopener noreferrer"&gt;usage docs&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql -h pgbouncer.internal -p 6432 -U pgbouncer -d pgbouncer
show pools&lt;span class="o"&gt;;&lt;/span&gt;    &lt;span class="c"&gt;# pool status&lt;/span&gt;
show clients&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c"&gt;# connected clients&lt;/span&gt;
show stats&lt;span class="o"&gt;;&lt;/span&gt;    &lt;span class="c"&gt;# performance statistics&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Likely cause&lt;/th&gt;
&lt;th&gt;What to do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"no more connections available"&lt;/td&gt;
&lt;td&gt;Pool exhausted&lt;/td&gt;
&lt;td&gt;Raise &lt;code&gt;max_client_conn&lt;/code&gt; and audit how long sessions stay open&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"connection lost" errors&lt;/td&gt;
&lt;td&gt;Stale server connections&lt;/td&gt;
&lt;td&gt;Check &lt;code&gt;server_check_query&lt;/code&gt; and &lt;code&gt;server_check_delay&lt;/code&gt; in PgBouncer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pool slowly fills up&lt;/td&gt;
&lt;td&gt;Connection leak&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;try/finally&lt;/code&gt; with &lt;code&gt;session.close()&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What did the load tests show?
&lt;/h2&gt;

&lt;p&gt;We load-tested the change from 50 up to 1,500 concurrent requests:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Max concurrency&lt;/td&gt;
&lt;td&gt;~50&lt;/td&gt;
&lt;td&gt;~1,500&lt;/td&gt;
&lt;td&gt;30x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database RAM&lt;/td&gt;
&lt;td&gt;3.5GB&lt;/td&gt;
&lt;td&gt;400MB&lt;/td&gt;
&lt;td&gt;~9x lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;P95 latency at 50 concurrent&lt;/td&gt;
&lt;td&gt;450ms&lt;/td&gt;
&lt;td&gt;95ms&lt;/td&gt;
&lt;td&gt;4.7x faster&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database connections&lt;/td&gt;
&lt;td&gt;250+&lt;/td&gt;
&lt;td&gt;20-25&lt;/td&gt;
&lt;td&gt;10x fewer&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  What to do first
&lt;/h2&gt;

&lt;p&gt;Run the &lt;code&gt;pg_stat_activity&lt;/code&gt; query above during a load test. If connections sit idle while requests wait on the LLM, release them before the call, and only then decide whether you need PgBouncer. Raising the pool size won't help.&lt;/p&gt;

&lt;p&gt;Thanks to the team I built this with.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://abubakar-siddik.com/essays/scaling-to-1500-concurrent-users-pgbouncer" rel="noopener noreferrer"&gt;abubakar-siddik.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>pgbouncer</category>
      <category>fastapi</category>
      <category>llm</category>
    </item>
    <item>
      <title>Gemini 4 Neon catches Opus 5.5, plus Anthropic's IPO</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Wed, 25 Nov 2026 14:02:09 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/gemini-4-neon-catches-opus-55-plus-anthropics-ipo-2ho6</link>
      <guid>https://dev.to/abubakarsiddik/gemini-4-neon-catches-opus-55-plus-anthropics-ipo-2ho6</guid>
      <description>&lt;p&gt;Hi, and welcome to the first Agent Notes. Every week I'll send what changed in AI, what it means if you build with it, and a few links worth your time. This one covers 15 to 21 November.&lt;/p&gt;

&lt;h2&gt;
  
  
  This week, briefly
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Story&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Neon&lt;/td&gt;
&lt;td&gt;Google's new model is #1 on the Artificial Analysis Coding Agent Index (58.6), priced at $3 per million input tokens and $15 per million output tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anthropic IPO&lt;/td&gt;
&lt;td&gt;$81.3B raised at $83 a share, the largest IPO on record&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Riemann Hypothesis&lt;/td&gt;
&lt;td&gt;Levent Alpöge and Claude released a 17-million-line Lean proof; the Lean and Mathlib communities confirmed it a day later&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Astra and Sol&lt;/td&gt;
&lt;td&gt;OpenAI's two new models; Astra beats GPT-6 Astra at under a third of the cost per task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inkling 2 Mini&lt;/td&gt;
&lt;td&gt;An open-weight model from Thinking Machines that runs on a 32 GB Mac, Apache 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The big one: Google is back in the coding race
&lt;/h2&gt;

&lt;p&gt;For a long time, Gemini took a lot of criticism from developers, and for serious coding work most people didn't take it seriously. The bar was Claude, and with Opus 5.5 that bar got high.&lt;/p&gt;

&lt;p&gt;I rate Opus 5.5 very highly. For me it fixed most of the problems I kept running into when coding with LLMs. So when people started saying a Google model was level with it, and some said better, I paid attention. That shift is the story of the week.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Google shipped
&lt;/h3&gt;

&lt;p&gt;Google released &lt;a href="https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-neon/" rel="noopener noreferrer"&gt;Gemini 4 Neon&lt;/a&gt; on 18 November. It is the middle model in the Gemini 4 line, priced at $3 per million input tokens and $15 per million output tokens, with a 1M-token context window.&lt;/p&gt;

&lt;p&gt;The headline number comes from an independent tester: Neon scored 58.6 on the Artificial Analysis Coding Agent Index, the top score. That index averages implementation, terminal and repository Q&amp;amp;A tasks.&lt;/p&gt;

&lt;p&gt;Here is Google's own table against Opus 5.5 and GPT-6.2 Sol. Neon leads most rows. Opus still edges it on the two benchmarks closest to everyday coding: Terminal-bench 4.1 (65.8% against 65.2%) and FrontierCode 2.0 (47.3% against 46.2%).&lt;/p&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%2Fm7c75esiov3j7skb8etz.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%2Fm7c75esiov3j7skb8etz.png" alt="Google's benchmark table comparing Gemini 4 Neon, Claude Opus 5.5 and GPT-6.2 Sol" width="800" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-neon/" rel="noopener noreferrer"&gt;Google&lt;/a&gt;. Google ran these numbers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Price is the other half. On Google's cost chart, Neon at high effort scores 60 on the Artificial Analysis Intelligence Index for under $4 a task. Opus 5.5 needs about $10 a task to reach 59.&lt;/p&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%2Ftcwd3ohkf3gelfhhzbhc.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%2Ftcwd3ohkf3gelfhhzbhc.png" alt="Google's chart of Artificial Analysis Intelligence Index against cost per task for Neon, Carbon, Opus 5.5 and GPT-6.2 Sol" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-4-neon/" rel="noopener noreferrer"&gt;Google&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What developers are saying
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Theo (t3.gg) called Neon an incredible model and posted that &lt;a href="https://x.com/theo/status/2123929867393831114" rel="noopener noreferrer"&gt;Gemini usage in T3 Code is growing exponentially&lt;/a&gt; since the launch.&lt;/li&gt;
&lt;li&gt;On &lt;a href="https://news.ycombinator.com/item?id=50552424" rel="noopener noreferrer"&gt;Hacker News&lt;/a&gt;, the common view was that Neon is roughly level with Opus 5.5 for coding, and very eager to run tasks to the end. Some people put it ahead.&lt;/li&gt;
&lt;li&gt;Opus still gets the nod for frontend work and design taste in most side-by-side posts this week.&lt;/li&gt;
&lt;li&gt;Cost per token is low, but tokens add up. One developer &lt;a href="https://www.huuhka.net/testing-gemini-4-neon-as-a-code-reviewer/" rel="noopener noreferrer"&gt;testing Neon as a code reviewer&lt;/a&gt; found it slow, and the reviews alone came to $115.78 at list price. Reviewers also say Neon gets wordy at its highest reasoning setting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The catch: a lot of it is the harness
&lt;/h3&gt;

&lt;p&gt;A harness is the tool a model works inside: what it can do, what it sees, and how it splits up a big job. It matters more than most people think.&lt;/p&gt;

&lt;p&gt;Look at the SWE-sweep rows in Google's table. SWE-sweep tests finding and fixing bugs across large codebases. Neon scored 12.8% in a basic harness and 39.0% inside Antigravity, Google's own coding tool. Same model, three times the score. Other models change with their maker's tool too (Opus 5.5 goes from 3.6% to 10.1%), but no other pair gains like Neon and Antigravity.&lt;/p&gt;

&lt;p&gt;I'm glad to see this. Antigravity launched last year as Google's own coding tool, yet it shipped with Claude Sonnet as one of its models, and that never sat right with me. Claude Code is built around Claude. Codex is built around OpenAI's models. The lab's own tool should be where its own model works best. Now Google is tuning Gemini for Antigravity, and the product finally makes sense.&lt;/p&gt;

&lt;p&gt;So when someone says Neon beats Opus 5.5, ask which tool each one ran in. That question is why I built &lt;a href="https://abubakar-siddik.com/projects/agent-bench" rel="noopener noreferrer"&gt;Agent Bench&lt;/a&gt;, which runs the same tasks across agent frameworks and publishes every run.&lt;/p&gt;

&lt;p&gt;How Antigravity gets three times more out of the same model deserves more space than a recap has. I'm writing it up as a separate technical post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also this week
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Anthropic went public
&lt;/h3&gt;

&lt;p&gt;Anthropic &lt;a href="https://www.cnbc.com/2026/11/18/anthropic-ipo-ai-offering-price.html" rel="noopener noreferrer"&gt;sold shares on the stock market for the first time&lt;/a&gt; and raised $81.3 billion, the largest IPO on record. Shares were priced at $83 and trade on Nasdaq as ANT. They closed the first day 17% higher, then gave back much of that gain in what CNBC called &lt;a href="https://cnbc.com/2026/11/21/anthropic-ipo-tech-selloff.html" rel="noopener noreferrer"&gt;tech's worst week on Wall Street since 2020&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For people who build on Claude, nothing changes today. Over time, a public company reports numbers every quarter, and its pricing and roadmap decisions get made with that in mind.&lt;/p&gt;

&lt;h3&gt;
  
  
  Claude helped prove the Riemann Hypothesis, and Lean checked it
&lt;/h3&gt;

&lt;p&gt;The Riemann Hypothesis is a claim about where the zeros of one function sit. It has been open since 1859, it is one of the Clay Millennium Prize problems, and a lot of what we know about prime numbers depends on it.&lt;/p&gt;

&lt;p&gt;On 20 November, Levent Alpöge, a mathematician at Anthropic, posted &lt;a href="https://alpo.ge/remark.pdf" rel="noopener noreferrer"&gt;a four-page note&lt;/a&gt; saying that he and Claude had found a proof. The proof itself is a Lean library of 17 million lines of code, with no long paper alongside it.&lt;/p&gt;

&lt;p&gt;Lean is a proof assistant: a program that checks every logical step of a proof the way a compiler checks code. If the theorem is stated correctly and Lean's kernel accepts the proof, a human reviewer has no gap left to miss.&lt;/p&gt;

&lt;p&gt;A day later, the Lean and Mathlib communities issued &lt;a href="https://leanprover-community.github.io/blog/posts/riemann-hypothesis/" rel="noopener noreferrer"&gt;a joint statement&lt;/a&gt;, endorsed by the Lean FRO and the Mathlib Initiative: "We have full confidence that Alpöge's proof of the Riemann Hypothesis is correct." They checked that the proved theorem matches Mathlib's existing &lt;code&gt;RiemannHypothesis&lt;/code&gt; statement, using two independent comparison tools. Many people also compiled the library and got the same output, and Lean's kernel plus several independent checkers accepted the proof.&lt;/p&gt;

&lt;p&gt;Nobody yet has a human-readable account of the new ideas, and the statement says it looks forward to mathematicians explaining them. Alpöge says the method should also reach the Generalized Riemann Hypothesis, but that part has not been checked.&lt;/p&gt;

&lt;p&gt;The timing, the day after the IPO, drew a lot of cynical replies on X. The way the result was checked answers most of them: you don't have to trust Anthropic or Claude, only Lean's kernel.&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenAI's GPT-6.2 does more with fewer tokens
&lt;/h3&gt;

&lt;p&gt;OpenAI &lt;a href="https://openai.com/index/introducing-gpt-6-2-astra-sol/" rel="noopener noreferrer"&gt;released GPT-6.2 Astra and Sol on 17 November&lt;/a&gt;, in ChatGPT, Codex and the API. Astra is the frontier model and Sol is the everyday one. The launch post is mostly about efficiency: every benchmark chart plots score against cost per task.&lt;/p&gt;

&lt;p&gt;Here is the data behind two of those charts, each model at its best setting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agents' Last Exam v1.1&lt;/strong&gt; (multistep professional work)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Cost per task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Astra (xhigh)&lt;/td&gt;
&lt;td&gt;78.3%&lt;/td&gt;
&lt;td&gt;$2.89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Carbon (high)&lt;/td&gt;
&lt;td&gt;77.4%&lt;/td&gt;
&lt;td&gt;$4.60&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Astra (max)&lt;/td&gt;
&lt;td&gt;73.1%&lt;/td&gt;
&lt;td&gt;$8.99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Sol (max)&lt;/td&gt;
&lt;td&gt;73.0%&lt;/td&gt;
&lt;td&gt;$1.32&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Fable 5.2 (max)&lt;/td&gt;
&lt;td&gt;72.8%&lt;/td&gt;
&lt;td&gt;$60.05&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Opus 5.5 (max)&lt;/td&gt;
&lt;td&gt;71.6%&lt;/td&gt;
&lt;td&gt;$17.57&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;FrontierCode 2.0&lt;/strong&gt; (code changes that maintainers would merge)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Cost per task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Claude Fable 5.2 (xhigh)&lt;/td&gt;
&lt;td&gt;49.1%&lt;/td&gt;
&lt;td&gt;$14.19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Opus 5.5 (max)&lt;/td&gt;
&lt;td&gt;45.5%&lt;/td&gt;
&lt;td&gt;$12.82&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Astra (max)&lt;/td&gt;
&lt;td&gt;44.2%&lt;/td&gt;
&lt;td&gt;$5.97&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Sol (max)&lt;/td&gt;
&lt;td&gt;43.8%&lt;/td&gt;
&lt;td&gt;$1.29&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Astra (max)&lt;/td&gt;
&lt;td&gt;42.8%&lt;/td&gt;
&lt;td&gt;$6.68&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Cost per task is the tokens a model uses multiplied by the price per token, and OpenAI cut both. Reasoning models bill their thinking as output tokens, so a model that reaches the same answer with less thinking is cheaper even at the same price. On OpenAI's GDPval v2, Astra scores 6.2 points higher than GPT-6 Astra with 22% fewer output tokens. On top of that, Astra's prices dropped 20%, to $8 per million input tokens and $40 per million output tokens, and cached input dropped 60% to $0.40. Sol stays at $2 input and $10 output.&lt;/p&gt;

&lt;p&gt;Sol is the one I'd look at. It lands within half a point of Astra on FrontierCode at about a fifth of the cost, so it's the default for most agent work, and Astra is for the tasks where Sol fails. Claude still tops the coding table, at more than twice the price.&lt;/p&gt;

&lt;p&gt;These are OpenAI's runs, and other labs' runs differ: Google's table above has Opus 5.5 at 47.3% on FrontierCode, where OpenAI's has 45.5%. Run your own tasks before you move a production workload.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inkling 2 Mini: a strong open model that fits on a laptop
&lt;/h3&gt;

&lt;p&gt;Thinking Machines released &lt;a href="https://thinkingmachines.ai/news/inkling-2-mini/" rel="noopener noreferrer"&gt;Inkling 2 Mini&lt;/a&gt; on 20 November, with full weights on Hugging Face under Apache 2.0. It needs about 20 GB of memory, so it runs on a Mac with 32 GB or more.&lt;/p&gt;

&lt;p&gt;Its main technical idea is looping. The model has 26.4B parameters, but only 3.4B are active for each token, and its middle layers run three times per token. That gives it more computation per token without storing more weights.&lt;/p&gt;

&lt;p&gt;The lab reports 48.2% on DeepSWE v1.1 and says it leads open models under 100B parameters. Artificial Analysis puts it at 20 on its Intelligence Index, far below the frontier. It's a good local model for private or offline work. It won't replace Neon or Opus.&lt;/p&gt;

&lt;h2&gt;
  
  
  New models at a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Lab&lt;/th&gt;
&lt;th&gt;Input price&lt;/th&gt;
&lt;th&gt;Output price&lt;/th&gt;
&lt;th&gt;Notable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gemini 4 Neon&lt;/td&gt;
&lt;td&gt;Google&lt;/td&gt;
&lt;td&gt;$3&lt;/td&gt;
&lt;td&gt;$15&lt;/td&gt;
&lt;td&gt;58.6 on the AA Coding Agent Index (#1)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Astra&lt;/td&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;$8&lt;/td&gt;
&lt;td&gt;$40&lt;/td&gt;
&lt;td&gt;78.3% on Agents' Last Exam at $2.89 a task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6.2 Sol&lt;/td&gt;
&lt;td&gt;OpenAI&lt;/td&gt;
&lt;td&gt;$2&lt;/td&gt;
&lt;td&gt;$10&lt;/td&gt;
&lt;td&gt;43.8% on FrontierCode 2.0 at $1.29 a task&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inkling 2 Mini&lt;/td&gt;
&lt;td&gt;Thinking Machines&lt;/td&gt;
&lt;td&gt;Free (open weights)&lt;/td&gt;
&lt;td&gt;Free (open weights)&lt;/td&gt;
&lt;td&gt;3.4B active params, ~20 GB, Apache 2.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Input and output prices are per million tokens, from the API list prices in the launch posts. Apart from the Artificial Analysis score, the numbers are the labs' own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worth reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://antigravity.google/docs/subagents/" rel="noopener noreferrer"&gt;Antigravity subagent docs&lt;/a&gt;: the clearest picture I've seen of how a modern coding harness splits work.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://leanprover-community.github.io/blog/posts/riemann-hypothesis/" rel="noopener noreferrer"&gt;Lean verification of the Riemann Hypothesis&lt;/a&gt;: the primary source, short, and clear on what was checked and how.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thinkingmachines.ai/news/inkling-2-mini/" rel="noopener noreferrer"&gt;Introducing Inkling 2 Mini&lt;/a&gt;: worth it for the explanation of looped models alone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the first one. If something here is wrong or you think I missed a story, reply and tell me.&lt;/p&gt;

&lt;p&gt;Abu Bakar&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://abubakar-siddik.com/newsletter/2026-11-22" rel="noopener noreferrer"&gt;abubakar-siddik.com/newsletter/2026-11-22&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>newsletter</category>
    </item>
    <item>
      <title>Injection Is Not Influence: The Illusion of LLM Memory</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Sun, 15 Feb 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/injection-is-not-influence-the-illusion-of-llm-memory-46o4</link>
      <guid>https://dev.to/abubakarsiddik/injection-is-not-influence-the-illusion-of-llm-memory-46o4</guid>
      <description>&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%2F1ekt9ba711txgpbjpkuc.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%2F1ekt9ba711txgpbjpkuc.png" alt="LLM Memory vs Human Memory" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been building LLM applications for the last three years. Systems that don't just answer once and disappear, but talk, evolve, remember, and are expected to behave consistently over time. It is also where &lt;a href="https://abubakar-siddik.com/research#publications" rel="noopener noreferrer"&gt;my research on agent security&lt;/a&gt; starts.&lt;/p&gt;

&lt;p&gt;And somewhere in that process, something became obvious to me: &lt;strong&gt;LLM memory is fundamentally different from human memory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We keep using the same word — memory — but we're describing two very different mechanisms. That mismatch quietly shapes a lot of the problems we run into.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Mean When Humans "Remember"
&lt;/h2&gt;

&lt;p&gt;When something reminds us of a past experience, we don't retrieve a compressed summary. &lt;strong&gt;We reconstruct a situation.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We remember the context. The constraints. What we tried. What failed. What worked. Sometimes tiny details that shouldn't matter logically, but somehow stayed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human memory preserves structure. It preserves causality.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some memories fade. Some get reinforced. Some stay vivid for years. There is selectivity, depth, and gradual evolution. We don't consciously decide what to persist after every sentence. Memory strengthens through repetition, emotion, relevance, and time.&lt;/p&gt;

&lt;p&gt;It's organic.&lt;/p&gt;

&lt;p&gt;Memory and processing aren’t separate systems in humans. They’re intertwined. In LLM systems, they are explicitly decoupled.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Real LLM Systems Actually Do
&lt;/h2&gt;

&lt;p&gt;In production systems, memory is engineered.&lt;/p&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%2Fucnci34v2mg90a0ugt7g.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%2Fucnci34v2mg90a0ugt7g.png" alt="The LLM Memory Bottleneck" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typically, we do two things in parallel.&lt;/p&gt;

&lt;p&gt;First, we extract useful information from individual user messages. Second, we periodically summarize longer conversations into something that can persist.&lt;/p&gt;

&lt;p&gt;The per-message extraction is the "obvious" layer. If a user says something stable — their tech stack, their preference, their background — we try to capture it. This layer is often partially structured. Not fully rigid, because too much structure makes things brittle. But structured enough to be reusable later.&lt;/p&gt;

&lt;p&gt;But here's the part that's easy to overlook: &lt;strong&gt;That extraction is done by an LLM.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which means it is probabilistic.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are asking a model, in real time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is this a stable fact?&lt;/li&gt;
&lt;li&gt;Is this temporary?&lt;/li&gt;
&lt;li&gt;Is this preference or circumstance?&lt;/li&gt;
&lt;li&gt;Should this persist?&lt;/li&gt;
&lt;li&gt;How should it be represented?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And humans are vague. A user might say something ambiguous, half-formed, exploratory. The system has to interpret intent and permanence immediately.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sometimes it extracts things that shouldn't persist.&lt;/li&gt;
&lt;li&gt;Sometimes it misses things that matter later.&lt;/li&gt;
&lt;li&gt;Sometimes it stores something that becomes outdated but never reconciles it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then comes summarization. After long conversations, we compress what happened. We preserve the scenario and the outcome. But compression flattens reasoning paths. It keeps results and discards exploration.&lt;/p&gt;

&lt;p&gt;So memory becomes a mix of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;per-message extraction&lt;/li&gt;
&lt;li&gt;light structuring&lt;/li&gt;
&lt;li&gt;periodic summarization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And each layer depends on model judgment.&lt;/p&gt;

&lt;p&gt;The fragility isn't just that summaries are lossy. It's that we've delegated persistence decisions to a probabilistic system operating on vague, shifting human input.&lt;/p&gt;

&lt;p&gt;Humans don't make those decisions explicitly. Our memory evolves through use. LLM systems must decide instantly. That difference matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Used to Think
&lt;/h2&gt;

&lt;p&gt;For a while, I thought the main bottleneck was &lt;strong&gt;multi-user architecture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Traditional LLM systems are shared. The model is shared. The infrastructure is shared. Memory is external and partitioned per user. Humans don't work like that. Each person has their own processor tightly integrated with their own memory.&lt;/p&gt;

&lt;p&gt;So I wondered: maybe memory feels weak because we're simulating something deeply personal on top of a shared, stateless engine.&lt;/p&gt;

&lt;p&gt;If we had a true single-user LLM — one model continuously evolving with one individual — wouldn't memory feel more coherent?&lt;/p&gt;

&lt;p&gt;There's some truth in that intuition. Systems optimized around one user often feel stronger. Retrieval is narrower. Noise is lower.&lt;/p&gt;

&lt;p&gt;But even in a single-user setup, the hard problems don't disappear.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You still have to decide what to store.&lt;/li&gt;
&lt;li&gt;You still have to interpret vague language.&lt;/li&gt;
&lt;li&gt;You still compress.&lt;/li&gt;
&lt;li&gt;You still retrieve based on imperfect signals.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The shared model makes scaling harder. It doesn't create the core tension.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The deeper issue is architectural.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LLMs are stateless processors. Memory is external.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieval Is More Subtle Than It Looks
&lt;/h2&gt;

&lt;p&gt;Even if extraction were perfect, retrieval introduces another layer of uncertainty.&lt;/p&gt;

&lt;p&gt;Most systems rely heavily on embedding similarity. That works when two situations look similar on the surface. But &lt;strong&gt;humans retrieve based on structure, not just wording.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Two problems can use completely different vocabulary yet share the same underlying pattern. Humans recognize that pattern. Embedding similarity may not.&lt;/p&gt;

&lt;p&gt;As memory grows, this tension increases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store too much and retrieval becomes noisy.&lt;/li&gt;
&lt;li&gt;Store too little and continuity breaks.&lt;/li&gt;
&lt;li&gt;Compress too aggressively and you lose causality.&lt;/li&gt;
&lt;li&gt;Keep everything and the model starts ignoring the memory block.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's no obvious equilibrium.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Part We Rarely Measure
&lt;/h2&gt;

&lt;p&gt;There's another uncomfortable layer to this.&lt;/p&gt;

&lt;p&gt;Even when we retrieve memory and inject it into the prompt, we often don't know whether it was actually used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Injection is not the same as influence.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We assume that because memory was present, it shaped the answer. But we rarely measure that explicitly. We rarely build feedback loops that tell us which memories were helpful and which were irrelevant.&lt;/p&gt;

&lt;p&gt;So memory accumulates. Some entries remain useful. Some become stale. Some contradict newer facts. Some are repeatedly retrieved but never meaningfully influence responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without observability, memory systems slowly degrade&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Not because the idea is wrong. But because nothing is reinforcing the useful parts and letting the rest fade. Humans reinforce memory through use. Systems rarely do. Once an agent can act on what it retrieves, the stakes change; that is the argument in &lt;a href="https://abubakar-siddik.com/essays/can-we-really-make-ai-safe" rel="noopener noreferrer"&gt;safety is a boundary problem&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bigger Context Windows Won't Fix This
&lt;/h2&gt;

&lt;p&gt;Increasing context size reduces how often we need to summarize or retrieve.&lt;/p&gt;

&lt;p&gt;But it doesn't solve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ambiguous extraction&lt;/li&gt;
&lt;li&gt;Lossy compression&lt;/li&gt;
&lt;li&gt;Structural mismatch in retrieval&lt;/li&gt;
&lt;li&gt;Lack of reinforcement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It just postpones the pressure. Eventually, you still have to decide what deserves persistence.&lt;/p&gt;

&lt;h2&gt;
  
  
  So What Is the Real Bottleneck?
&lt;/h2&gt;

&lt;p&gt;After three years of building in this space, I don't think the main issue is that models forget.&lt;/p&gt;

&lt;p&gt;The deeper problem is that we are asking probabilistic systems to make hard, irreversible decisions about persistence in the presence of vague human language — and then we rarely close the loop to see whether those decisions were useful.&lt;/p&gt;

&lt;p&gt;Memory in LLM systems isn't about storing more tokens. &lt;strong&gt;It's about representing experience in a way that preserves structure over time.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It's about deciding what deserves to persist. It's about retrieving based on meaningful similarity, not just surface semantics. It's about reinforcement and decay.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And we are still early in figuring out what "remembering" should actually mean in machine systems. The moment we stop pretending that LLM memory is just a bigger context window, and start treating it as a design problem about persistence, structure, and feedback, the conversation changes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We're not trying to copy the human brain. We're trying to define what remembering should look like for machines.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that question is still wide open.&lt;/p&gt;




&lt;p&gt;Originally published at &lt;a href="https://abubakar-siddik.com/essays/injection-is-not-influence-llm-memory" rel="noopener noreferrer"&gt;abubakar-siddik.com/essays/injection-is-not-influence-llm-memory&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>essay</category>
      <category>llm</category>
      <category>memory</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Building Smarter, Smaller and Efficient AI Models: NVIDIA’s Minitron Approach</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Sat, 04 Jan 2025 17:02:11 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/building-smarter-smaller-ai-models-nvidias-minitron-approach-10i7</link>
      <guid>https://dev.to/abubakarsiddik/building-smarter-smaller-ai-models-nvidias-minitron-approach-10i7</guid>
      <description>&lt;p&gt;Large language models (LLMs) have transformed AI. They excel at reasoning, coding, and understanding language. But these models are huge, expensive to train, and need massive datasets. So, how can we create smaller, faster, and cheaper models that still perform well?  &lt;/p&gt;

&lt;p&gt;NVIDIA’s &lt;em&gt;Minitron Approach&lt;/em&gt; offers a clever solution. In their paper, &lt;em&gt;&lt;a href="https://arxiv.org/pdf/2408.11796" rel="noopener noreferrer"&gt;“LLM Pruning and Distillation in Practice: The Minitron Approach,”&lt;/a&gt;&lt;/em&gt; they explain how to shrink large models without losing their power—even when the original training data isn’t available. Let’s break down what makes this method so effective.  &lt;/p&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.amazonaws.com%2Fuploads%2Farticles%2F72hyi56y9iulq90p4myl.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.amazonaws.com%2Fuploads%2Farticles%2F72hyi56y9iulq90p4myl.png" alt="Knowldge distillation" width="393" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Shrinking Models Matters
&lt;/h3&gt;

&lt;p&gt;Big models like &lt;strong&gt;Llama-3.1-405B&lt;/strong&gt; require tons of data, time, and computing power to train. Not everyone can afford that. To save resources, many turn to &lt;strong&gt;pruning&lt;/strong&gt; and &lt;strong&gt;distillation&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pruning&lt;/strong&gt; cuts out less important parts of the model, like extra layers or neurons.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distillation&lt;/strong&gt; teaches a smaller “student” model to mimic the larger “teacher” model’s knowledge.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These techniques create smaller, faster, and more affordable models. But if you don’t have the original training data—common with proprietary models—things get tricky.  &lt;/p&gt;

&lt;h3&gt;
  
  
  NVIDIA’s Minitron Approach
&lt;/h3&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.amazonaws.com%2Fuploads%2Farticles%2Fnptjc0lxi8ccrew75bbo.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.amazonaws.com%2Fuploads%2Farticles%2Fnptjc0lxi8ccrew75bbo.png" alt="NVIDIA’s Minitron Approach" width="799" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NVIDIA enhances pruning and distillation with three key steps, making it possible to compress models even without the original data.  &lt;/p&gt;

&lt;h4&gt;
  
  
  1. Teacher Correction
&lt;/h4&gt;

&lt;p&gt;Before teaching, the “teacher” model is fine-tuned on a new dataset. This small adjustment helps it better match the task at hand, ensuring it gives more accurate guidance to the smaller model.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; Fine-tunes the teacher using around 100 billion tokens.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt; Adapts the teacher to the new dataset, boosting the smaller model’s performance.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2. Structured Pruning
&lt;/h4&gt;

&lt;p&gt;Instead of removing random bits, NVIDIA uses &lt;strong&gt;structured pruning&lt;/strong&gt; to cut out entire sections, like layers or dimensions, in two ways:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Depth Pruning:&lt;/strong&gt; Removes entire layers, speeding up the model significantly.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Width Pruning:&lt;/strong&gt; Reduces dimensions within layers, balancing accuracy and speed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NVIDIA uses a small dataset to calculate which parts of the model are least important and safe to prune.  &lt;/p&gt;

&lt;h4&gt;
  
  
  3. Knowledge Distillation
&lt;/h4&gt;

&lt;p&gt;After pruning, the student model learns from the corrected teacher using a method called &lt;strong&gt;logit-based distillation&lt;/strong&gt;. This involves aligning the student’s outputs with the teacher’s, and recovering accuracy lost during pruning.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Key Results
&lt;/h3&gt;

&lt;p&gt;NVIDIA tested the Minitron Approach on two models:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mistral NeMo 12B → MN-Minitron-8B&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Outperformed the original model in reasoning tasks like GSM8K and HumanEval.
&lt;/li&gt;
&lt;li&gt;Used 40× fewer training tokens (380B vs. 15T).
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Llama 3.1 8B → Two 4B Variants&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both pruned versions beat the original model on several benchmarks.
&lt;/li&gt;
&lt;li&gt;Used 150× fewer training tokens (94B vs. 15T).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Width-Pruned Variant:&lt;/strong&gt; Better accuracy.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Depth-Pruned Variant:&lt;/strong&gt; Faster inference speeds. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Speed and Efficiency
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Depth Pruning:&lt;/strong&gt; Speeds up inference by up to 2.7×—great for real-time use.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Width Pruning:&lt;/strong&gt; Offers a 1.8× speed-up while preserving better accuracy.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token Savings:&lt;/strong&gt; Requires far fewer training tokens than starting from scratch.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Future of AI Efficiency
&lt;/h3&gt;

&lt;p&gt;NVIDIA has set a new standard with the Minitron Approach. By combining teacher correction, structured pruning, and knowledge distillation, they’ve shown it’s possible to build smaller models that compete with larger ones.  &lt;/p&gt;

&lt;p&gt;As demand for lightweight, cost-effective AI grows, innovations like these will shape the future of AI development and deployment.  &lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>The Art of Naming in Programming: Why Good Names Matter!</title>
      <dc:creator>Abu Bakar Siddik</dc:creator>
      <pubDate>Wed, 18 Dec 2024 18:57:10 +0000</pubDate>
      <link>https://dev.to/abubakarsiddik/the-art-of-naming-in-programming-why-good-names-matter-5951</link>
      <guid>https://dev.to/abubakarsiddik/the-art-of-naming-in-programming-why-good-names-matter-5951</guid>
      <description>&lt;p&gt;Hey there, fellow Programmers! Let's talk about something we all do but rarely think about: naming our code. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why Names Are Your Code's First Impression
&lt;/h2&gt;

&lt;p&gt;Imagine walking into a room where everything is labeled with "thing1", "thing2", "thing3". Confusing, right? That's exactly how bad code names feel to other developers.&lt;/p&gt;

&lt;p&gt;Here's a terrible example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, a better version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_rectangle_area&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;width&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See the difference? The second version tells you exactly what's happening.&lt;/p&gt;

&lt;h2&gt;
  
  
  Revealing Intent Matters
&lt;/h2&gt;

&lt;p&gt;Good names answer three key questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does this do?&lt;/li&gt;
&lt;li&gt;Why does it exist?&lt;/li&gt;
&lt;li&gt;How will it be used?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at a real-world example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Bad: Unclear purpose&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;

&lt;span class="c1"&gt;# Better: Clear and intentional&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;filter_positive_numbers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;number_list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;number_list&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Avoiding the Naming Pitfalls
&lt;/h2&gt;

&lt;p&gt;Common mistakes to dodge:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cryptic Abbreviations&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Avoid&lt;/span&gt;
&lt;span class="n"&gt;usr_cnt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Prefer&lt;/span&gt;
&lt;span class="n"&gt;user_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Meaningless Variations&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Confusing&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_details&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Clear&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_user_profile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single-Letter Names&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Bad&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;

&lt;span class="c1"&gt;# Good&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_average_rate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total_revenue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total_hours&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;number_of_projects&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;total_revenue&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;total_hours&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;number_of_projects&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical Naming Guidelines
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Classes&lt;/strong&gt;: Use nouns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Functions&lt;/strong&gt;: Use verbs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Variables&lt;/strong&gt;: Be specific&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constants&lt;/strong&gt;: ALL_UPPERCASE
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Great naming example&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CustomerAccount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="no"&gt;MAX_WITHDRAWAL_LIMIT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_monthly_interest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Context is King
&lt;/h2&gt;

&lt;p&gt;Names should make sense in their environment. A variable like &lt;code&gt;state&lt;/code&gt; could mean anything. But &lt;code&gt;customer_state&lt;/code&gt; or &lt;code&gt;order_processing_state&lt;/code&gt; is crystal clear.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Unclear&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="c1"&gt;# Clear&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_order_processing_state&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Golden Rules
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Be consistent&lt;/li&gt;
&lt;li&gt;Be descriptive&lt;/li&gt;
&lt;li&gt;Keep it simple&lt;/li&gt;
&lt;li&gt;Think about the next developer (maybe future you!)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Naming isn't just typing words. It's communication. You're telling a story with your code. Make it a story others want to read.&lt;/p&gt;

&lt;p&gt;Your future self will thank you. Your teammates will thank you. Heck, even your computer might give you a virtual high-five✋.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>cleancode</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
