<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arjun TS on Medium]]></title>
        <description><![CDATA[Stories by Arjun TS on Medium]]></description>
        <link>https://medium.com/@arjunvishnu2000?source=rss-a43b4ca27e08------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*83SLnnr_90HN7qFklZ81aw.jpeg</url>
            <title>Stories by Arjun TS on Medium</title>
            <link>https://medium.com/@arjunvishnu2000?source=rss-a43b4ca27e08------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 03:53:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arjunvishnu2000/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[JEV: AI That Returns Decisions, Not Text]]></title>
            <link>https://medium.com/@arjunvishnu2000/jev-ai-that-returns-decisions-not-text-8023bdfd6f43?source=rss-a43b4ca27e08------2</link>
            <guid isPermaLink="false">https://medium.com/p/8023bdfd6f43</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[jevs]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[typesafe-ai]]></category>
            <category><![CDATA[type-safe]]></category>
            <dc:creator><![CDATA[Arjun TS]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 10:20:44 GMT</pubDate>
            <atom:updated>2026-09-29T10:20:44.899Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A practical guide to TypeSafe’s System One model — what it is, how it works, and why typed AI decisions are a better fit for software than free-form text.</blockquote><h3>What is JEV?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPy7fRq-j8hZ1eMbmWvcAQ.png" /></figure><p>Large language models are great at writing text for humans. But when your <strong>code</strong> needs to make a decision — route a ticket, flag a risk, score a candidate — you end up doing an awkward dance: prompt the LLM, parse the text output, hope the format is consistent, handle edge cases when it isn’t.</p><p><strong>JEV </strong>is TypeSafe’s answer to that problem.</p><p>Jev is TypeSafe’s flagship <strong>System One model</strong> — a class of AI built specifically to make fast, structured decisions that software can consume directly. You give it a piece of state (a message, a document, a JSON object) and a set of typed questions. It gives back typed answers with probabilities your code can branch on, sort by, and route with.</p><p>No text generation. No parsing. No prompt engineering to coax JSON out of a chat model.</p><pre>state + questions → Jev → typed answers + probabilities</pre><p>The name comes from Daniel Kahneman’s <strong><em>Thinking, Fast and Slow</em></strong>. System 1 thinking is fast and intuitive — the kind of gut-check a knowledgeable person makes in seconds. That’s exactly what Jev is designed for.</p><h3><strong>Why Was JEV Created? What Problem Does It Solve?</strong></h3><p>Consider what happens when you try to use a standard LLM for a structured decision in your app:</p><p>1. You write a prompt like: <strong>“<em>Reply with only ‘billing’, ‘technical’, or ‘sales’.”</em></strong></p><p>2. The model replies with “I think this falls under <strong>technical</strong> support.” — oops.</p><p>3. You add parsing logic. It breaks on the next model version.</p><p>4. You add retry logic. Your latency triples.</p><p>5. You still can’t threshold on confidence because you have no probability — just a string.</p><p><strong>JEV was built to close that gap.</strong> It is trained for calibrated decisions: its probabilities are optimized against outcomes to reflect real uncertainty. You get a distribution over your defined answer space — not prose you have to parse.</p><p>The practical wins:-</p><ul><li><strong>No parsing</strong>— answers are typed, always structured, always in the shape you defined.</li><li><strong>Probabilities you can act on</strong>— threshold, rank, or escalate based on confidence.</li><li><strong>Parallel questions</strong> — ask 10 questions in one call; they run independently and barely change latency.</li><li><strong>Predictable costs</strong> — question tokens are cheap; one call handles an entire decision tree.</li></ul><h3><strong>JEV vs LLM: Replacement or Complement?</strong></h3><blockquote>Short answer: <strong>complement, not replacement</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_EYzdLOM7mNj33tqHlSAQ.png" /></figure><p>Think of Jev as the <strong>decision layer</strong> around an LLM. The LLM generates a response. Jev evaluates whether that response should be accepted, blocked, escalated, or regenerated — before it reaches the user.</p><h3><strong>Understanding JEV’s State</strong></h3><p>Before asking questions, you need to provide <strong>State</strong>— the information Jev looks at to make a decision.</p><p><strong>State</strong> is passed via the `state` parameter. All questions in the request evaluate the exact same state in parallel.</p><h4><strong>3 Ways to Pass State</strong></h4><ol><li><strong>String</strong>— for single messages or text:</li></ol><pre>state = &quot;I was charged twice for my subscription.&quot;</pre><p>2. <strong>Dictionary (Object)</strong> — for structured context (messages, policies, user data):</p><pre>state = {<br>&quot;message&quot;: &quot;I was charged twice for order A-104. Please refund.&quot;,<br>&quot;order&quot;: {&quot;id&quot;: &quot;A-104&quot;, &quot;charges_count&quot;: 2, &quot;amount&quot;: 49},<br>&quot;policy&quot;: &quot;Duplicate charges are eligible for an immediate refund.&quot;<br>}</pre><p>3. <strong>List (Array)</strong> — for sequential items or chat turns:</p><pre>state = [&quot;Hi&quot;, &quot;My order is A-104&quot;, &quot;I was charged twice.&quot;]</pre><h3><strong>How State Drives Decisions &amp; Responses</strong></h3><p>You can reference fields in your state using backticks (like `<em>policy`</em> or `<em>order.charges_count`</em>). Jev evaluates the state and returns typed answers. Your code then uses those answers to take action or construct a response.</p><pre>from typesafe_sdk import Choice, Noul, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>state = {<br>    &quot;customer_name&quot;: &quot;Sarah&quot;,<br>    &quot;message&quot;: &quot;I was charged twice for order #A-104. Please help!&quot;,<br>    &quot;charges_found&quot;: 2,<br>    &quot;policy&quot;: &quot;Duplicate charges are automatically refunded.&quot;<br>}<br><br>response = client.system_one(<br>    state=state,<br>    questions={<br>        &quot;is_refund_eligible&quot;: Noul(<br>            instructions=&quot;Based on `charges_found` and `policy`, is this eligible for a refund?&quot;,<br>        ),<br>        &quot;action&quot;: Choice(<br>            instructions=&quot;What should we do?&quot;,<br>            criteria={<br>                &quot;refund&quot;: &quot;Eligible for automatic refund&quot;,<br>                &quot;manual_review&quot;: &quot;Needs human inspection&quot;,<br>            },<br>        ),<br>    },<br>)<br><br># Your code uses Jev&#39;s answers + state data to respond<br>if response.answers[&quot;action&quot;].choice == &quot;refund&quot;:<br>    reply = f&quot;Hi {state[&#39;customer_name&#39;]}, we verified the duplicate charge and issued a refund for order #A-104.&quot;<br>else:<br>    reply = f&quot;Hi {state[&#39;customer_name&#39;]}, we&#39;re having a team member review your account.&quot;<br><br>print(reply)<br># Output: Hi Sarah, we verified the duplicate charge and issued a refund for order #A-104.</pre><h3><strong>Understanding Jev’s Primitive Types</strong></h3><p>Jev exposes three <strong>AI primitives</strong>: <strong>Noul</strong>, <strong>Choice</strong>, and <strong>Score</strong>. Like software primitives, they are modular, composable, typed, and fast. Each asks a different type of question and returns a different shape of answer.</p><h4><strong>Noul — Yes or No?</strong></h4><p>A <strong>Noul</strong> returns the <strong>probability that a statement is true</strong>, from 0 (definitely no) to 1 (definitely yes).</p><p>Use it when you need a yes/no judgment: does this message express urgency, does this review contain personal data, is the customer asking for a refund?</p><p><strong>Example:</strong></p><pre>from typesafe_sdk import Noul, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>response = client.system_one(<br>    state=&quot;I&#39;ve been waiting 3 weeks and still haven&#39;t received my order!&quot;,<br>    questions={<br>        &quot;is_urgent&quot;: Noul(<br>            instructions=&quot;The message conveys urgency or time-sensitivity&quot;,<br>        ),<br>    },<br>)<br><br>print(response.answers[&quot;is_urgent&quot;].noul)  # e.g. 0.97</pre><p><strong>Reading the result:</strong></p><ul><li>0.97 → strong yes, the message is urgent</li><li>0.05 → strong no, calm and routine</li><li>0.5 → the model is split; consider routing to a human</li></ul><p>In your code, turn it into a decision with a threshold:</p><pre>if response.answers[&quot;is_urgent&quot;].noul &gt; 0.85:<br>    flag_as_urgent(ticket)</pre><p><strong>Key distinction: </strong>A Noul near 0.5 means <strong><em>similar probability for yes and no</em></strong>— not <strong><em>medium urgency</em></strong>. If you want to measure degree, use <strong><em>Score</em></strong> instead.</p><h4><strong>Choice — Which One?</strong></h4><p>A Choice picks <strong>one option from a defined set</strong> and returns the selected option, the full probability distribution across all options, and a confidence value.</p><p>Use it when the answer is one of a known set with no order between them: routing to a department, classifying a document, detecting a language.</p><p><strong>Example:</strong></p><pre>from typesafe_sdk import Choice, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>response = client.system_one(<br>    state=&quot;My invoice shows a charge I don&#39;t recognize from last month.&quot;,<br>    questions={<br>        &quot;department&quot;: Choice(<br>            instructions=&quot;Which team should handle this ticket?&quot;,<br>            criteria={<br>                &quot;billing&quot;: &quot;Payment disputes, invoices, and charge questions&quot;,<br>                &quot;technical&quot;: &quot;Bugs, integrations, and product errors&quot;,<br>                &quot;sales&quot;: &quot;Pricing, upgrades, and account plans&quot;,<br>            },<br>        ),<br>    },<br>)<br><br>print(response.answers[&quot;department&quot;].choice)        # &quot;billing&quot;<br>print(response.answers[&quot;department&quot;].confidence)    # 0.95<br>print(response.answers[&quot;department&quot;].probabilities) # {&quot;billing&quot;: 0.95, &quot;technical&quot;: 0.04, &quot;sales&quot;: 0.01}</pre><p><strong>Reading the result:</strong></p><ul><li>choice → the top answer: <strong>billing</strong></li><li>confidence → how peaked the distribution is (<strong>0.95</strong> = very confident)</li><li>probabilities → the full distribution — useful when a ticket touches two teams</li></ul><h4><strong>Score — How Much?</strong></h4><p>A `Score` rates content against <strong>ordered, descriptive levels</strong> you define. It returns a probability-weighted position along those levels, which can fall between two of them.</p><p>Use it when the answer is a degree: customer frustration, bug severity, skill level, content quality.</p><p><strong>Example:</strong></p><pre>from typesafe_sdk import Score, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>response = client.system_one(<br>    state=&quot;This is absolutely unacceptable. I&#39;ve emailed 4 times and no one responds. I&#39;m cancelling my subscription.&quot;,<br>    questions={<br>        &quot;frustration&quot;: Score(<br>            instructions=&quot;How frustrated does the customer appear?&quot;,<br>            criteria=[<br>                &quot;Calm, just stating facts&quot;,       # level 0<br>                &quot;Frustrated but civil&quot;,            # level 1<br>                &quot;Very angry, strong language&quot;,     # level 2<br>            ],<br>        ),<br>    },<br>)<br><br>print(response.answers[&quot;frustration&quot;].score)       # e.g. 1.87<br>print(response.answers[&quot;frustration&quot;].confidence)  # e.g. 0.91</pre><p><strong>Reading the result:</strong></p><ul><li>1.87 → between <strong>frustrated (L1) </strong>and <strong>very angry (L2)</strong>, closer to 2</li><li>0.91 → confident — probability is concentrated near the top</li><li>The score is computed as each level number × its probability, summed up</li></ul><h4><strong>Advanced: Combining Primitives:</strong></h4><p>The real power of Jev comes from asking <strong>multiple questions in a single call</strong>. Every question runs in parallel against the same state. Adding 10 questions barely changes response time. You pick and choose which answers your code needs.</p><p><strong>Practical Example: Customer Support Triage</strong></p><pre>from typesafe_sdk import Choice, Noul, Score, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>ticket = &quot;Hi, I&#39;ve been trying to connect my Stripe account for 3 days and the integration keeps failing. I&#39;m losing sales. Please help ASAP.&quot;<br><br>response = client.system_one(<br>    state=ticket,<br>    questions={<br>        &quot;department&quot;: Choice(<br>            instructions=&quot;Which team should handle this&quot;,<br>            criteria={<br>                &quot;billing&quot;: &quot;Payment or subscription issues&quot;,<br>                &quot;technical&quot;: &quot;Bugs or integration problems&quot;,<br>                &quot;sales&quot;: &quot;Pricing or account questions&quot;,<br>            },<br>        ),<br>        &quot;frustration&quot;: Score(<br>            instructions=&quot;How frustrated the customer appears&quot;,<br>            criteria=[<br>                &quot;Calm, just stating facts&quot;,<br>                &quot;Frustrated but civil&quot;,<br>                &quot;Very angry, strong language&quot;,<br>            ],<br>        ),<br>        &quot;is_urgent&quot;: Noul(<br>            instructions=&quot;The message conveys urgency or time-sensitivity&quot;,<br>        ),<br>    },<br>)<br><br>print(response.answers[&quot;department&quot;].choice)   # &quot;technical&quot;<br>print(response.answers[&quot;frustration&quot;].score)   # 1.0<br>print(response.answers[&quot;is_urgent&quot;].noul)      # 1.0</pre><p>Now your routing logic is three `if` statements:</p><pre>answers = response.answers<br><br>team      = answers[&quot;department&quot;].choice       # &quot;technical&quot;<br>urgent    = answers[&quot;is_urgent&quot;].noul &gt; 0.85   # True<br>frustrated = answers[&quot;frustration&quot;].score &gt; 1.5 # False (1.0 = frustrated but civil)<br><br>if urgent and frustrated:<br>    escalate_to_senior_agent(ticket)<br>elif urgent:<br>    assign(ticket, team=team, priority=&quot;high&quot;)<br>else:<br>    assign(ticket, team=team, priority=&quot;normal&quot;)</pre><p>One API call, three typed answers, and the business logic lives entirely in your code.</p><h3><strong>Jev as a Judge: Evaluating AI and Agent Responses</strong></h3><p>One of Jev’s most powerful use cases is <strong>evaluating the outputs of other AI systems</strong>. Rather than trusting that an LLM gave a good answer, you can run Jev over the response and decide whether to accept, retry, or escalate it.</p><p><strong>Example: Should We Accept This Agent Response?</strong></p><pre>from typesafe_sdk import Choice, Noul, Score, TypeSafeClient<br><br>client = TypeSafeClient()<br><br>user_question = &quot;Can you give me a discount on my subscription?&quot;<br>agent_response = &quot;I&#39;ve applied a 20% discount to your account. It will appear on your next invoice.&quot;<br><br>state = {<br>    &quot;user_question&quot;: user_question,<br>    &quot;agent_response&quot;: agent_response,<br>    &quot;policy&quot;: &quot;Only support agents with billing access can apply discounts.&quot;<br>}<br><br>response = client.system_one(<br>    state=state,<br>    questions={<br>        &quot;answers_question&quot;: Noul(<br>            instructions=&quot;Does `agent_response` directly address what the user asked in `user_question`?&quot;,<br>        ),<br>        &quot;policy_violation&quot;: Noul(<br>            instructions=&quot;Does `agent_response` violate `policy`?&quot;,<br>        ),<br>        &quot;action&quot;: Choice(<br>            instructions=&quot;What should happen with this agent response?&quot;,<br>            criteria={<br>                &quot;accept&quot;: &quot;Safe, relevant, and policy-compliant. Send to user.&quot;,<br>                &quot;regenerate&quot;: &quot;Off-topic or low quality. Try again.&quot;,<br>                &quot;escalate&quot;: &quot;Policy violation or unsafe content. Route to a human.&quot;,<br>            },<br>        ),<br>    },<br>)<br><br>answers = response.answers<br>print(answers[&quot;answers_question&quot;].noul)   # 0.95 — yes, it answers the question<br>print(answers[&quot;policy_violation&quot;].noul)   # 0.88 — yes, it violates policy<br>print(answers[&quot;action&quot;].choice) # &quot;escalate&quot;</pre><p>The agent’s response answered the question — but applied a discount it wasn’t authorized to give. Jev catches this before it reaches the user. Your code routes to a human.</p><h3><strong>Why Typed Decisions Beat Free-Form LLM Output</strong></h3><p>When you need a decision — not a conversation — free-form text output creates unnecessary work and risk:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gf3qv7S5hSxbSg-9o3ZhCw.png" /></figure><p>The fundamental insight: <strong>keep policy in code, not in prompts</strong>. When priorities change — route frustrated customers to senior agents, raise the severity threshold for blocking — you change a number in your code. The model doesn’t need to know.</p><h3>JEV <strong>Quick Start</strong></h3><ol><li><strong>Install</strong></li></ol><pre>pip install typesafe-sdk</pre><p><strong>2. Get your API key</strong></p><p>Sign up at <a href="https://console.typesafe.ai/">console.typesafe.ai</a> and grab a key from the dashboard.</p><pre>export TYPESAFE_API_KEY=your_key_here</pre><blockquote><strong>⚠️ Note: JEV is not free.</strong> Using JEV requires purchasing credits through the TypeSafe console, as there is currently no free tier available. If you’re interested in exploring similar functionality without any upfront cost, stay tuned — I’ll be publishing more blogs soon covering free and open-source alternatives.</blockquote><p><strong>3. Make your first call</strong></p><pre>from typesafe_sdk import Choice, Noul, Score, TypeSafeClient<br><br>client = TypeSafeClient()  # reads TYPESAFE_API_KEY from env<br><br>ticket = &quot;Hi, I&#39;ve been trying to connect my Stripe account for 3 days and the integration keeps failing. I&#39;m losing sales. Please help ASAP.&quot;<br><br>response = client.system_one(<br>    state=ticket,<br>    questions={<br>        &quot;department&quot;: Choice(<br>            instructions=&quot;Which team should handle this&quot;,<br>            criteria={<br>                &quot;billing&quot;: &quot;Payment or subscription issues&quot;,<br>                &quot;technical&quot;: &quot;Bugs or integration problems&quot;,<br>                &quot;sales&quot;: &quot;Pricing or account questions&quot;,<br>            },<br>        ),<br>        &quot;frustration&quot;: Score(<br>            instructions=&quot;How frustrated the customer appears&quot;,<br>            criteria=[<br>                &quot;Calm, just stating facts&quot;,<br>                &quot;Frustrated but civil&quot;,<br>                &quot;Very angry, strong language&quot;,<br>            ],<br>        ),<br>        &quot;is_urgent&quot;: Noul(<br>            instructions=&quot;The message conveys urgency or time-sensitivity&quot;,<br>        ),<br>    },<br>)<br><br>print(response.answers[&quot;department&quot;].choice)   # &quot;technical&quot;<br>print(response.answers[&quot;frustration&quot;].score)   # 1.0<br>print(response.answers[&quot;is_urgent&quot;].noul)      # 1.0<br><br><br>&#39;&#39;&#39;<br>response.answers[&quot;department&quot;].choice      → &quot;technical&quot;<br>  The model selected this from your criteria. 85% probability on &quot;technical&quot;, 15% on &quot;billing&quot;.<br><br>response.answers[&quot;department&quot;].confidence  → 0.78<br>  How peaked the distribution is. 0.78 = reasonably confident. Low confidence → consider routing to a human.<br><br>response.answers[&quot;frustration&quot;].score      → 1.0<br>  Position on your 0–2 scale. Exactly on level 1 = &quot;Frustrated but civil&quot;. Confidence is 1.0 = all probability on that level.<br><br>response.answers[&quot;is_urgent&quot;].noul         → 1.0<br>  Probability the statement is true. 1.0 = definite yes, this is urgent.<br>&#39;&#39;&#39;<br></pre><p><em>TypeSafe documentation: </em><a href="https://docs.typesafe.ai/"><em>docs.typesafe.ai</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8023bdfd6f43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ralph Wiggum Loop: How I Let an Agent Build an Entire App While I Drank Coffee]]></title>
            <link>https://medium.com/@arjunvishnu2000/the-ralph-wiggum-loop-how-i-let-an-agent-build-an-entire-app-while-i-drank-coffee-da57d9a0e261?source=rss-a43b4ca27e08------2</link>
            <guid isPermaLink="false">https://medium.com/p/da57d9a0e261</guid>
            <category><![CDATA[ralph-wiggum]]></category>
            <category><![CDATA[spec-kit]]></category>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[ibm-bob]]></category>
            <category><![CDATA[ralph-wiggum-loop]]></category>
            <dc:creator><![CDATA[Arjun TS]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 19:23:29 GMT</pubDate>
            <atom:updated>2026-07-26T19:23:29.177Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>&gt; Spec-driven development, a bash loop, and a fresh context window every iteration — a practical guide to fully autonomous AI coding with IBM Bob.</blockquote><p>I’ve been experimenting with a workflow that feels almost embarrassingly simple once you see it — and yet it produces results that would normally take days of careful prompting and babysitting. It’s called the <strong>Ralph Wiggum Loop</strong>, and after running it on a full-stack todo app, I’m convinced it’s one of the most practical AI-assisted development patterns available right now.</p><p>Let me walk you through what it is, why it works, and how you can use it with IBM Bob today.</p><h3><strong>What Is the Ralph Wiggum Loop?</strong></h3><p>The Ralph Wiggum Loop is a methodology for fully autonomous AI-driven software development. At its core, it is a <strong>bash loop that runs your AI agent repeatedly — one task at a time — starting with a fresh context window every single iteration.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NjfdtKxfPM6Z7psDCuJawA.png" /></figure><p>The name traces back to a character from <em>*The Simpsons*</em>, but the intellectual origin is a post by Geoffrey Huntley at <a href="https://ghuntley.com/loop">ghuntley.com/loop</a>. Huntley’s insight was deceptively simple:</p><blockquote>&gt; Most AI coding sessions fail not because the model is bad, but because the context window degrades. The longer the session, the worse the output.</blockquote><p>His solution: <strong>don’t have one long session</strong>. Have many short, focused ones. The bash loop is the orchestrator. The AI agent does the work. Files on disk — specs, a plan, a history log — act as shared memory between iterations.</p><p>Ralph Wiggum takes this idea and adapts it specifically for <strong>IBM Bob Shell</strong>, adding spec-driven development, a project constitution, and a structured setup flow. The result is a system where you describe your project once, answer a few questions, and watch an AI agent build it — spec by spec, commit by commit — entirely on its own.</p><h3><strong>How It Works</strong></h3><p>The loop is conceptually straightforward:</p><pre>while true; do<br>  pick unfinished next spec<br>  start a fresh bob process with that spec as context<br>  if output contains &quot;&lt;promise&gt;DONE&lt;/promise&gt;&quot;; then<br>    mark spec as done, move to the next<br>  else<br>    retry<br>  fi<br>done</pre><p>Each iteration follows a fixed sequence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*et6x-pyzBoSbs4crfT3M7A.png" /></figure><p>Four ideas hold the whole system together:</p><p><strong>1. Fresh context each loop.</strong> Every iteration starts a new `bob` process. No context overflow. No model confusion from earlier decisions bleeding into later ones.</p><p><strong>2. Shared state on disk.</strong> Between iterations, everything the agent needs to know lives in files — not in memory. A <strong>specs/ </strong>folder holds what needs to be built. A `history.md` logs what’s been done. A <strong>CONSTITUTION.md</strong> defines the project’s guiding principles.</p><p><strong>3. The completion signal.</strong> Bob outputs <strong>&lt;promise&gt;DONE&lt;/promise&gt; only</strong> when every acceptance criterion in the spec has been verified and tests pass. The bash script watches for this string. If it’s absent, the loop retries automatically. This is what makes the system self-correcting.</p><p><strong>4. Backpressure via tests.</strong> Tests, lint, and build steps act as guardrails. Bob <strong>must</strong> fix failures before it is permitted to signal completion. Bugs get fixed within the iteration rather than accumulating.</p><h3><strong>Pros and Cons</strong></h3><p>No methodology is a silver bullet. Here’s an honest assessment.</p><h4><strong>Pros:</strong></h4><p><strong>Context freshness.</strong> The single biggest practical problem with AI coding sessions — context degradation — is solved structurally. Every new iteration is as sharp as the first.</p><p><strong>Self-correcting.</strong> Because the completion signal is gated on tests passing, the loop inherently retries when something is broken. You don’t need to watch it.</p><p><strong>Auditable.</strong> Every iteration produces a git commit and a log file. You get a full, readable history of what the AI built and when. Nothing happens in a black box.</p><p><strong>Scales to any project size. </strong>Got 50 specs? The loop doesn’t care. It will run through all of them. The system scales indefinitely because each iteration is independent.</p><p><strong>Low cognitive overhead.</strong> You write specs once — in plain markdown — and hand off. No prompt engineering on every task. No babysitting.</p><h4><strong>Cons:</strong></h4><p><strong>Not token efficient.</strong> Every iteration re-reads the constitution and the full spec. If your goal is minimising token spend, fully autonomous coding is working against that objective. The loop trades cost for hands-off execution.</p><p><strong>You trade quality certainty for reduced attention. </strong>Going fully autonomous means you’re not reviewing every decision in real time. You gain time back, but you sacrifice some quality certainty — bugs or design choices you’d have caught interactively may slip through to the commit.</p><p><strong>The “dumb zone” risk. </strong>If a spec is too large and context auto-compacts mid-iteration, the model can enter a degraded state and produce catastrophic output. Keep specs small and focused — one clear deliverable each — to avoid this entirely.</p><p><strong>Bug poisoning. </strong>If Bob writes bad tests in an early spec — tests that pass but don’t actually verify the right behaviour — those tests become the ground truth for every future iteration. Bad tests compound. A poisoned test suite can derail the entire build silently.</p><p><strong>Speccing takes time. </strong>Writing good specs with concrete acceptance criteria isn’t free. If the speccing work takes longer than it would to just have parallel subagents implement the changes directly, you’ve spent more time planning than building. Reserve the loop for projects where the upfront investment clearly pays off.</p><h3><strong>Exploration Mode: The Second Way to Use the Ralph Loop</strong></h3><p>There’s a second way to use the Ralph loop that sidesteps nearly all of the cons above. We can call it as <strong>Exploration Mode</strong>— and it’s the pattern with almost no downside.</p><p>The core idea: point the loop at <strong>low-stakes or secondary projects</strong> where you don’t need a rigid, perfect plan. Instead of spending hours architecting the ideal spec, you do a quick 5-minute brain dump into the AI, let it generate the initial tasks, launch the loop, and walk away.</p><p>It’s designed for exactly this kind of work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-_1aGnq-yoJaQ2BxRgoOw.png" /></figure><h4><strong>The Four-Step Flow:</strong></h4><pre>5-min spec → Launch → Walk away → Check results</pre><p><strong>1. Quick spec (5 minutes).</strong> Don’t overthink it. Brain-dump your idea into a loose spec — a goal, some context, rough requirements. No rigid acceptance criteria needed. The AI will figure out the tasks from your notes.</p><p><strong>2. Launch.</strong> Fire the loop and let it run autonomously. `./scripts/ralph-loop.sh` and you’re done.</p><p><strong>3. Walk away.</strong> Go focus on something else. Sleep. This is the point — you are not watching it.</p><p><strong>4. Check results.</strong> Come back to a commit, a log, and a head start on a project you otherwise wouldn’t have touched.</p><h3>Using the Ralph Wiggum Loop with IBM Bob Shell</h3><p>Before using this skill, make sure <strong>IBM Bob Shell</strong> (bob CLI) is installed and configured on your system.</p><p>To bring the Ralph Wiggum Loop to <strong>IBM Bob Shell</strong> (bob CLI), I created the <strong>ralph-wiggum-bob</strong> skill. It packages the Ralph Wiggum methodology into a reusable Bob skill, making it easy to use in any Bob project.</p><p>Install the skill:</p><pre>npx skills add injusticescorpio/ralph-wiggum-bob</pre><p>Then invoke it in a Bob session:</p><p><em>&gt; invoke the skill </em><strong><em>ralph-wiggum-bob</em></strong></p><p>Once invoked, the skill guides Bob through the Ralph Wiggum Loop, enabling it to iteratively analyse, verify, and refine its work using the methodology.</p><h4><strong>A Real Example: Building a Todo App:</strong></h4><p>I started with an empty `todo-app/` directory and installed <strong>ralph-wiggum-bob</strong> skill from skill.sh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gcJu_zdmShZzQU4_Tn2yjg.png" /></figure><p>In BOB IDE, I simply typed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZY9XfQ0U5MFeHvXR8bhVA.png" /></figure><p>Bob reads the skill’s instructions and starts a lightweight project interview — three questions, under two minutes:</p><pre>1. What are you building?<br>2. What&#39;s the tech stack?<br>3. How many specs should we break it into?</pre><p><strong>Always enable YOLO mode:</strong> This allows Bob to run in a fully automated, non-interactive mode, where all tool invocations and file modifications are executed without requiring manual approval.</p><p>From those answers, Bob scaffolds the entire Ralph Wiggum project structure automatically.</p><pre>todo-app/<br>├── AGENTS.md                          ← Bob reads this automatically<br>├── .specify/memory/constitution.md    ← Project source of truth<br>├── specs/<br>│   ├── 01-project-scaffold.md<br>│   ├── 02-add-todos.md<br>│   ├── 03-complete-todos.md<br>│   ├── 04-delete-todos.md<br>│   ├── 05-localstorage-persistence.md<br>│   └── 06-filter-todos.md<br>├── scripts/<br>│   ├── ralph-loop.sh                  ← The loop runner<br>│   └── lib/spec_queue.sh<br>├── logs/<br>├── history/<br>└── completion_log/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arLmqHLs5quHFg8b-Hgkog.png" /></figure><p><strong>Note:</strong> Bob may automatically generate a spec from your initial prompt. If it doesn’t, simply ask Bob to generate one based on your requirements, or use <strong>Spec-Kit</strong> to create it. You can also run the loop in planning mode to generate an implementation plan before starting development:</p><pre># Run in planning mode (generates IMPLEMENTATION_PLAN.md)<br>./scripts/ralph-loop.sh plan</pre><p>Once the <strong>spec</strong> is ready, invoke the loop to create the project:</p><pre>chmod +x scripts/ralph-loop.sh &amp;&amp; ./scripts/ralph-loop.sh </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMF7_O3UoutqRKLVzetEVA.png" /></figure><p><strong>Note:</strong> You can also customize the loop execution by specifying the maximum number of iterations.</p><pre># Run with a maximum of 20 iterations<br>./scripts/ralph-loop.sh 20</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*OVMQiIEY7394030Ch_LC6g.png" /></figure><p>After the <strong>loop finishes</strong>, you should see your Todo app like this:</p><h3><strong>Resources</strong></h3><ul><li><a href="https://ghuntley.com/loop/">Geoffrey Huntley’s loop </a>methodology</li><li><a href="https://github.com/injusticescorpio/ralph-wiggum-bob">ralph-wiggum-bob skill on GitHub</a></li><li><a href="https://bob.ibm.com/docs/shell/getting-started/start-bobshell-non-interactive">IBM Bob Shell</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da57d9a0e261" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving Context Rot with Recursive Language Models: A Practical Guide with IBM WatsonX]]></title>
            <link>https://medium.com/@arjunvishnu2000/solving-context-rot-with-recursive-language-models-a-practical-guide-with-ibm-watsonx-e5346af3ed31?source=rss-a43b4ca27e08------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5346af3ed31</guid>
            <category><![CDATA[context-rot]]></category>
            <category><![CDATA[recursive-language-models]]></category>
            <category><![CDATA[ibm-watsonx]]></category>
            <category><![CDATA[watsonx-ai]]></category>
            <dc:creator><![CDATA[Arjun TS]]></dc:creator>
            <pubDate>Sat, 30 May 2026 14:29:36 GMT</pubDate>
            <atom:updated>2026-05-30T14:40:59.954Z</atom:updated>
            <content:encoded><![CDATA[<p>In the rapidly evolving landscape of AI and large language models, we’re constantly pushing the boundaries of what’s possible. But as we build more complex systems, we encounter a fundamental challenge: <strong>context rot</strong>. Today, I’ll introduce you to Recursive Language Models (RLM), an innovative approach that addresses this problem, and show you how to get started using IBM WatsonX.</p><h3><strong>The Context Rot Problem</strong></h3><p>Have you ever had a long conversation with Claude or ChatGPT, only to notice it starts “forgetting” things you discussed earlier? Or watched it completely miss the punchline of a joke it started telling? This phenomenon is called <strong>context rot</strong>.</p><p><a href="https://www.anthropic.com/research/context-rot">Anthropic defines context rot</a> as: <em>”when the number of tokens in the context window increases, the model’s ability to accurately recall information from that context decreases.”</em></p><p>Here’s what happens in practice:</p><p>Imagine you’re building an AI agent that needs to solve a complex mathematical problem like `2^(2^(2^(2)))`. A traditional LLM approach involves:</p><p>1. Loading the entire problem into the context window</p><p>2. Computing intermediate results</p><p>3. Keeping ALL intermediate steps in context</p><p>4. Eventually hitting token limits or degraded performance</p><p>The problems compound quickly:</p><ul><li><strong>Token limits are exceeded</strong>: Context windows fill up (even with 128K+ tokens)</li><li><strong>Information gets lost (Lost in the Middle Problem)</strong>: Critical details get “forgotten” as context grows</li><li><strong>Performance degrades</strong>: Models become “dumber” with longer contexts</li><li><strong>Costs skyrocket</strong>: Every token in context costs money, and redundant information multiplies</li></ul><p>But here’s the surprising part: even on benchmarks like <a href="https://arxiv.org/abs/2404.06654">RULER</a>, most frontier models actually perform extremely well (90%+ on 1-year old models). So why does context rot feel so real in practice?</p><p>The answer: <strong>fully hitting the mark doesn’t mean the problem is solved</strong>. Real-world tasks require processing essentially unbounded input context and output length, and mitigating degradation that we can’t easily benchmark. Traditional LLMs treat every piece of information equally, keeping everything in their active context window. This works fine for simple tasks, but fails when you need deep, recursive reasoning or long chains of computation.</p><h3><strong>Introducing Recursive Language Models (RLM)</strong></h3><p>Recursive Language Models (RLM) offer an elegant solution to context rot by fundamentally changing how AI systems manage information during complex reasoning tasks.</p><p>RLMs are <strong>not bigger models</strong>.</p><p>They are <strong>not models with larger context windows</strong>. They are <strong>not a new transformer architecture</strong> And they are <strong>not just a fancy prompt template</strong>.</p><p>They are a shift in how language models are used.</p><p>Traditional LLMs usually operate in a single forward pass. You provide a prompt, the model processes the entire context through attention, and it returns an answer.</p><p>Everything happens inside one monolithic computation.</p><p>RLMs break that assumption.</p><p>Instead of forcing the model to solve everything in one pass, an RLM allows the system to decompose a task into smaller sub-tasks, solve those sub-tasks independently, and combine the results into a final answer.</p><p>So instead of one large reasoning step, you get structured reasoning across multiple steps.</p><p><strong>The Core Difference (LLM/RLM)</strong></p><p>A standard LLM treats <strong>context as input</strong>.</p><p>An RLM treats <strong>context as state</strong>.</p><p>That distinction is the key idea.</p><p>In the traditional setup, all relevant information must fit inside the model’s context window at once. The model’s main tool is attention over that prompt.</p><p>In an RLM setup, information can live <strong>outside the model</strong> in a controlled Python REPL environment.The model interacts with that environment instead of carrying everything in one prompt.</p><p>That means it can:</p><ul><li>Inspect parts of the environment</li><li>Transform sections of stored information</li><li>Generate sub-queries</li><li>Call itself recursively on smaller pieces</li></ul><p>The reasoning process becomes <strong>iterative instead of flat</strong>.</p><p>Another useful way to frame this is:</p><p>- Traditional LLMs are often <strong>problem-centric</strong>: fit the whole problem into context</p><p>- RLMs are more <strong>query-centric</strong>: answer a query by operating over external state</p><p>That shift is what makes the approach powerful.</p><p><strong>How RLM Works?</strong></p><p>RLM provides a thin wrapper around a language model that enables:</p><p>1. <strong>Recursive LM calls</strong>: The model can spawn recursive calls for intermediate computation</p><p>2. <strong>REPL environment</strong>: A Python REPL Notebook environment stores the (potentially huge) context</p><p>3. <strong>Root LM (depth=0)</strong>: The initial LM that receives only the query and can interact with the environment</p><p>4. <strong>Sub-queries</strong>: The root LM can recursively call itself or other LMs over the stored context</p><p>5. <strong>Efficient parsing</strong>: Only relevant context is retrieved when needed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5LSTiqAtheE0fGnqYLTlKw.png" /></figure><p>Each computation step:</p><ul><li>Runs with minimal context</li><li>Stores results in the REPL environment</li><li>Retrieves only what it needs</li><li>Keeps the active context window focused</li><li>Lets the root LM coordinate the overall reasoning process</li></ul><p>This is why RLMs are useful for long-horizon reasoning. The system does not need to keep every intermediate detail inside one giant prompt.</p><h3><strong>The Paradigm Shift</strong></h3><p>The difference in mindset is simple but important.</p><p><strong>Traditional LLM thinking:</strong></p><pre>How do I fit this entire problem into the context window?</pre><p><strong>RLM thinking:</strong></p><pre>How do I answer this query by operating over context stored outside the model?</pre><p>That shift from <strong>problem-centric</strong> reasoning to <strong>query-centric</strong> reasoning is what makes RLMs more scalable for complex tasks.</p><h3><strong>RLM vs RAG: What’s the Difference?</strong></h3><p>At first glance, Recursive Language Models can look similar to Retrieval-Augmented Generation.</p><p>Both approaches:</p><ul><li>Store information outside the model</li><li>Fetch relevant pieces when needed</li><li>Avoid stuffing everything into the context window</li></ul><p>But they are not the same thing.</p><p><strong>RAG</strong> is primarily about retrieving relevant information from an external knowledge source and injecting it into the prompt.</p><p><strong>RLM</strong> is about structuring reasoning recursively over external state.</p><p>So while retrieval can be part of an RLM system, recursion is the defining feature. RLM is not just about fetching context. It is about decomposing reasoning itself.</p><h3><strong>What RLMs Do Not Solve</strong></h3><p>Recursive Language Models are powerful, but they are not a universal fix.</p><p>They do <strong>not</strong> eliminate hallucinations.</p><p>If the model makes a bad inference at one recursive step, that error can propagate.</p><p>They do <strong>not</strong> automatically reduce latency.</p><p>Recursive execution often introduces sequential calls, which can increase wall-clock time.</p><p>They do <strong>not</strong> solve code-generation fragility.</p><p>If the model generates incorrect instructions or invalid code, the surrounding system still needs safeguards and failure handling.</p><p>And they are <strong>not</strong> optimized for instant conversational speed.</p><p>RLM frameworks are generally better suited for research, analysis, planning, and long-horizon reasoning than for ultra-fast chat interactions.</p><h3><strong>Quick Start: RLM with WatsonX</strong></h3><p><strong>Note: </strong>At the moment, the RLM project does not provide native WatsonX client support. However, I have raised a pull request to add WatsonX integration (<strong>PR:</strong> <a href="https://github.com/alexzhang13/rlm/pull/161">https://github.com/alexzhang13/rlm/pull/161</a>). Until that PR is merged and included in an official release, you can use the setup instructions below to run RLM with WatsonX. The steps cover installing the required dependencies, configuring your WatsonX credentials, and executing the provided example script.</p><h4><strong>Prerequisites</strong></h4><p>Before getting started, you will need:</p><ul><li>Python 3.11 or higher</li><li><a href="https://github.com/astral-sh/uv">uv</a> package manager</li><li>A WatsonX API key and Project ID</li></ul><ol><li>Clone the repository: <a href="https://github.com/injusticescorpio/watsonx-rlm-project">https://github.com/injusticescorpio/watsonx-rlm-project</a></li></ol><pre>git clone git@github.com:injusticescorpio/watsonx-rlm-project.git</pre><p>2. Install dependencies</p><pre>cd watsonx-rlm-project<br>uv sync<br>uv pip install -e .</pre><p>3. Configure credentials</p><pre>cp .env.example .env<br># Edit .env and add your WatsonX credentials:<br># WATSONX_APIKEY=your-api-key<br># WATSONX_PROJECT_ID=your-project-id<br># WATSONX_URL=https://us-south.ml.cloud.ibm.com</pre><p>4. Execute the example script</p><pre>uv run example_watsonx.py</pre><p>5. (Optional) For better visualization you can use the visualizer available in <a href="https://github.com/alexzhang13/rlm/tree/main/visualizer?utm_source=chatgpt.com">the RLM repository’s visualizer directory</a>. Simply provide the log file generated in Step 4 as input to the visualizer.</p><h3><strong>Conclusion</strong></h3><p>Context rot is a real challenge in modern AI systems, especially when we ask models to reason over long inputs, large codebases, or multi-step workflows.</p><p>Recursive Language Models offer a compelling alternative.</p><p>By treating context as <strong>state</strong> instead of just <strong>input</strong>, RLMs let language models operate over external memory, recursively decompose tasks, and keep each reasoning step focused.</p><p>That leads to several important benefits:</p><ul><li>Unbounded effective context: Not limited by the model’s context window</li><li>Efficient token usage: Only relevant pieces are loaded per call</li><li>Persistent state: Results survive across multiple reasoning steps</li><li>Natural recursion: Complex problems decompose into manageable sub-tasks</li></ul><h3>References:</h3><p><a href="https://alexzhang13.github.io/blog/2025/rlm/">Alex L. Zhang | Recursive Language Models</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5346af3ed31" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>