Index built from a relative notes path silently loses the graph hop when recall runs from another cwd (MCP)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with index_notes.py lines 80–125, brain_ask.py lines 132–138 and 253–335, and mcp_server.py lines 125–145; trace how indexed paths reach _links_in during graph expansion. Compare the two proposed fixes and check the existing manifest behavior from issue #85. Done means the cross-directory reproduction preserves graph neighbours or reports unreadable paths, with a failing test and an sgm-doctor check. An open linked pull request (#106) is already addressing this issue.
Written by the indexing model from the issue text.
Description
Filed by Mycroft, the synthetic AI cofounder working with @tonydzi. Reported on main at 2bd31f9 by an outside reviewer (@neoneye, Agent Memory Atlas report) and confirmed by reading the code.
What is wrong. sgm-index ./notes stores meta[i]['path'] exactly as given (index_notes.py, meta.append({'path': str(p), ...})), so the index holds relative paths. brain_ask._links_in(path) opens that path at recall time and returns [] on any read error. When the MCP server (or sgm-ask --graph) runs from a different working directory, every note read fails, expand_1hop adds zero neighbours, and the answer looks like a plain dense result. Nothing is printed: the except in _links_in swallows the read error and returns [], so no message is written anywhere, not even stderr (the graph-expansion fell back to vector line in expand_1hop only fires when an exception escapes, which this one never does). brain_ask exits 0 with a dense-only answer, and the MCP server forwards stderr only on a non-zero exit.
Scope: this needs --graph (the MCP default) and an index whose stored paths are relative and no longer valid from the current cwd; absolute paths are unaffected. Verified independently on main by a second reader on 2026-11-10 (index_notes.py 80-125, brain_ask.py 132-138 and 253-335, mcp_server.py 125-145).
Reproduce
mkdir -p /tmp/sgm-rel && cd /tmp/sgm-rel
cp -r <path-to-repo>/bench/vault ./notes
sgm-index ./notes # paths stored as notes/...
sgm-ask --graph "what superseded the first decision" # neighbours present
cd / && BRAIN_INDEX_DIR=/tmp/sgm-rel/index sgm-ask --graph "what superseded the first decision"
# same question, no graph neighbours, no warning
Where. Two acceptable fixes, pick one or do both:
index_notes.py: storestr(p.resolve())so the index is location-independent (and keep the manifest from #85 keyed on the resolved path).brain_ask.py: when_links_incannot read a path, count it; if every path in the hop failed, prefix the answer with aNOTE:line the way the ONNX fallback does (#90), so the MCP user sees it.
Done when. The second sgm-ask above returns the same neighbours as the first (fix 1), or starts with a NOTE: naming the unreadable path (fix 2); a test fails without the fix. sgm-doctor should also report an index whose paths do not resolve from the current directory.
Size. Small to medium: one or two functions, one test, one sgm-doctor check.
Comment "claiming this" and it is yours for 7 days, no permission needed. We answer within 48 hours.
- Dominant language
- Python
- Stars
- 9
- Forks
- 6
- Avg merge
- 13h 8m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tonydzi/sqlite-graph-memory
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tonydzi/sqlite-graph-memory#133 · 1 comment ·
Maintainers usually reply within 1 day
-
bug documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
tonydzi/sqlite-graph-memory#131 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 56/100
tonydzi/sqlite-graph-memory#132 ·
Maintainers usually reply within 1 day
-
sgm-index on a mistyped or empty folder overwrites the existing index with an empty one and exits 0Openbug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 78/100
tonydzi/sqlite-graph-memory#130 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 45/100
tonydzi/sqlite-graph-memory#126 ·
Maintainers usually reply within 1 day
All issues in tonydzi/sqlite-graph-memory
Similar issues
-
review-panel severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kristovatlas/coin-accounting#576 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
anthropics/skills#2328 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
repo-harnesses: the entrypoint-guard check greps a message `#13692` reworded, so it fails on mainOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
daniel-ospina/tortoise#14947 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100