1 /

Functions That
Train Themselves

Most automation never finds out how it went. So it never gets better. Here's how to build the feedback loop in.

Ashkaan Hassan · We Solve Problems · EO Los Angeles

Think About What Actually Stops You

You want every lead answered in five minutes. You can't staff that.

You want the numbers reviewed every Monday. Someone has to build it.

You want the follow-up done. Someone has to remember.

You want to enter a new market. Who's going to run it?

It was never the ambition. It was the capacity.

That Premise Just Broke

The good people were always expensive, already busy, and eventually gone. Now competent work is something you buy by the unit. It doesn't sleep, doesn't quit, and gets cheaper every quarter.

The question stopped being

“Who do I hire to do this?”

“What should own this?”

Almost nobody has rebuilt around that yet. The ones who win won't be the ones with the best model. They'll be the ones whose functions get better every week without them.

What I Run My Company On

I run a small IT firm, and this system runs alongside me every day. Everything I'm about to show you is in production, wired into the real business.

Dozens

of automations in production

Every

tool I use, wired in

Daily

running unattended, on a schedule

Zero

vendor lock-in, all plain text

It runs my company and my house. None of this is a demo.

Four Rungs

Every one is a yes-or-no you can answer about your own setup right now.

L1
Chatbot
You ask, it answers, you do the work.
L2
Skill — a procedure it runs the same way every time
Repeatable outcome. Same input, same quality, no re-explaining.
L3
Automation
Something other than you pulls the trigger. A schedule, an event, an incoming email.
L4
Self-training function
It has a feedback loop. Every run makes the next run better.

Ask One Thing About Anything You've Already Built

Does it ever find out how it went?

Open loop

It fires, produces something, and never learns the result. This is almost everything people build. It plateaus, then gets quietly abandoned.

Closed loop

It sees what happened and writes the lesson down. You ignore it for a month and come back to something better than you left.

A function without a loop decays. A function with one compounds. That's the whole talk.

Part I

The Floor Under
the Rungs

A loop needs somewhere to write the lesson down. These six pieces are that somewhere.

Piece 1

Instruction Files

Your AI behaves the same way every time — your way.

Think of it as an employee handbook. It covers how you communicate, what tools to use, what rules to follow, and what's off limits.

You write it once. Every conversation after that follows your rules.

# My AI Instructions
Be concise, not verbose
Technical depth is welcome
Never send emails without my approval
Use sub-agents for research
End every session with a journal entry
Commit and push all changes

What Goes in an Instruction File

Your Voice

Output matches your tone — direct, concise, technically deep. No more editing AI drafts to sound like you.

Your Team

The AI delegates research, bulk edits, and scheduled tasks to specialist agents. It manages them like you'd manage a team.

Your Workflow

Every session follows the same lifecycle: load context, do the work, log what happened, save everything. Automatically.

Your Safety Net

The AI never sends emails without approval, never exposes credentials, never takes an action you haven't authorized.

Different AI agents can get different instruction files — a research agent gets different rules than your primary agent.

Pro tip

The Context Router

The AI always has exactly the right information for what you're doing — without you asking for it.

Writing an email? It already loaded your email templates. Talking about a client? It already pulled their profile.

It never loads everything at once. It stays fast and focused by only pulling what the moment requires.

# When this happens → load this
Writing emails → email templates
Building apps → dev style guide
Project work → project index
Person mentioned → their profile
Using an API → API docs
Handling credentials → security rules
# Only loads what's needed, when needed
Piece 2

Your Rules & Preferences

Everything comes out in your voice — on the first draft, every time.

Your email style, code conventions, presentation format, communication tone — captured once, applied forever.

No more editing AI output to sound like you. It already does.

Email Templates
How to structure proposals, follow-ups, cold outreach
Code Conventions
Naming, structure, testing standards
LinkedIn Voice
Tone, topics, formatting for posts
Behavioral Rules
Guardrails, safety policies, deploy procedures
Piece 3

Your Domain Knowledge

The AI knows your world — your people, your numbers, your goals. It never asks "what do you do?"

👥
People
Team, clients, contacts, family
📈
Business
KPIs, processes, strategy
💰
Finance
Budget, tax, investments
🎯
Goals
Quarterly targets, milestones

Mention a person — the AI knows them. Discuss finances — it has your budget. Context shows up automatically.

Piece 4

Your Automations

Work happens while you sleep. Reports generate, systems get monitored, content gets drafted — all on a schedule.

The AI understands each automation and can modify, debug, and extend them on its own.

I have dozens of automations running right now — from news digests to financial reports to health tracking.

# Example automations
Morning news digest (daily 7 AM)
Weekly business scorecard (Mon midnight)
Security assessments (per client)
Goal tracking dashboard (every 15 min)
LinkedIn content publisher
System health monitoring (24/7)
Piece 5

Your Integrations

Your AI talks to all your tools — pulling data, pushing updates, and orchestrating across systems you already use.

Google Workspace
QuickBooks
1Password
Cloudflare
Todoist
Home Assistant
Autotask
NinjaOne
Hudu
Strety
Monarch
LinkedIn
TRMNL
Zoom
Notion

Your AI becomes the nervous system tying all your tools together.

Piece 6

Long-Term Memory

"What did we decide about the pricing model?" Six months later, the AI knows.

Every initiative is tracked as a project with status and next steps. Every session ends with a journal entry logging decisions and changes.

The AI's memory gets better over time — not worse.

Projects

Each initiative gets a folder with status, description, and next steps. The AI updates these as work progresses.

Journal

Daily session logs capture every decision, change, and lesson. Searchable forever. Every session compounds on the last.

The Complete Picture

Instruction Files

Consistent behavior, every time

Rules & Style

Everything in your voice

Domain Knowledge

It knows your world

Automations

Work happens while you sleep

Integrations

All your tools, connected

Long-Term Memory

It remembers everything

All plain text. All in one folder. All version-controlled.

No database. No proprietary format. No vendor lock-in.

Part II

Your AI Team

One orchestrator, multiple specialists

The Delegation Chain

Your primary AI doesn't do everything itself. It delegates to specialists — just like you manage a team.

Primary Agent (Claude)
Plans, coordinates, writes, journals — the "manager"
Research Agent
Web research, video summaries, fact-checking
Code Agent
Bulk edits, file changes, code generation
Workflow Engine
Scheduled jobs, monitoring, alerts

Each specialist has its own instruction file. The primary agent only receives a summary back — keeping it fast.

A Typical AI Session

01
You start a conversation — AI loads your preferences and rules automatically
02
You describe the task — AI loads only the context it needs (router)
03
AI does the work — delegates to specialists, calls your integrations
04
You review and approve — human in the loop for anything that matters
05
AI journals the session — logs decisions, changes, and what's next
06
Everything is saved — version-controlled, searchable, permanent

Every session builds on every session before it. That's the compounding effect.

Part III

The Loop

What turns an automation into a function that trains itself

A Loop Is Three Parts

Most automations have zero of them. Miss any one and the loop is open.

01
Signal

Did it find out how it went?

The correction you gave. The deal that closed. The alert that fired.

02
Capture

Did the lesson get written down?

A rule in a file. Not a chat message that scrolls away and is gone by morning.

03
Recall

Does the next run read it?

The rule loads before the work starts. So the mistake can't happen twice.

Signal without capture is a lesson you forget. Capture without recall is a file nobody reads. You need all three.

One I Got Wrong Once

Not a diagram. This is a real loop from my system, running right now.

SIGNAL

The AI asked to deploy something. I told it: a bug report is not permission to ship. Fix the tree, don't push until I say so.

CAPTURE

That correction became a rule in a file, stamped with the date I gave it.

never-deploy-without-explicit-authorization — a bug report is NOT permission to push; a stated hold stands until I personally lift it.
RECALL

That rule now loads at the start of every session, before any work happens. I have never had to give that correction again.

Every rule in my system is a mistake that can't happen twice. The list only grows in one direction.

Part IV

“Show Me the Money

What this system produces in practice

Weekly Scorecard — Zero Data Entry

BEFORE

Every Monday, 45 minutes pulling ticket data, calculating KPIs, typing numbers into a spreadsheet.

AFTER

Ticket system → AI computes KPIs → pushes to scorecard. Every Monday at midnight. Zero human effort.

0
minutes per week
was 45 min

Morning Briefing

Every day at 7:00 AM, an email lands in my inbox:

Curated news digest (filtered for relevance)
Today's calendar at a glance
Task priorities for the day
Weather and commute info
7:00
Every. Single. Day.

I didn't ask for it. It just shows up.

Self-Healing Automation

Dozens of automations running 24/7. When something fails:

01

A monitoring system catches it immediately

02

AI diagnoses the root cause

03

Applies the fix automatically

04

Notifies me only if it can't self-resolve

Most failures are fixed before I even notice.

The Real ROI

Weekly scorecard
45 min/week0 min
Security assessments
hours/clientminutes
Morning briefing
15 min/day0 min
Content production
hours/piecereview only

This isn't incremental improvement. This is a step change.

And it compounds — every automation you build frees time to build the next one.

Part V

Your Turn

How to build your first loop this week

You Don't Need L3 to Get L4

The rungs aren't a staircase you have to climb in order. A loop can ride on a skill you still trigger by hand.

You run it yourself, it learns from each run, it gets better. No schedule, no infrastructure, no engineer required.

Which means the cheapest closed loop in the world is this: you as the sensor, a file as the memory.

Build One Loop This Week

Pick one thing you already ask AI to do. Close the loop on that one thing.

1
Make a corrections file (5 minutes)

One empty text file where fixes live. This is the memory. Point your AI at it so it reads the file before it works.

2
Next time you correct it, write the correction down

Don't just fix it in the chat. Add the lesson to the file, in one line. That's capture. You've now closed the loop once.

3
Watch the same mistake stop happening

In a month the file is your standards, written by your own corrections. That file is the function getting better on its own.

Which Rung Are You On?

L1

You ask, it answers, you do the work.

L2

It runs a skill the same way every time.

L3

Something other than you pulls the trigger.

L4

Every run makes the next run better.

Your first loop takes an afternoon, and it doesn't need a single rung below it.

Want a Head Start?

I open-sourced the framework behind everything in this talk. It's called Contextium.

Pre-built folder structure
Integration connectors for popular tools
Sample automations to learn from
Works with Claude, Gemini, Cursor, Copilot

Apache 2.0. Free forever. You own everything.

terminal
$ curl -sSL contextium.ai/install | bash

One command. Five minutes. The floor is already built.

Q & A

Open floor

Thank You

Ashkaan Hassan

We Solve Problems · wesolve.tech · EO Los Angeles

contextium.ai — open source, free forever