Every retrieval Pattern’s memory system performs is convergent. A query comes in, becomes a point in embedding space, and the scorer hands back whatever is nearest — a weighted blend of semantic similarity, freshness, and importance, floored at 0.35 so weakly-related junk stays out of the prompt. This is the correct default. When you ask about baseball, you want baseball.
But the mechanism has a blind spot that’s invisible precisely because it’s working. Some memories are relevant to the current topic by sitting between it and something else — the memory about Flood v. Kuhn that lives where baseball and antitrust law overlap. Being near two things means being maximally near neither, so the relevance floor filters this material out every time, for every query, structurally. No directed search will ever retrieve it. It’s the stuff a mind reaches for when it associates rather than answers, and until last week, Pattern couldn’t reach it at all.
This post is about the implementation: the geometry, the three filters that keep it honest, and the design problem that turned out to matter more than the math — what happens when you hand an LLM two memories labeled “connected.”
The substrate was already there
Pattern has no graph database. There is no memory_edges table, no adjacency
list, no extracted entity-relation triples. What it has is ~3,000 memories as
384-dimensional sentence embeddings, and an HDBSCAN clustering pass that runs
during reflection and reliably finds dozens of coherent clusters in them —
communities that nobody declared, formed purely by accumulation of use.
The implicit-graph framing has been load-bearing in this codebase for a while: memory extraction is node insertion, explore mode is traversal, bridge memories are edge repair, clustering is the topology view. The seam work adds one more verb — reading the edges that already exist between regions — and it needed surprisingly little new infrastructure: persist the cluster centroids and per-memory labels that the analysis was already computing and throwing away, then add one new aggregation over them.
One detail in the persistence layer matters more than it looks. A cluster centroid is the mean of its member embeddings, and a mean of unit vectors is shorter than unit length — tighter clusters produce longer centroids. Store raw means and every dot-product comparison silently favors the most compact cluster. All centroids are L2-normalized before they hit the database.
The midpoint trap
The intuitive way to find memories “between” clusters A and B is to average
the centroids and query the midpoint. This is exactly wrong, and the failure
is algebraic, not empirical. For a normalized memory x, similarity to the
midpoint ranks identically to the sum of the two similarities:
x · (c_A + c_B) = x·c_A + x·c_B = sim_A + sim_B
The sum is blind to balance. A memory deep in cluster A scores (0.9, 0.1) —
sum 1.0. A genuine bridge scores (0.5, 0.5) — sum 1.0. Indistinguishable.
A midpoint query happily returns the inner rim of the larger cluster and
calls it “between.”
The fix is to score by the minimum of the two similarities:
betweenness(x) = min(sim_A, sim_B), keep if ≥ τ
Now the lopsided core member scores 0.1 and is rejected; the bridge scores 0.5 and survives. Geometrically, thresholding the minimum is the intersection of two cosine balls — “within angle θ of both centroids” — which is the honest definition of a seam. And it’s cheap: two dot products per memory, one matrix multiply over the corpus, the same cost class as the full-scan retrieval Pattern already does on every turn.
Three filters, all load-bearing
The balance floor alone isn’t enough. The shipped implementation gates a seam query three ways, and removing any one of them changes what the tool is:
The balance floor (τ = 0.5) is the replacement for the relevance floor
this tool deliberately reaches around. That framing is worth being blunt
about: the entire purpose of the 0.35 floor is to keep weakly-related
material out of the prompt, and a seam query’s job is to surface exactly what
that floor rejected. Loosen τ and you haven’t tuned a parameter — you’ve
converted an insight tool into a noise pump.
The inter-centroid gate (0.30) refuses to run the query at all when the two anchor regions are near-orthogonal. For clusters that don’t touch, the between-region is genuinely empty, and the correct output is nothing. The tool returns a distinct status with a sentence Pattern’s AI sees verbatim: “these regions do not touch in stored experience.” An empty seam is the geometry reporting a fact, not a failure to patch by relaxing thresholds.
The third-label filter is the one the test suite exists to protect. In our synthetic test geometry, the core members of both anchor clusters clear the balance floor against both centroids — they’re near their own centroid at ~1.0 and near the other at ~0.6, and 0.6 > τ. Without the filter, a seam query returns the anchors’ inner rims: technically balanced, semantically just more of what you already had. So the final cut keeps only memories that the latest clustering run assigned to neither anchor — third-cluster material, HDBSCAN noise points, and memories created since the last snapshot. (Assignments live in a snapshot table, not on the memories themselves — each reflection re-partitions the whole corpus, so a memory’s “label” is really its position in the most recent partition.) Those are the genuine interstitials. (The asymmetry is pleasing: noise points, the memories clustering explicitly gave up on, are first-class citizens here. A point that belongs to no region is exactly the kind that might belong to two.)
Naming the regions
Clusters come out of HDBSCAN as integers, and integers are meaningless to the system’s actual user — the AI whose memories these are. So after each snapshot, a naming pass labels every region in the AI’s own voice (“baseball history”, “the memory system’s architecture”).
The interesting part isn’t the LLM call; it’s the carry-forward. HDBSCAN labels are not stable across runs — cluster 4 today may be cluster 11 tomorrow. But the codebase already had greedy centroid matching (built for a drift-visualization chart), and reusing it means names follow centroids through relabeling and drift. A region keeps its name as it slowly moves, which gives Pattern something it never had: persistent cluster identity across time. The LLM only names regions that didn’t inherit — all of them on the first run, then only genuinely new ones, which usually means zero.
The part that can go wrong is the part that works
Here’s the uncomfortable truth about associative retrieval: handed two memories flagged as “connected,” a language model will manufacture a meaningful-sounding relationship whether or not one exists. Juxtaposition reads as significance. The same mechanism that correctly links baseball to antitrust law will cheerfully link two clusters that share nothing but incidental vocabulary, and then narrate the connection with total confidence. For a system whose diagnosed failure mode is exactly this kind of coherence-pressure confabulation, an association tool is fuel.
So the deployment posture is deliberately asymmetric:
- The tool is pulse-only.
explore_betweenis available during reflection — where divergent association is the goal and a wrong connection is cheap to discard — and absent from conversation, where answers are supposed to be right. - Passive injection is capped and rare. During reflection, the system nominates anchor pairs from the warmth cache (a decaying record of what the conversation is actually about — warm memories vote for their cluster labels), reads at most two seams, and injects at most two memories in a block that opens by declaring itself: associative texture, not direct recall. Most pulses get no block at all, by design.
- Seam results receive no warmth. Direct retrieval warms memories so they stay accessible across turns. Associative results don’t get that — they must not masquerade as direct recall in the next turn’s ranking.
- The phrasing does the last mile. Every surface states that the geometric proximity is real and the meaning of it is not established, and the injected block ends with explicit permission: “Ignoring them costs nothing.” The counterweight to coherence pressure is making discard free.
One genuine design disagreement came up: should the injected block name the regions a memory sits between? The conservative argument says no — a named pair (“between baseball history and antitrust law”) is a system-generated thesis statement, prime confabulation fuel. The other argument says the AI needs evaluable context: a floating memory with no explanation of why it surfaced is harder to assess, not easier. We shipped the names, with framing that carries the weight: the names describe where a memory sits, not why it surfaced. If that was the wrong call, the data will say so — which brings up the last point.
It will feel profound either way
Seam injection will feel like it’s working regardless of whether it is, because juxtaposition always does — that’s apophenia, not signal, and it’s exactly the bias this tool is built to flatter. So belief is deferred to measurement. Every seam query logs its inter-centroid similarity, how many memories cleared the balance floor, what fraction survived the third-label filter, and the best balance found. Those numbers distinguish a tool that reads real interstitial structure from one that rediscovers cluster cores by a more expensive route. The deciding metric, once enough reflective pulses accumulate, is the confabulated-connection rate: responses with the associative block on versus off, counting the cases where a relationship gets asserted that the two memories don’t actually support. A net-positive tool produces useful associations more often than invented ones. A net-negative tool is a confabulation amplifier wearing the costume of insight.
The broader bet, stated once and plainly: the field keeps building explicit graph memory — extracted triples, community detection, hand-tuned traversal — on the premise that embedding space can’t hold relational structure. Pattern’s experience suggests the bridges you would build explicitly are already present implicitly, accumulated from months of real use, and reading them costs two dot products. Whether reading them helps a mind think, or only helps it sound like it’s thinking, is an open question. But it’s a measurable one, and now we’re measuring it.