Repository navigation
Say when a saved memory becomes searchable - #3
Conversation
`add_memory(wait=true)` replied "the memory is now searchable", but extraction finishing and the search index catching up are two steps. Against a self-hosted EverOS the index lagged the write by about half a second: a search_memory call issued right after the reply found nothing and the same query a second later found the memory. Say so in the reply, the docstring and the README instead of promising immediate hits. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dani1005
left a comment
There was a problem hiding this comment.
Thanks for tracking this down. The measurement is convincing: wait=true currently claims more than it delivers, and making the wording honest is the right first step.
The catch is that rewording alone leaves the tool contract self-contradictory (see inline). The docstring still tells the model to use wait=true when it must search right away, which is exactly the case this PR shows still fails.
Suggested direction. Make wait=true actually wait for searchability. In Conversation.store, after the flush, poll briefly until the new entry is visible, or use a server-side option that waits for indexing if the API has one. Then "now searchable" is true again and the docs need no hedging. If you'd rather land the wording first, please at least:
- Drop "only when you must search for it right away" from the
add_memorydocstring. - Use one latency statement everywhere.
search_memory's docstring and its empty-result note say "saved in the last minute may not be indexed yet"; this PR says "usually within a second"; the background path says "a few seconds later" / "shortly". - Update
Conversation.store's docstring (conversation.py:111), which still says"extracted" means searchable.
Then follow up with the real fix in a separate PR.
Note: EverMind-AI/EverOS#484 repeats the "about a second" claim in docs/mcp.md, so it's worth landing the two consistently.
| the memory is searchable a few seconds later, and a failure is reported | ||
| on a later tool result. Set wait=true only when you must search for it | ||
| right away — it blocks until extraction finishes. | ||
| right away — it blocks until extraction finishes; the index catches up |
There was a problem hiding this comment.
This sentence still tells the model to use wait=true when it must search right away, but the PR's own finding is that wait=true doesn't make the memory searchable right away. A model that follows the docstring calls search_memory immediately, lands inside the index lag, gets "No relevant memories found", and may tell the user the save failed. Either make wait=true wait for indexing (preferred), or drop "only when you must search for it right away".
| if status == "extracted": | ||
| return conv.reply("Stored and extracted; the memory is now searchable.") | ||
| return conv.reply( | ||
| "Stored and extracted; searchable once the index catches up, usually within a second." |
There was a problem hiding this comment.
Two things on this line:
- Latency figure. "usually within a second" comes from one self-hosted measurement. Meanwhile
search_memory(docstring and empty-result note) says memories from "the last minute" may not be indexed yet. On Cloud or a loaded server the model may trust "a second", retry once, and give up. Please pick one conservative statement and use it everywhere. - Line length. This line is 102 characters, over
line-length = 100inpyproject.toml. CI doesn't catch it because E501 isn't enabled. Splitting it into two adjacent literals, like the reply just below, fixes it.
| ) | ||
| reply = run(server.add_memory(user_message="x", wait=True)) | ||
| assert "now searchable" in reply | ||
| assert "Stored and extracted" in reply |
There was a problem hiding this comment.
With only the stable prefix asserted, nothing guards the wording this PR fixes. If "now searchable" comes back later, all three updated assertions still pass. Maybe add assert "now searchable" not in reply here (and at 750 / 841).
Review on EverMind-AI#3: the docstring still told the model to use wait=true when it must search right away, and the reply promised "within a second" from a single measurement while search_memory says "the last minute". Making wait=true block until the index has caught up was considered and rejected: how long indexing takes depends on server load, so any bound would be a guess. Instead every place now says the same thing: memories saved in the last minute may not be indexed yet, and list_memories shows them sooner. Tests also assert the old "now searchable" wording is gone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks for the careful read. Pushed a follow-up commit:
On making |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks, this all looks good, and the reasoning on not waiting for the index makes sense to me. I pushed one small follow-up (9677d0d): the |
Summary
add_memory(wait=true)replied "Stored and extracted; the memory is now searchable." Extraction finishing and the memory becoming searchable are two steps, and on a self-hosted EverOS the index catches up about half a second after the write. Verified on 2026-10-10 against a localeveros server start(everos 1.4.1): asearch_memorycall issued right after that reply returned nothing; the same query a second later found the memory, and the server log shows the cascade indexing the new episode ~0.5 s after/memory/flushreturned.This changes only wording:
wait=truereply now says the memory is searchable once the index catches up, usually within a second;add_memorydocstring says the same for thewait=truebranch;wait=trueblocks "until it is searchable", and Good to know gains a bullet about the two steps andlist_memoriesshowing new entries sooner.Tests assert on the stable prefix
Stored and extractedinstead ofnow searchable.Verification
🤖 Generated with Claude Code