i'm a software engineer based in the philippines, driven by curiosity and whatever i find interesting. i learn fast with the caveat of goldfish memory (which i call my context lol) and i'm usually self-motivated that i forget to eat.
this is not like other portfolios. feel free to have a look around and explore what makes me, me.
drag empty cork to move around. drag notes to rearrange them. use +/− or pinch-wheel to zoom. click any note to open it.
i turned weeks of neuroscience papers into her memory system.
what keeps me going
someone else is on the other end.
~/mayi enjoy writing code. if ai solves every problem, what's left?_
i hate spinners.
the same circle, over and over.
i'm less interested in whether it's good.
how does it work?
noiseshape
diffusion models
watching a photo develop.
A
atlas
atlas maps symbols, calls, tests, and history so developers and agents can ask structural questions about a repository.
current benchtypescriptsqlitemcp
W
weave
weave gives long-running agents memory, state tracking, and retrieval that can be inspected.
current benchtypescriptagentsmemory
avery v3
892 commits. the personal AI agent i've been trying to build since 2023 is finally becoming something i'm proud of.
wfd · 2026-03-31T23:50:00 · 3 min
the usage of ai in daily work
AI makes me faster. It also might be making me dumber. I'm figuring out where the line is.
wfd · 2026-02-28T02:01:00 · 3 min
github.com
remark
from writings for discussionryanaque.com
a link
from writings for discussionx.com
follow me on X
from avery v3arxiv.org
guarantees
from do you want me to do that?
giving an ai agent a hippocampus
i watched a kdrama about a girl who forgets everything every morning and realized my AI agent has the same condition. so i built it a brain.
wfd · 2026-02-28T02:01:00 · 14 min
opening note
wfd / Feb 28, 2026 / 14 min
giving an ai agent a hippocampus
Stub
i haven't finished writing this yet. i publish drafts early as part of WFD 17.
very long read
this one got away from me. i hope it's worth your time because i am never writing this again.
nerd alert
this post references neuroscience papers from 1995, a temporal knowledge graph architecture, the Ebbinghaus forgetting curve, and a surgical procedure from 1953. the only reason it exists is because i watched a kdrama.
WFD 27 broke me. it's a korean drama about a girl with anterograde amnesia who can't form new memories, so every morning she wakes up and the boy she loves is a stranger. she's sharp and funny and fully present in every conversation, but nothing sticks past sleep. i watched the whole thing in one sitting and couldn't stop thinking about it for days, not just the romance but the condition itself, because someone who is completely intelligent and completely aware and still unable to carry anything forward is exactly what every AI agent i've ever built does.
avery
i've wanted a personal AI assistant for years. i built one called Taylor back in 2023 and abandoned it because the memory problem was unsolvable at the time, so every conversation started from scratch and the assistant never learned anything about me or my projects. i moved on to other things and forgot about it.
then three things happened at once. i watched the kdrama. OpenClaw (the open-source personal AI assistant formerly known as Clawdbot) exploded to 100k+ stars and proved the concept was viable at scale. and i'd already been building my own agent for about five months under the name Avery, because i like the name and couldn't think of anything better. the kdrama gave me the architecture, OpenClaw proved the demand, and Avery was already there waiting for a brain.
Avery can reason through complex problems, use tools, follow procedures, and hold an entire architectural discussion without missing a beat, but has no idea who you are the second the session ends. every conversation is the first conversation, every project is brand new, every preference you ever mentioned is gone.
there's a real case study behind the condition. Henry Molaison, known as Patient H.M., had his hippocampus surgically removed in 1953 to treat epilepsy. the seizures stopped, but so did his ability to form new memories, and for 55 years after the surgery his IQ stayed at 112 while every person he met remained a stranger. the mapping between H.M. and a vanilla LLM agent is literal.
property
vanilla LLM agent / Patient H.M.
Avery (after)
working memory
intact (context window)
intact
pre-existing knowledge
intact (training data)
training data
new episodic memory
lost after session
encoded by Scribe
procedural memory
fine-tuning/tools
system prompts
cross-session continuity
none
Altale recall
intelligence
full capability
full capability
what i looked at
before building anything i went through what already exists, because the memory problem for AI agents isn't new and several projects have taken a crack at it.
proper temporal knowledge graph with entity extraction and contradiction handling, but graph-only with no multi-backend recall and tightly coupled to their platform
easy to plug in buffer/summary/entity modules with many options, but each module is isolated with no unified scoring and no forgetting
basic RAG
simple embed-everything-and-retrieve approach that works for static knowledge, but no temporal awareness, no importance weighting, and treats all memories equally
good user-scoped memory with auto-extraction, but focused on user preferences and not agent self-memory
every one of these solves part of the problem but none of them solve the whole thing. i wanted something that worked the way the brain actually works.
the rabbit hole
the kdrama connection led me to the neuroscience, which led me to McClelland, McNaughton, and O'Reilly's 1995 paper on Complementary Learning Systems. it's one of those papers where you read the abstract and realize someone already solved your problem thirty years ago in a different field.
two systems
the brain has a sticky notes pad (the hippocampus) and a textbook (the neocortex). the sticky notes pad captures new experiences fast, one memory per note, without erasing anything already written. the textbook slowly absorbs patterns from the sticky notes over time, building general knowledge like "restaurants have menus" or "dogs are friendly." if you tried to write directly into the textbook at full speed you'd smudge everything already there, which is literally called catastrophic forgetting in the ML literature.
nerd shit: complementary learning systems
i'm explaining this because it's the entire reason Weave has two separate memory backends instead of one. the hippocampus encodes specific episodes through one-shot sparse representations with pattern separation keeping similar memories distinct, which is why i built the Scribe as a fast isolated encoder. the neocortex extracts statistical regularities as distributed overlapping representations, which is why i built Graph Memory as a slow knowledge store that merges patterns over time. McClelland et al. proved in 1995 that you need both, and i kept coming back to this paper every time i tried to simplify the architecture into a single system and it broke.
consolidation
the bridge between them happens during sleep. the hippocampus replays recent episodes to the neocortex, which slowly integrates the new information. specific episodes gradually transform into general knowledge, so "i had coffee with Sarah at that cafe on Tuesday" eventually becomes "Sarah likes dark roast" without the episodic context.
on falling down rabbit holes
i started with a kdrama, then i was reading a 1995 psychology paper, then Squire and Wixted (2011) on the cognitive neuroscience of memory since H.M., then Kumaran, Hassabis, and McClelland (2016) updating CLS theory for intelligent agents, then the Zep/Graphiti paper (2025) which explicitly cites the same neuroscience. i didn't plan to read neuroscience papers but the architecture just kept pointing there.
the mapping
the mapping to an agent memory system was almost embarrassingly direct: a fast system that captures what happened (hippocampus → episodic encoder), a slow system that builds structured knowledge over time (neocortex → knowledge graph), a process that transforms episodes into knowledge (consolidation → entity extraction), and forgetting, because a system that remembers everything is just as broken as one that remembers nothing.
what i built
the project is called Weave and the memory system has five main components.
flowchart TD
E["user interaction"] --> A["Avery (agent)"]
A --> S["Scribe (hippocampus)"]
A --> AL["Altale (recall)"]
S --> PM["Physical Memory (markdown + ripgrep)"]
S --> Q["Qdrant (vector search)"]
S --> G["Graph Memory (FalkorDB)"]
AL --> PM
AL --> Q
AL --> G
AL --> PI["PageIndex (document KB)"]
AL -->|"scored + synthesized"| A
scribe
the hippocampus. it watches everything Avery does and encodes memories in real time, so when Avery finishes a task the Scribe summarizes what happened (episodic memory), extracts reusable knowledge (semantic memory), records procedures discovered (procedural memory), and logs lessons from failures (error memory). i made all of this automatic because i didn't want the agent deciding what to remember, the same way your hippocampus doesn't ask permission before encoding a memory.
altale
the recall engine. when Avery needs to remember something, Altale runs parallel queries across every storage backend simultaneously: markdown files via ripgrep, vector embeddings in Qdrant for meaning-based recall, a knowledge graph in FalkorDB for structured facts, and a document index for archived files. the results get scored, ranked, and synthesized into a coherent memory that gets injected into the agent's context. i named it after a star because naming things is hard and i was looking at a star chart at the time.
graph memory
the neocortex, where entities and relationships extracted from episodes live as a knowledge graph. "the user prefers dark mode" becomes a triple: user → prefers → dark mode. when Avery learns something that contradicts existing knowledge, say the user switches to light mode, the system detects the contradiction, marks both facts as contested, and resolves it by superseding the old one. i modeled this after memory reconsolidation, where the old "lives in NYC" fact gets tagged as outdated rather than deleted.
physical memory
the simplest backend and the most reliable. plain markdown files on disk, one per day per memory type, searchable by ripgrep. if every other backend goes down Avery can still remember things by grepping text files, because i refuse to trust any system that doesn't degrade gracefully.
qdrant
handles meaning-based search. when Avery needs to recall something like "that conversation about deployment issues last week" it can't match on exact keywords because nobody said those exact words. Qdrant finds it by meaning instead, the same way hearing a few notes of a song can bring back the entire memory of where you first heard it.
nerd shit: vector embeddings
i need to explain this because it's the reason Avery can find memories it's never seen the exact words for. an embedding model (text-embedding-3-large) turns text into a list of numbers where similar meanings end up close together. "the deploy broke" and "production deployment failed" are far apart as keywords but nearly identical as vectors. without this Avery would only find memories through exact string matching, which is basically useless when you're trying to recall a conversation you half-remember from two weeks ago.
how memories form
when Avery completes a task, events flow into the Scribe, which runs an LLM to summarize the task, extract knowledge, and classify everything with importance scores from 0 to 1. the importance scoring is the equivalent of emotional tagging in the brain, where the amygdala modulates how strongly memories are encoded based on how significant an event is.
flowchart LR
T["task complete"] --> SC["Scribe"]
SC --> SUM["summarize (episodic)"]
SC --> EXT["extract knowledge (semantic)"]
SC --> IMP["classify importance (0.0 – 1.0)"]
SUM --> W["write to backends"]
EXT --> W
IMP --> W
W --> MD["markdown file"]
W --> QD["Qdrant vectors"]
W --> GR["graph triples"]
each memory gets written to all backends simultaneously. everything is tagged with metadata: state, importance, provenance, timestamps, and access counts.
i set up the provenance field to track where a memory came from, because direct observation should get the highest trust weight, followed by agent reports, then user claims, with inferred knowledge getting the lowest. i based this on source monitoring in human memory where you trust things you witnessed more than things you heard secondhand.
the scoring model
every memory has a score that determines how likely it is to surface during recall, and i designed each factor to have a neuroscience parallel.
state
the lifecycle stage where active memories score highest at 1.0, volatile memories score at 0.7, contested memories with unresolved contradictions sit at 0.5, outdated ones that have been superseded drop to 0.3, deprecated ones hit 0.15, and transient memories score at 0.05 before getting auto-purged after 24 hours. this mirrors synaptic strength where active connections are strong and unused ones weaken until they eventually get pruned.
recency
applies a 7-day half-life exponential decay, so a memory from yesterday scores much higher than one from three weeks ago. i based this on the Ebbinghaus forgetting curve, and i calibrated the half-life through testing different decay rates against real usage patterns until something felt right.
access frequency
gives a boost to memories that have been recalled before, because every time Altale retrieves a memory its access count increments and memories recalled more often become easier to recall. this comes from the retrieval practice effect where the act of remembering something strengthens the memory, which is also why testing yourself is a better study strategy than rereading.
importance
the 0-1 significance score from encoding. memories below 0.3 importance that have never been accessed and are older than 7 days get forgotten entirely, which is adaptive forgetting where the brain preferentially drops information that was never emotionally tagged and never rehearsed.
the formula is multiplicative, so a high-importance, recently-accessed, active memory scores near the maximum while a low-importance, never-accessed, outdated memory scores near zero and eventually gets cleaned up.
the anterograde amnesia pattern
this is where i kept coming back to the kdrama. every time i tested Avery across sessions, i saw the same thing the show depicted: someone fully capable, fully present, and fully unable to connect this moment to the last one. the girl in WFD 27 kept a diary to bridge the gap between her days. i built Avery the computational equivalent.
each task gets its own scratch pad. Avery writes freely during a task without touching the main memory, and only when the task finishes does the system merge the scratch pad into the permanent store. this way a bad task can't corrupt what Avery already knows, and the merge step handles conflicts when the scratch pad contradicts something in the main store.
nerd shit: groupId namespacing
this is the part that took me the longest to get right. the graph memory uses groupId namespacing to isolate task-scoped memories (task:<id>) from the global store. without this, every new task would write directly into the main knowledge graph and a hallucinated entity could overwrite a real one. the consolidation step merges entities by name, transfers relationships, and detects contradictions before anything touches global memory. i stole this directly from the CLS paper's description of hippocampal-neocortical transfer because the failure mode is identical: learn too fast into the wrong place and you corrupt everything.
flowchart TD
TS["task starts (fresh context)"] --> ENC["encode to task scope"]
ENC --> TE["task ends"]
TE --> CON["consolidate"]
CON --> MRG["merge entities by name"]
CON --> TRF["transfer relationships"]
CON --> DET["detect contradictions"]
MRG --> GL["global scope"]
TRF --> GL
DET --> GL
GL --> RCL["Altale queries both scopes"]
ENC --> RCL
when Avery searches for memories it queries both the scratch pad and the main store, so recent task context and long-term knowledge are both available. the separation also prevents catastrophic forgetting because new information can't accidentally overwrite existing knowledge.
sleep
the maintenance cycle runs every six hours and i call it sleep because that's what it is.
flowchart TD
SL["sleep cycle (every 6h)"] --> P["purge transient (> 24h old)"]
P --> F["forget low-value (imp < 0.3, 0 access, > 7d)"]
F --> C["compress dailies (> 14d into weeklies)"]
C --> AN["log analytics"]
AN --> SL
purging
transient memories older than 24 hours get purged first, which is sensory buffer clearing for information that never made it to long-term encoding. then the adaptive forgetting from the scoring model kicks in and anything meeting those thresholds gets deleted, because you don't remember what you had for lunch on a random Tuesday three weeks ago unless something notable happened.
compression
after purging it compresses old daily files into weekly summaries using an LLM, which is schema abstraction where specific episodes fade but the gist remains, so instead of three separate detailed entries you get "i fixed three bugs in the auth flow during the second week of February."
metamemory
the cycle also logs analytics like average importance scores and access count distributions. the system monitors its own memory health, which is metamemory in the neuroscience sense.
identity
i gave Avery an evolving self-model in a file called identity.md that describes who the agent is, what it's good at, what it values, and how it tends to work, and this updates over time based on experience. there's also identity-history.md which i set up as an append-only audit trail of every identity change. without some kind of guardrail a single weird task could rewrite Avery's entire personality, so i added a similarity check: if a proposed identity update looks too different from the current self-model it gets flagged instead of auto-applying.
nerd shit: cosine similarity
i'm being specific about the numbers because i tuned these for weeks. the similarity check uses a 0.5 cosine similarity floor, meaning updates that are less than half-similar to the current identity get rejected outright. there's also a 0.7 confidence threshold before changes auto-apply. i landed on these after watching Avery rewrite its own personality three times in one afternoon because a user asked it to role-play as a pirate. this is autobiographical memory: the ongoing narrative that ties episodes into a coherent identity and answers "who am i" across sessions.
what i learned
the neuroscience mapping works better than i expected, because every time i hit a design question the literature already had an answer and i mostly just had to translate it into code.
the hardest part was the scoring model because getting the weights right required a lot of tuning. too aggressive on recency and the agent forgets useful old knowledge, too aggressive on importance and it ignores recent context, and the 7-day half-life was the result of testing until something felt right.
the physical memory backend, the plain markdown and ripgrep layer, ended up being the most reliable part of the whole system. each backend is optional and the system degrades gracefully by design: if Qdrant goes down you lose semantic search, if FalkorDB goes down you lose the knowledge graph, and if everything is down except the filesystem Avery can still remember things.
WFD 22 talks about the tension between using AI tools and losing the ability to do things yourself, and building this memory system was the opposite experience because i had to understand how memory actually works in order to give it to a machine. the neuroscience reading, the architecture decisions, the scoring math, all of that was work i did and not work i delegated.
i'm still tuning it. the contradiction resolution needs more testing, the compression summaries sometimes lose important details, and the importance classifier is biased toward marking things as more important than they are which means less gets forgotten than should. these are all solvable problems but they're the kind that only surface through real usage over weeks, and somewhere between "just files and grep" and the full multi-backend system is where Avery actually operates day to day. Avery remembers things between sessions now and that's the whole point.