The failure mode
A family raising an autistic child accumulates years of context: diagnosis reports, therapy evaluations, school assessments, and thousands of small daily observations. None of it lives in one place, and the moment it is needed is the worst possible moment to go looking.
The question a parent actually asks is he melted down at the supermarket again, what do I do? Answering it well requires connecting tonight's event to a pattern that formed over months — and to the strategy that worked in March but not in May.
Ask a general-purpose assistant and you get textbook autism advice. It is not wrong. It is just not about this child: it does not know the sensory profile, does not know which approaches have already been tried and abandoned, and has not read the last therapy report.
Why "give the model the conversation history" breaks
The default fix is to store chat history and stuff the recent turns into the prompt, maybe with a vector search over past messages.
Three things go wrong.
Free text is not computable. "Rough night again" appearing in forty separate conversations is not a pattern the system can count, rank or notice. It is only a pattern once sleep quality is a field.
Similarity is not significance. A vector search over conversation text retrieves messages that read like the question. What you actually want is closer to: this event, plus the patterns it belongs to, plus the strategies that have worked for those patterns, plus what the uploaded clinical report said.
Nobody can audit it. If the assistant suggests a change to a bedtime routine and the parent asks why, "it seemed relevant" is not an answer you can give about someone's child.
The mechanism
Three memory types, three tables, three lifecycles:
| Memory type | Holds | Answers |
|---|---|---|
| Episodic | Individual events with time, place, outcome, impact score | "What happened, and when" |
| Semantic | Extracted patterns with confidence and evidence counts | "What is generally true about this child" |
| Procedural | Named strategies with implementation and success counts | "What has actually worked" |
Four decisions do the work.
Structured capture comes before intelligence. Daily logging is a tap-based form — arousal level, emotional state, emotional regulation, sensory sensitivity, sleep quality, nutrition routine, environment — not a diary box. It is a worse writing experience and a far better substrate. Patterns over structured fields are computable; patterns over prose are vibes.
Consolidation is a scheduled job, not a prompt. Raw episodes get promoted into semantic patterns with a confidence score and an evidence count, and into strategy records whose effectiveness is recomputed from follow-up observations.
Effectiveness is arithmetic. It is a generated column derived from implementation, success and partial-success counts:
-- The system's judgement about a strategy is a computation over recorded
-- outcomes, not a model's opinion of what sounds like it worked.
effectiveness_score numeric GENERATED ALWAYS AS (
CASE WHEN implementation_count = 0 THEN NULL
ELSE (success_count + 0.5 * partial_success_count) / implementation_count
END
) STOREDA model asked "which approach has been working for this child?" will answer fluently and confidently from whatever is in context. A generated column cannot flatter you.
Retrieval is parallel and typed. Each question triggers retrieval across five sources at once — episodic memories, semantic patterns, top-ranked strategies, processed documents, and the last 30 days of observations — and the composed prompt carries the child's diagnoses, sensory profile, communication level and the family's chosen methodology (ABA, TEACCH, PECS, naturalistic/ESDM-PRT, Floortime, DIR). The answer streams back with markers — [E] episodic, [S] semantic, [P] procedural, [D] document — that resolve to the underlying record.
The edge cases that shaped it
Documents are a pipeline, not an upload. A health board report becomes useful only after text extraction, structured summarisation, metadata extraction and embedding — all on a background queue, because none of it belongs on the request path. Deleting the document clears the extracted text and embeddings immediately; a "deleted" file that still answers questions is a compliance problem wearing a feature's clothes.
A memory-heavy product is an expensive product. Three mechanisms keep it viable: a semantic response cache with an exact-hash fast path before pgvector similarity matching, with quality gating so errors and low-value responses are never cached; two-tier routing that sends routine questions to a small model and escalates multi-step analytical ones based on Turkish-language complexity indicators; and adaptive reasoning effort that drops to minimal when a question needs no retrieved context at all.
Professionals need a different product, not a different menu. Therapists and teachers join a child's support network under a permission matrix defined per role and per resource type — observation, document, conversation, profile, memory — with each entry always allowed, never allowed, or configurable by the parent. Someone who owns no child profile gets a caseload dashboard with a feed of home observations, not an empty version of the parent's screen.
Prompt changes need evidence. Which prompt variant produced which response is recorded, so a change can be evaluated against user feedback rather than against the feeling that the new wording reads better.
Limits, and what I would do differently
No accuracy figure is claimed. This is delivered capability verified by reading the code and exercising the running application against synthetic data. There is no measured accuracy, adoption or outcome number, and inventing one for a product that advises about children would be worse than having none.
Consolidation confidence is a heuristic. Evidence counts and confidence scores make patterns rankable, not proven. A pattern with four supporting observations is a hypothesis; the UI should say so more loudly than it currently does.
Structured capture has a ceiling. Seven fields cover a lot and miss the thing that only a sentence can express. The honest design is structured fields plus free text, with the free text explicitly second-class — retrievable, never counted.
If you are building an assistant that has to answer from a customer's own history, the retrieval architecture is downstream of the data model. Decide what you are willing to count before you decide what you are going to embed.