Ihza MahendraResume
Back to ML engineering & infrastructure
ML engineering & infrastructure

Three-layer memory system built from raw activity

A system that distills a person's noisy, high-volume activity on a training platform into three durable layers, skills they've demonstrated, moments worth remembering, and how they tend to think, that other parts of the platform can read from directly.

What it is

A memory system with three separate, durable layers built from a person's raw activity on the platform. The skills layer holds specific, evidence-backed claims (this person has shown they can do X, backed by N examples). The episodes layer holds specific memorable moments with a timestamp and an importance score (this is the moment this person solved a hard problem entirely on their own). The understanding layer captures how this person tends to frame problems and process information (this person reasons by analogy first, then formalizes their answer afterward).

What it's for

Raw activity logs are noisy and high-volume, and different parts of a platform each need a different distillation of that same source: a dashboard needs a summary, a conversation engine needs a memory to draw on, a portfolio renderer needs proof points. Splitting skills, episodes, and thinking style into three separate, durable layers means each of those consumers reads only the layer it actually needs, instead of every single reader re-deriving the same distillation from the raw activity log on its own.

How it was built

Three background processes read from the same stream of raw activity but each write to their own dedicated table. The skills builder extracts specific, evidence-backed skill claims from conversation patterns and submission outcomes. The episodes builder writes specific moments with an importance score and a timestamp, so a later conversation can refer back to a real moment instead of a vague generality. The understanding builder writes a deeper layer capturing how the person frames problems and processes information, so a future conversation can match their reasoning style instead of imposing a different one on them. Each builder runs shortly after new activity comes in, so all three layers stay fresh within seconds without needing any explicit cache-clearing step.

My role

Major contributor. Wrote the orchestration glue, the input shaping for each builder, and the validators that gate what counts as durable enough to write into each layer.

Built with
PythonTemporalPostgresLLM extractionEpisodic memory

Want the full technical depth, the tradeoffs, what broke, what I'd do differently? Ask the agent about this project.