TheFocus.AI TheFocus.AI
09 running agents in production Lesson 37

Corrections That Stick

Self-modifying agents, and how to verify a correction survived the night.

~10 min

TUTOR WITH THEFOCUS.AI

Agent Integration

Copy this prompt into Claude, ChatGPT, or any external AI assistant. It points the assistant to the course instructions and links it to your student profile to track your progress and customize observations.

Please tutor me in this lesson using the following context. First, read the instructions at: https://courses.thefocus.ai/llms.txt My Student ID is: <none> The lesson markdown source is at: https://courses.thefocus.ai/mastering-claude/09-running-agents-in-production/37-corrections-that-stick.md

You are not enrolled yet. Enroll to generate a Student ID to track lesson completions and store learning notes.

Interact, correct, verify

Start a chat session with your agent:

umwelten chat bookkeeping-agent

Ask a real question. Make a correction. End the session. Start a new session. Verify the correction persisted.

Cornwall Market: Sarah starts a chat with the bookkeeping agent and asks about a $600 invoice from Chen’s Produce.

The agent categorizes it correctly — account 5100. Sarah says, “Actually, any Chen’s Produce items over $500 should be flagged for manager review. We had a case quantity error last quarter and I want to catch those early.”

The agent acknowledges the correction and updates its categorization skill — adding a new exception rule. Sarah ends the session.

She starts a new session the next day. “I have a $720 invoice from Chen’s Produce.” The agent categorizes it to 5100 and flags it for manager review, citing the rule Sarah added yesterday. The correction stuck.

Try This

Run umwelten chat your-agent. Ask a real question from your domain. Then make a correction — tell the agent something it should do differently next time. End the session. Start a new one. Ask a question that should trigger the correction. Did it persist?

If you enabled self-modify in your habitat config, the agent updated its own skill files. Check the skill — you will see the correction recorded. This is the feedback loop in action.

One agent, many windows

The same habitat, with the same tools and the same memory, is accessible from any interface:

InterfaceHow It WorksBest For
CLIumwelten chat bookkeeping-agentInteractive development, debugging, corrections
TelegramMessage the bot directlyMobile access, quick checks, approvals
DiscordChannel or DMTeam collaboration, shared visibility
Web dashboardOpen in browserHistory review, team access, management

The interface is a surface. The agent underneath is the same. A correction you make on Telegram is reflected when you open the CLI. A decision logged in the web dashboard is available in Discord. One agent, many windows.

Every conversation is a transcript.jsonl file — searchable, replayable, exportable. When the agent picks up a conversation tomorrow, it loads the transcript and has full context. When you want to audit what the agent did last Tuesday, you search the transcripts.

Multi-provider strategy

Umwelten supports multiple providers through a single getModel() interface:

import { getModel } from 'umwelten';

const claude = getModel('claude-sonnet-5');
const gemini = getModel('gemini-3.5-pro');
const local  = getModel('ollama:qwen3');

// All return the same interface — swap freely
const response = await claude.generate(prompt, { tools });

Same interface, any provider. The eval system uses this to test across providers. The production system uses it to route requests. Same code, different purposes.

Check your understanding

Answer in your own words — write it down before opening the key. Your tutor grades against the criteria and generates fresh variants on retries.

Q1. In a habitat, what makes a correction persist across sessions, and how would you verify tomorrow that a correction you made today actually stuck?

Answer key — attempt every question first

Answer key

Q1

Model answer: Persistence comes from the correction being written into the habitat’s files — the skill or memory files the agent loads at startup — not merely said in a conversation. Verification: start a fresh session tomorrow, pose a case that triggers the rule, and confirm the agent applies it; optionally check the skill file’s diff to see the correction recorded.

Pass criteria: file/memory write as the persistence mechanism; verification = fresh session + triggering case (and/or inspecting the diff)

Next: From Eval to Production

Previous Lesson 37 of 42 Next