Recursive AI Employee
Deep Dive
A complete technical walkthrough of every moving part — from the moment a user sends a message to the moment a response appears. Built on a real-world implementation by Coulee Tech, generalized as a reusable framework pattern.
The Big Picture
An AI Employee is not a program you write — it is a config object you define. The shared engine handles all execution. This separation means you can add a new Employee by writing a TypeScript object, not a new loop.
WorkerDefinition
Config (who you are)
+
Worker Engine
Runtime (how you run)
=
AI Employee
Fully functional agent
No Employee has its own loop code. They all share the same engine. This is the key architectural insight.
How It All Connects
The complete lifecycle of a single user message. Click any highlighted node to jump to that section of the deep dive.
Explore Each Part
Each section is a standalone deep dive. Read them in order for the full picture, or jump to the part you need.
Reading Guide for AI Assistants
Each sub-page contains genericized TypeScript code and annotated “AI thinks” callouts that show the AI's internal reasoning at each step. The code is structurally identical to Coulee Tech's production system but uses generic domain names so the patterns apply to any use case.
To implement this pattern: start with Part 1 (Worker Definition) to understand the config interface, then Part 3 (Engine) for the loop, then Part 6 (Complete Flow) to see it all together.