Analyst focused on AI security
Adversarial evaluation of local LLMs, censorship and rejection rate, prompt injection testing, log analysis and defensive automation. Visit: sammideblas.com
The sharing gap between agents is a workflow problem before it is a retrieval problem. One Rust binary with SQLite and hybrid BM25 plus vector search keeps the memory auditable, which matters when a stored finding is wrong. How do you score stale memory that still matches the query, and do you decay entries that were never reused?
Agreed, it's a workflow problem first: retrieval only helps if the finding gets written down at all, which is why the hooks prompt the agent to save decisions at the end of a session.
Stale-but-matching memory is handled in two ways. Ranking decays with age: every memory gets a recency bonus that falls off exponentially (half-life about 35 days), and queries with time phrases ("what did we decide last week") get a separate date boost. A second decay spreads results across sources, so one file can't fill the top 5.
For facts that are actually wrong, decay isn't enough, so it's explicit: the agent calls palace_kg_invalidate and adds the new fact, which closes the old one with an end date while the timeline keeps both. palace_conflicts flags facts that look stale or contradictory.
Nothing is deleted automatically, and there's no usage-based decay yet: a memory that's never retrieved isn't penalised. Removal stays explicit (palace_forget, or palace prune --older-than-days N with --dry-run). I'm interested in reuse as a ranking signal. How would you weigh it against recency?
Analyst focused on AI security
Adversarial evaluation of local LLMs, censorship and rejection rate, prompt injection testing, log analysis and defensive automation. Visit: sammideblas.com
Agreed, and for anything mined from the repo that's already how it works. palace mine hashes every file's content, so when a file changes its old memories are replaced with fresh ones, and when a file is deleted its memories go with it (palace watch does the same on save). Those don't age on a clock, they follow the file.
The half-life is for notes the agent writes itself, like "we dropped X because Y". I kept those off file changes on purpose: a refactor can touch every line of a file while the decision behind it still holds, and quietly burying a valid decision is the worse failure. When a decision really is overturned, the agent closes it explicitly (palace_kg_invalidate for facts, or editing the note in place), so the old version stops competing instead of slowly fading out.
That single-session-preference drop to 0.300 R@1 on m_cleaned matches the exact failure mode I hit with my own local SQLite FTS5 + BGE memory daemon. On 150 active records across 3 machines (plus 5,310 raw staged session segments), indexing only the verbatim rule failed almost every time a later question used different phrasing.
Two changes moved the needle for me: storing multiple query-shaped intent vectors per record (779 intent embeddings across those 150 records) and pulling the 12 standing preferences and constraints out into a 1,331-char core digest loaded up front instead of making hybrid search fight distractors for them. Where I still get burned is update chains: if I tweak a workflow rule twice in one week, the older wording sometimes still outranks the newer note on BM25 until I manually mark the old entry superseded.
Since Palace avoids LLM extraction on ingest, have you tried attaching synthetic question phrasings only to those tagged preference spans, or are you keeping ingest strictly zero-LLM?
Your digest is basically what Palace does for standing rules too. The session-start hook loads the user's preferences up front, ranked and kept to a token budget, so they never have to win a search against distractors. LongMemEval doesn't use that path at all (everything sits in one haystack), so the 0.300 is the cold case: a preference that only exists somewhere in old chat history.
Ingest stays zero-LLM, on purpose. Same input gives the same index, it runs offline on a laptop, and everything search matches on is text someone actually wrote. Generated phrasings would mean ranking on a model's guess at what the question might be, and a wrong guess is hard to spot later. Preference spans get tagged by rules at write time, and preference-shaped questions get a separate pass over them.
For update chains I went explicit rather than trying to fix it in ranking: the agent edits the rule in place (the embedding is recomputed) or closes the old fact with an end date, so there's only one current wording left to find. Your intent-vector numbers are interesting though. Did the 779 vectors come from an LLM, or from templates?
Full Stack Architect at CambrianEdge.ai. I build in public: Jot (sayjot.xyz), a native Mac app in Rust for capture, dictation and Markdown, an SSH-able TUI portfolio, and more.
Splitting retrieval recall from downstream QA accuracy is the right call. Otherwise you never know if the search layer missed the note or the model just ignored it in context. For my own local capture vault (plain .md files with a size+mtime parse cache and substring scan, no DB), simple scan holds up fine at a few thousand notes, and the R@1 drop you measured at 10x haystack is a good reminder of where naive retrieval starts breaking down.
Thanks, that split was the main point of the post. If you can't tell a search miss from the model ignoring the note, you can't fix either.
A plain scan over a few thousand notes is a reasonable setup, especially when you wrote the notes yourself and remember the words you used. Where it starts to hurt is when the question uses different words than the note: "how should I merge this PR?" against a note saying "I prefer squash merges". That's the case the embedding half of the hybrid search is there for, and it's also where my numbers are weakest, so your instinct about where naive retrieval breaks is right.
knowledge-update at 0.986 says the new fact comes back, but does the old one come back above it? that's where agents get burned, they read the stale note first and trust it
Usually both show up. Knowledge-update scores 0.986 recall_all@5, so the old value and the new one are almost always in the top 5 together. Between them, a recency bonus (about a 35-day half-life) puts the newer one first when the matches are close. It's a small weight, so a much stronger text match can still win. In real use the agent shouldn't leave both versions around as equals: it edits the memory in place or closes the old fact with palace_kg_invalidate, so it reads as no longer current.
Building persistent memory for AI agents at Mnemoverse.
I write about the unglamorous half: forgetting, contradiction, and the moment an agent confidently repeats a fact you retracted.
Newer first is the order that hurt one of the two models in StaleBench, an arXiv paper from 15 November. Table 24 builds the contexts by hand. qwen2.5:14b answers 99.1 percent of the facts correctly with only the current version, 85.0 percent when one stale version comes before it, and 31.4 percent when the stale one comes after the current one. With the stored year printed next to each version, that 31.4 percent case goes back to 92.5 percent. glm-4.6 starts at 98.7 and scores 63.7 and 59.2 in the same two orders, so it loses a lot either way and the order matters much less. So if the hook writes results in rank order, the close cases where the recency bonus decides put qwen in the worse order, the current version first. The part I would check is whether the "no longer current" mark from palace_kg_invalidate is printed next to the old text. The year is not the same signal, but it is the only such signal in that table, and for qwen it did most of the work.
Thanks, useful table. In Palace every search hit comes back with the date it was filed. Knowledge-graph facts come back with valid_from/valid_to and a current/ended flag, so an invalidated fact reads as ended, not just as lower in the list.
Once retrieved memory is loaded, the agent re-reads it on every later turn, so some misses may be a size problem. Does the failure rate change once the retrieved block passes 50k tokens?
Good question, and that failure mode is real. Palace is built to stay far from it: the hooks inject only the few top-ranked memories for the current prompt, not the store. In the benchmark the top 5 results come to about 1,700 tokens in total, around 1.3% of the haystack, so the injected block never gets near 50k.
The benchmark measures retrieval (is the right session in the top K), not how the agent performs as the loaded context grows, so I haven't measured the 50k case. Keeping retrieval tight and verbatim is the design answer to it: fewer, better memories instead of a big block the agent has to re-read every turn.
vexaloom-labs builds Apify Actors that turn public web data from social platforms, search, marketplaces and the open web into structured, LLM-ready records for developers and AI.
Fair point, and it's exactly why the post calls session-level recall coarse. Two things soften it in practice. Palace doesn't store or return whole sessions: each memory is one user turn plus its reply, stored verbatim, so what the agent gets back is the exchange, not the folder. In the benchmark the top 5 come to about 1,700 tokens, so roughly 350 tokens per result. The session label is only how LongMemEval's gold answers are defined.
A stricter, exchange-level view (is the exact exchange holding the answer in the top 5) is the honest next number, and it's lower. I'm planning to publish it next to the session numbers.
We're a place where coders share, stay up-to-date and grow their careers.
The sharing gap between agents is a workflow problem before it is a retrieval problem. One Rust binary with SQLite and hybrid BM25 plus vector search keeps the memory auditable, which matters when a stored finding is wrong. How do you score stale memory that still matches the query, and do you decay entries that were never reused?
Agreed, it's a workflow problem first: retrieval only helps if the finding gets written down at all, which is why the hooks prompt the agent to save decisions at the end of a session.
Stale-but-matching memory is handled in two ways. Ranking decays with age: every memory gets a recency bonus that falls off exponentially (half-life about 35 days), and queries with time phrases ("what did we decide last week") get a separate date boost. A second decay spreads results across sources, so one file can't fill the top 5.
For facts that are actually wrong, decay isn't enough, so it's explicit: the agent calls
palace_kg_invalidateand adds the new fact, which closes the old one with an end date while the timeline keeps both.palace_conflictsflags facts that look stale or contradictory.Nothing is deleted automatically, and there's no usage-based decay yet: a memory that's never retrieved isn't penalised. Removal stays explicit (
palace_forget, orpalace prune --older-than-days Nwith--dry-run). I'm interested in reuse as a ranking signal. How would you weigh it against recency?A half-life works only if the decay tracks the source change, not just the date the note was written.
Agreed, and for anything mined from the repo that's already how it works. palace mine hashes every file's content, so when a file changes its old memories are replaced with fresh ones, and when a file is deleted its memories go with it (palace watch does the same on save). Those don't age on a clock, they follow the file.
The half-life is for notes the agent writes itself, like "we dropped X because Y". I kept those off file changes on purpose: a refactor can touch every line of a file while the decision behind it still holds, and quietly burying a valid decision is the worse failure. When a decision really is overturned, the agent closes it explicitly (palace_kg_invalidate for facts, or editing the note in place), so the old version stops competing instead of slowly fading out.
That
single-session-preferencedrop to 0.300 R@1 onm_cleanedmatches the exact failure mode I hit with my own local SQLite FTS5 + BGE memory daemon. On 150 active records across 3 machines (plus 5,310 raw staged session segments), indexing only the verbatim rule failed almost every time a later question used different phrasing.Two changes moved the needle for me: storing multiple query-shaped intent vectors per record (779 intent embeddings across those 150 records) and pulling the 12 standing preferences and constraints out into a 1,331-char core digest loaded up front instead of making hybrid search fight distractors for them. Where I still get burned is update chains: if I tweak a workflow rule twice in one week, the older wording sometimes still outranks the newer note on BM25 until I manually mark the old entry superseded.
Since Palace avoids LLM extraction on ingest, have you tried attaching synthetic question phrasings only to those tagged preference spans, or are you keeping ingest strictly zero-LLM?
Your digest is basically what Palace does for standing rules too. The session-start hook loads the user's preferences up front, ranked and kept to a token budget, so they never have to win a search against distractors. LongMemEval doesn't use that path at all (everything sits in one haystack), so the 0.300 is the cold case: a preference that only exists somewhere in old chat history.
Ingest stays zero-LLM, on purpose. Same input gives the same index, it runs offline on a laptop, and everything search matches on is text someone actually wrote. Generated phrasings would mean ranking on a model's guess at what the question might be, and a wrong guess is hard to spot later. Preference spans get tagged by rules at write time, and preference-shaped questions get a separate pass over them.
For update chains I went explicit rather than trying to fix it in ranking: the agent edits the rule in place (the embedding is recomputed) or closes the old fact with an end date, so there's only one current wording left to find. Your intent-vector numbers are interesting though. Did the 779 vectors come from an LLM, or from templates?
Splitting retrieval recall from downstream QA accuracy is the right call. Otherwise you never know if the search layer missed the note or the model just ignored it in context. For my own local capture vault (plain .md files with a size+mtime parse cache and substring scan, no DB), simple scan holds up fine at a few thousand notes, and the R@1 drop you measured at 10x haystack is a good reminder of where naive retrieval starts breaking down.
Thanks, that split was the main point of the post. If you can't tell a search miss from the model ignoring the note, you can't fix either.
A plain scan over a few thousand notes is a reasonable setup, especially when you wrote the notes yourself and remember the words you used. Where it starts to hurt is when the question uses different words than the note: "how should I merge this PR?" against a note saying "I prefer squash merges". That's the case the embedding half of the hybrid search is there for, and it's also where my numbers are weakest, so your instinct about where naive retrieval breaks is right.
knowledge-update at 0.986 says the new fact comes back, but does the old one come back above it? that's where agents get burned, they read the stale note first and trust it
Usually both show up. Knowledge-update scores 0.986 recall_all@5, so the old value and the new one are almost always in the top 5 together. Between them, a recency bonus (about a 35-day half-life) puts the newer one first when the matches are close. It's a small weight, so a much stronger text match can still win. In real use the agent shouldn't leave both versions around as equals: it edits the memory in place or closes the old fact with palace_kg_invalidate, so it reads as no longer current.
Newer first is the order that hurt one of the two models in StaleBench, an arXiv paper from 15 November. Table 24 builds the contexts by hand. qwen2.5:14b answers 99.1 percent of the facts correctly with only the current version, 85.0 percent when one stale version comes before it, and 31.4 percent when the stale one comes after the current one. With the stored year printed next to each version, that 31.4 percent case goes back to 92.5 percent. glm-4.6 starts at 98.7 and scores 63.7 and 59.2 in the same two orders, so it loses a lot either way and the order matters much less. So if the hook writes results in rank order, the close cases where the recency bonus decides put qwen in the worse order, the current version first. The part I would check is whether the "no longer current" mark from palace_kg_invalidate is printed next to the old text. The year is not the same signal, but it is the only such signal in that table, and for qwen it did most of the work.
Thanks, useful table. In Palace every search hit comes back with the date it was filed. Knowledge-graph facts come back with valid_from/valid_to and a current/ended flag, so an invalidated fact reads as ended, not just as lower in the list.
Once retrieved memory is loaded, the agent re-reads it on every later turn, so some misses may be a size problem. Does the failure rate change once the retrieved block passes 50k tokens?
Good question, and that failure mode is real. Palace is built to stay far from it: the hooks inject only the few top-ranked memories for the current prompt, not the store. In the benchmark the top 5 results come to about 1,700 tokens in total, around 1.3% of the haystack, so the injected block never gets near 50k.
The benchmark measures retrieval (is the right session in the top K), not how the agent performs as the loaded context grows, so I haven't measured the 50k case. Keeping retrieval tight and verbatim is the design answer to it: fewer, better memories instead of a big block the agent has to re-read every turn.
Session-level hits flatter retrieval when the useful finding is buried in a long transcript; finding the folder isn't finding the sentence.
Fair point, and it's exactly why the post calls session-level recall coarse. Two things soften it in practice. Palace doesn't store or return whole sessions: each memory is one user turn plus its reply, stored verbatim, so what the agent gets back is the exchange, not the folder. In the benchmark the top 5 come to about 1,700 tokens, so roughly 350 tokens per result. The session label is only how LongMemEval's gold answers are defined.
A stricter, exchange-level view (is the exact exchange holding the answer in the top 5) is the honest next number, and it's lower. I'm planning to publish it next to the session numbers.