
AI Architecture · Intent Systems · PDA Pro
AI Architecture That Makes LLMs Understand Human Intent
I built the complete AI backend for PDA Pro's mentor, Gale: a system that reads what a parent actually needs on every single message, and switches between advising, explaining and just listening without a visible seam.
Role
AI Architect · Backend built end-to-end solo
Timeline
2024-2025
Product
PDA Pro · Learning Yogi
Release
Shipped · 1,000+ concurrent users
The Problem
The words are not the request.
PDA Pro supports parents of children with Pathological Demand Avoidance: a profile where everyday demands trigger extreme anxiety and refusal. At its centre is Gale, an AI mentor parents text when the day falls apart. I designed and built Gale's entire backend (the architecture, the routing, every prompt) as the system the app plugs into.
Here is the problem that shaped all of it. Read this message:
“He wouldn't go to school again today.”
Eleven words. Depending on the parent's day, they are five completely different requests, and the text gives you almost nothing to tell them apart:
QnA
Why does this keep happening? Is it refusal, or burnout?
Wants to understand
Problem Solve
How do I get him in tomorrow without a meltdown?
Wants a plan
Supportive
I'm at the end of my rope and I need to hear I'm not failing.
Wants comfort
Talk Through
I keep wondering if mainstream school is even right for him.
Wants to think out loud
Venting
I just need to say this somewhere no one will judge me.
Wants to be heard, not helped
A human mentor resolves this instantly: from tone of voice, from history, from knowing you. A language model gets the words and nothing else, and it has a strong default for what to do with them: be helpful. Helpful means strategies. And for this audience, strategies at the wrong moment aren't neutral. These are parents judged daily by schools, family and strangers. Answer a parent's worst moment with a bulleted list and you've become one more voice telling them what they're doing wrong. The exact thing they came here to escape.
So the real engineering problem was never generating good answers. It was building the machinery that figures out which conversation you're actually in, on every single message, fast enough that nobody notices it happening.
The Turn
Understanding is not the model's job. It's the architecture's.
The tempting builds all fail the same way. Stuff every instruction into one mega-prompt, and the advice reflex wins anyway. Instructions erode as the conversation grows. Ask the big model to judge its own register per turn, and your slowest, most expensive component is now making invisible decisions, inconsistently, at 1,000+ concurrent users. We even built a dedicated agent whose only job was gathering context before advising. It worked exactly as designed, which meant it interrogated people, and we killed it.
The system that shipped inverts the responsibility. Before the conversational model runs at all, a small, fast classifier reads the message against the full conversation and answers one question: what does this parent need right now? Seven possible answers: seven registers. The answer doesn't tint the reply; it selects which prompt, which rules, and which behaviour the conversation model is given. And the classification is re-made on every message, which is the whole trick: the conversation can change shape mid-stream, the way a good friend changes when your voice cracks.
The seven registers
Problem Solve
“How do I get him to brush his teeth without a battle?”
A strategist, but only after a context check confirms it knows enough about this child to say something non-generic. And when the fix is the phrasing itself, Gale hands the parent to PDA Pro's Translator, which rewrites the demand into low-demand language the child can actually hear.
Follow Ups
“We tried the morning plan you suggested…”
A mentor with memory that picks up the exact plan and strategies from past sessions and iterates on them.
Supportive
“I'm exhausted. Today broke me a little.”
A comforter: validation first, gentle language, no unrequested strategies.
QnA
“What's the difference between PDA and ODD?”
An explainer: clear, factual, grounded in the curated PDA knowledge base rather than the open internet.
Talk Through
“I'm torn about whether to tell his grandparents about the diagnosis.”
A sounding board: open-ended, reflective, helps the parent reach their own position.
Venting
“I cried in the car today. I can't keep doing this.”
A friend texting back: ten words maximum, no questions, no advice. Sometimes “that's so unfair” is the whole job.
Normal
“Morning Gale! We survived the weekend 😅”
Just Gale: warm, human small talk. Not every message is a case to be handled.
One register is deliberately boring. Normal exists because a system that treats every message as a case to be handled stops feeling like a person. Sometimes a parent is just saying good morning.
The Switch
One conversation. Four different Gales. No visible seam.
This is the part of the architecture I care about most. Watch a single conversation move through four registers, and what the system decides between each message, in the moments the parent experiences as nothing at all.
Turn three is the one that matters. The parent was mid-way through a problem-solving thread: a lesser system stays in strategy mode because that's where the conversation “is”. But “I cried in the car today” is not a data point about mornings. The classifier reads intent per message, so Gale dropped the plan mid-thread, met the actual moment, and picked the thread back up only when the parent did.
The switching is also deliberately sticky. The classifier carries an explicit instruction: once a parent has raised a problem, don't abandon it for every emotional flicker. Wait for it to resolve. Without that hysteresis, a single hard sentence inside a practical question would bounce the conversation between registers and Gale would feel scattered instead of attentive. Reading the room includes knowing when not to react.

The intent engine as built: the classifier fans out into seven register prompts, all converging on one conversational agent
“Why does he explode over tiny things? Today it was just putting his shoes on.”
Intent → QnA
A question about PDA itself. Explainer register loaded, knowledge base searched.
“Because for a PDA brain, even a tiny demand can feel like a threat to autonomy. It's anxiety, not defiance. The shoes aren't the problem; being told is.”
“Okay, that actually makes sense. But mornings are still hell. How do I get him out the door?”
Intent → Problem Solve
“How do I” flipped the mode. Same conversation, new register.
Context gate → not enough
A second check: does history hold enough to advise this family specifically? No, so Gale asks before it answers.
“I want to get this right for your mornings, not mornings in general. What does the worst part look like: is it waking, dressing, or leaving the house?”
“All of it. We've tried sticker charts, countdowns, everything. Honestly I'm starting to think it's me. I cried in the car today.”
Intent → Venting
“I cried in the car” changed everything. The strategy thread is dropped mid-plan. Solving now would read as blame.
“That's a lot to carry alone. You're not failing him. You're the one still showing up.”
“Thank you. Can we come back to the morning plan tomorrow?”
Intent → Follow Ups
And the thread is picked back up: tomorrow's session opens from a structured summary of this one.
“Of course. I'll hold onto what you told me about mornings. We'll build it properly tomorrow.”
Asking Beats Guessing
The cheapest classification is the one the parent does for you.
Inference is a fallback. On the first chat of the day, Gale simply asks: “What would be most helpful for you today?” with tappable answers: a quick solution, a venting session, brainstorming, information, sharing a win. Each button sends a known sentence, so the backend routes it with a plain string match. The most common opening move in the product costs zero model calls and cannot be misclassified, because the parent declared their own intent.
The same philosophy governs advice itself. When the register is Problem Solve, a second fast check runs before any strategy is generated: is there enough context about this family to say something that isn't generic?If not, Gale asks about the specifics first. One yes/no classification is the difference between “strategies for meltdowns” and “strategies for your child's meltdowns.”

Declared intent in the shipped app: the parent picks the register, and the backend routes it for free
The Extreme Case
Venting mattered so much it stopped being a register and became a place.
Live usage kept showing the same pattern: parents often didn't want PDA advice at all. They wanted somewhere to say how bad the day was without being judged for it. The one thing almost nobody in their life offered. So the Venting register grew into Venting Space: its own branch in the architecture, its own agent, and an inverted personality. Not an expert, not a therapist, a close friend texting back. Its prompt forbids nearly everything the main agent does: no strategies, no repeated questions, no reflecting everything back, replies capped at ten words.
The intent engine is what makes the space reachable. Start venting mid-conversation in normal chat and the classifier catches it, steering you there instead of answering pain with a strategy list. And the door swings both ways: when a parent returns to the main chat, the venting history is folded back into context: Gale knows what happened in there, and nobody has to repeat the worst part of their day.

Venting Space
Around the Engine
The systems that let the intent engine be the star.
Intent classification only feels seamless because everything around it holds. Each of these could be a section of its own; in the product they are supporting cast. And one meta-decision underneath all of it: the whole brain was built in n8n, visually, rather than as a coded service, because in this product conversation quality isthe product, and the people best equipped to tune it were designers. On a canvas, every routing decision stayed visible and changeable by the people designing Gale's behaviour, while the app developers integrated exactly one webhook.
Session router
First sessions, second sessions, everyday chats and venting each get their own agent, prompt and memory. A mentor treats a first meeting and a fiftieth differently.
Memory that summarizes, not transcribes
Between sessions, a summarizer agent distils the conversation into structured conclusions: the plan, the strategies (and whether they'd been tried), the main issue. Follow-ups open from conclusions, not transcripts.
A PDA knowledge graph, not the open internet
Generic parenting advice (rewards, firm boundaries) actively escalates PDA. Replies are grounded in five curated knowledge domains, searched and reranked per turn. Long emotional messages are first distilled to keywords, because they make terrible search queries.
Fast models decide, the best model speaks
Gemini Flash makes every internal decision: intent, context sufficiency, extraction. OpenAI models produce every word a parent actually reads. No user ever sees the deciders' output.
Tone compiled, not suggested
The parent's onboarding preference (“quick answers”, “caring support”…) is compiled by code into hard prompt constraints (including word caps) before any model runs.
One webhook for the whole brain
The app's entire integration: message and family profile in, Gale's reply out. Behind that URL, 133 nodes were rebuilt and re-routed continuously without the app changing a line.
In Production
Shipped, plugged in, and evolving behind a stable contract.
Every Gale conversation in the shipped product runs through this engine. PDA Pro shipped on Google Play and the App Store, and this backend served it at over a thousand concurrent users. The strongest evidence for the architecture is how it grew: Venting Space (an entire new conversational mode, discovered from live usage) was added as a branch on the canvas, behind the same webhook, without the app changing a line.

Gale in production

The complete brain on one canvas: every decision inspectable by anyone on the team
What This Taught Me
People don't remember what an AI said. They remember whether it understood them.
Nothing that made Gale feel understanding lives inside a model. Knowing a question from a cry for help, dropping a plan the moment a parent breaks, asking before advising, remembering what last session concluded, saying ten words when two hundred would wound. Every one of those is a classification, a gate, or a routing decision made before generation. The conversational model is the last step in the pipeline, and the least interesting one to design.
That's the transferable thesis: in AI products, understanding isn't something the model does. It's something you architect. The same model that would lecture a crying parent comforted her instead, because the system around it read the room first.