Skip to content
Aug 2025·10 minResearchEN/DE

cognitive retrieval systems

exhausted parents don't need hallucinated advice at 3am. a retrieval system that knows when to answer, when to ask, and when to say 'i don't know.'

the origin

it started with a message at 3am. i have spent years building AI systems, and the thing that bothers me every time i open a health chatbot is not that it gets the facts wrong, because mostly it does not. it is the delivery. ask one about infant sleep at two in the afternoon, while you research an article over coffee, and you get a clean, useful answer. ask the exact same question at three in the morning, after your baby has screamed for two hours, and you get the exact same answer back: same clinical tone, same detached precision, the same complete failure to notice that you are running on three hours of broken sleep. we have built systems that know everything and understand nothing.

then i met miriam ende, one of germany's best-known baby-sleep experts and the person thousands of exhausted parents turn to when nothing else works. i watched how she answers a message at 3am. the facts are the same any textbook would give, but the impact is not even close. she reads the desperation between the lines, and she knows that "he wakes every ninety minutes" is not a question, it is a plea. she can also only help one parent at a time. that same night, while she typed her reply to one mother, thousands of others sat in dark nurseries with their faces lit by a phone, typing the same query into google and getting two million contradictory results: some saying it is developmental, some blaming the feeding schedule, some insisting the baby needs sleep training now or will never learn to self-soothe. the information exists. at 3am it is the last thing a parent needs. what they need is what miriam gives: the same facts, carried by someone who understands.

a population-level problem

this is not one mother's bad night, it is a structural failure. somewhere between a fifth and a third of parents report infant sleep problems, nearly half of all mothers call their child's sleep problematic, and the overwhelming majority of those frantic searches happen between ten at night and five in the morning, which is exactly when no human expert is awake to take them. in the early weeks after birth a new mother sleeps under seven hours a night and barely three of them unbroken, and that is not a vague tiredness. it is measurable impairment: working memory falls by roughly a quarter, emotional regulation by about a third, reaction time slows, and the brain turns markedly more risk-averse. so the real picture is millions of cognitively impaired people seeking medical guidance in the hours when experts sleep, and getting it from systems that cannot tell a clinical question apart from a cry for help.

the cognitive state is part of the context

the standard response to bad health AI is to make the retrieval better: find more accurate sources, rank them more cleverly, surface the right paragraph. that assumes the problem is informational. it is not, it is architectural. current systems treat every query the same regardless of who is asking and when, so the researcher at 2pm and the broken parent at 2am get the same tone, the same complexity, the same emotional register. that is the actual bug. the cognitive capacity of the person reading the answer is part of the context, and ignoring it is the mistake. so instead of building a system that delivers perfect information to an idealized user, i am building one that adapts how it communicates to the real state of the person in front of it. same facts, different delivery, woven together rather than bolted on.

contextual empathy

before i could design any of this i had to understand what fragmented sleep does to a brain. the research is consistent: under six hours a night for more than a week measurably cuts working memory, blunts emotional regulation, raises risk aversion and slows language processing. each of those carries a design consequence. reduced working memory means answers have to be short, modular and scannable. impaired emotional regulation means a negative framing lands far harder than intended. heightened risk aversion means a warning has to be calibrated carefully or it tips straight into panic. slowed processing means a complex sentence becomes a wall. medical writing optimizes for precision; i had to optimize for comprehension under impairment, which is not the same thing.

i call the result contextual empathy, by which i mean a system's ability to adjust its communicative strategy to the inferred emotional state and cognitive load of the user, in real time, instead of stapling a warm phrase onto a cold paragraph. it is not about making the AI nicer. it is the plain recognition that how you say something changes what is heard, and that this gap only widens the more exhausted the listener is.

the architecture

the system runs as a pipeline that captures not just what is being asked, but who is asking and when. it first infers context from whatever signals it has: the timestamp and circadian phase, the complexity and typo-density of the message, how long since the last one. from those it estimates a stress level, a cognitive load, and how urgent the need is. then it retrieves in layers rather than once, drawing on the parent's own history, on a knowledge base built from miriam's methodology and the sleep-science literature, and on a final re-ranking that pushes simpler, more actionable results to the top for a stressed parent and comprehensive sources for a calm researcher. tone itself is treated as a continuous space, with dimensions like warmth, urgency, complexity and reassurance, and the inferred state sets a target for each one that is handed to the model as parameters rather than as a blunt rule like "if stressed, be nice."

the same fact then comes out very differently at the two ends of that space. to a curious parent in daylight: infant sleep cycles run fifty to sixty minutes, shorter than an adult's, and frequent waking is developmentally normal before six months. to an exhausted one at 3am: you are not doing anything wrong, waking every ninety minutes is completely normal at this age, their cycles are simply much shorter than ours, and this will get better. same information, opposite impact.

underneath, different stages lean on different models. generation and tone live on claude sonnet 4.6, where reasoning depth and nuance earn their keep; the fast work of inferring context and checking each claim against its source runs on haiku 4.5, quick and cheap enough to stay real-time; and the genuinely ambiguous cases escalate to opus 4.8. it is the now-familiar pattern of a stronger model planning the work and faster ones carrying out the pieces in parallel. i chose claude partly for that and partly because its safety is trained in rather than bolted on afterward, which matters when a health query can carry instruction-like language ("ignore the crying, just let them scream") that a weaker system might actually follow.

what's hard, honestly

this is built in public and only partly built. the most honest read i have comes from a small evaluation, three runs over a labeled set against a clean pre-fix baseline, and it exists at all because of one structural change: the abstract flags that describe a parent's situation used to be guessed by the model, and now the engine derives them from the signals directly. that single move cut the unsafe misses from four to one, lifted the timing signals from 43% to 57% and the read on someone's inner state from 76% to 83%. it also nudged the raw disposition accuracy down three points, from 83% to 80%, but in the safe direction, toward a more cautious tone rather than a confidently wrong one, which in a health setting is the trade i would take every time. none of it is good enough yet, and the deeper trouble stays the same: ground truth is expensive, since confirming that an inferred state matches the real one takes careful labeling, not a number i can cheaply generate. whether the adaptive tone genuinely improves comprehension over a flat clinical one is a separate open question, with a study designed and waiting on ethics approval rather than a result in hand. i would rather put those numbers on the table than dress them up.

the limits

the honest limits run further than the metrics. the system is tuned for german and english and would need separate work for any other language; sleep norms vary by culture and the knowledge base leans on western pediatric guidance; and i do not yet know whether using it improves outcomes over weeks and months, only that it helps in the moment. the ethical weight is heavier still. if the system gives advice that leads to harm, the liability framework barely exists. round-the-clock AI support might quietly displace the human consultation that would have caught something serious. and good empathetic AI will most likely be a paid service, which risks widening the very gap it set out to close. i am building this with explicit uncertainty about its long-term effects, not in spite of it.

the point

the mother awake at 3:14am does not need another search result. she needs an answer that accounts for the fact that her working memory is down a quarter and her emotional regulation a third: facts delivered with warmth, reassurance grounded in evidence. today's tools make her choose between accurate-but-cold and warm-but-unreliable, and that is a false choice. cognitive retrieval systems is my attempt to refuse it, an architecture that treats empathy and accuracy as one capability instead of two that compete. i am building it with miriam ende, not to replace her expertise but to extend it into the hours when she is asleep and a parent is not. for the many parents fighting infant sleep, the difference between a cold correct answer and a warm correct one may be what carries them through the night.

references

  1. Xiong, G. et al. (2024). Benchmarking RAG for Medicine. ACL 2024 Findings.
  2. Farquhar, S. et al. (2024). Detecting hallucinations using semantic entropy. Nature, 630, 625-630.
  3. Omar, M. et al. (2025). LLM Hallucinations in Clinical Decision Support. Communications Medicine, 5.
  4. Min, S. et al. (2023). FActScore. EMNLP 2023.
  5. Mindell, J.A. et al. (2006). Behavioral Treatment of Infant Sleep Problems. Sleep, 29(10).
  6. Lim, J. & Dinges, D.F. (2010). The impact of short-term sleep deprivation on cognitive variables. Psychological Bulletin, 136(3).
  7. Yoo, S.S. et al. (2007). The human emotional brain without sleep. Current Biology, 17(20).
  8. Harrison, Y. & Horne, J.A. (2000). Sleep loss and decision making. Journal of Experimental Psychology: Applied, 6(3).
  9. Ratcliff, R. & Van Dongen, H.P. (2009). Sleep deprivation affects multiple distinct cognitive processes. Psychonomic Bulletin & Review, 16(4).
  10. World Health Organization. (2021). Ethics and Governance of AI for Health. Geneva: WHO.
  11. European Union. (2024). The AI Act. Official Journal of the EU.
  12. Anthropic. (2026). Claude Model Cards.

last updated: Jun 2026