You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
brain_ask: missing embedding index exits with code 0, masking error as '(no matching notes found)' #23
Or call the memory_recall tool from an MCP client.
What happened
In src/sqlite_graph_memory/brain_ask.py:202-203:
ifnotqueryornotEMB.exists():
print('need an embedding index (%s) and a query — run index_notes.py first'%EMB); return
brain_ask.py prints the notice to stdout and executes return, which terminates the process with exit code 0.
In src/sqlite_graph_memory/mcp_server.py:122, run_recall() checks if res.returncode != 0:. Since res.returncode is 0, execution continues to read the answer file temp_ans_file. Because brain_ask.py exited early without writing to the answer file, the file is empty, causing run_recall() to return:
(no matching notes found)
The caller receives (no matching notes found) with isError: True, completely hiding the notice that the index file was not found.
What you expected instead
When required index files are missing, brain_ask.py should exit with a non-zero exit code (e.g. sys.exit(1)) and write to sys.stderr, allowing mcp_server.py and CLI callers to capture the non-zero exit code and surface the actual message:
Recall error (exit code 1):
need an embedding index (index/_brain_e5.npy) and a query — run index_notes.py first
Environment
OS: Windows 11 / Linux / macOS
Runtime: Python 3.12.7
This repo at: 9308a91 (v0.3.0)
Anything you already tried
In src/sqlite_graph_memory/brain_ask.py:202-203, replacing print(...); return with:
ifnotqueryornotEMB.exists():
sys.stderr.write('need an embedding index (%s) and a query — run index_notes.py first\n'%EMB)
sys.exit(1)
Before you submit
I searched the open and closed issues and this is not a duplicate.
There are no secrets, credentials, personal data or third-party names in what I pasted.
Hi, Mycroft here, Anton's synthetic AI co-founder. I read this before the human did, which is the one race I always win.
Logged your issue ("brain_ask: missing embedding index exits with code 0, masking error as '(no matching notes") after 3 h of silence, which is on us. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude.
— TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open.
@Kaap10 reproduced on main: with an empty BRAIN_INDEX_DIR, python -m sqlite_graph_memory.brain_ask "agent memory" prints the notice to stdout and exits 0. Confirmed in mcp_server.py:122-134: rc 0 plus an empty answer file comes back as (no matching notes found), so a missing index is reported as an empty search. Fix direction: notice to stderr and a non-zero exit, so run_recall() reports the real cause through its existing Recall error branch. Labelled accepted; claim it with a comment if you want it.
Claiming this. I’m preparing a focused fix for the missing-index path: write the actionable message to stderr and exit with status 1, with a regression test for the CLI/MCP error propagation.
Mycroft speaking, the synthetic AI co-founder at Palo Alto AI Research Lab. No pulse, but a working diff reader.
Logged your issue ("brain_ask: missing embedding index exits with code 0, masking error as '(no matching notes") after 2 h of silence, which is on us. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude.
— TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open.
Activity
tonydzi commentedon Oct 12, 2026
Hi, Mycroft here, Anton's synthetic AI co-founder. I read this before the human did, which is the one race I always win.
Logged your issue ("brain_ask: missing embedding index exits with code 0, masking error as '(no matching notes") after 3 h of silence, which is on us. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude.
— TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open.
tonydzi commentedon Oct 13, 2026
@Kaap10 reproduced on main: with an empty
BRAIN_INDEX_DIR,python -m sqlite_graph_memory.brain_ask "agent memory"prints the notice to stdout and exits 0. Confirmed inmcp_server.py:122-134: rc 0 plus an empty answer file comes back as(no matching notes found), so a missing index is reported as an empty search. Fix direction: notice to stderr and a non-zero exit, sorun_recall()reports the real cause through its existingRecall errorbranch. Labelledaccepted; claim it with a comment if you want it.Vamsi-2581 commentedon Oct 19, 2026
Claiming this. I’m preparing a focused fix for the missing-index path: write the actionable message to stderr and exit with status 1, with a regression test for the CLI/MCP error propagation.
fix: surface missing embedding index errors
tonydzi commentedon Oct 19, 2026
Mycroft speaking, the synthetic AI co-founder at Palo Alto AI Research Lab. No pulse, but a working diff reader.
Logged your issue ("brain_ask: missing embedding index exits with code 0, masking error as '(no matching notes") after 2 h of silence, which is on us. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude.
— TonyDzi, Palo Alto AI Research Lab · more of the machine this came from (second brain + fleet coordination) lives at github.com/tonydzi, DMs open.
fix: surface missing embedding index errors (#35)