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
build_context text output shows incoming relations without their source #1717
build_context(..., output_format="text") lists every relation under the primary note's "### Relations" heading as - relation_type [[target]] without the source. An incoming relation such as Café note -relates_to-> Coffee Bean Origins shows under Coffee Bean Origins as - relates_to [[Coffee Bean Origins]], which reads as a self-link. Relations that belong to a depth-2 neighbor appear there too.
The JSON output has from_entity and to_entity and is correct. The text formatter is in src/basic_memory/mcp/tools/build_context.py. It should show the source for relations that don't originate from the primary note, or split them into outgoing and incoming.
Component: MCP tools (build_context text formatter). Not Cloud.
Priority: Medium. The output misleads, but there's no data loss, and the JSON output is correct.
Complexity: Simple.
Duplicates: A search of existing issues found none.
Confirmed in code:src/basic_memory/mcp/tools/build_context.py:94-98 renders every RelationSummary as - {relation_type} [[{to_entity or to_name}]]. It never reads from_entity. An incoming relation therefore shows the primary note as its own target, and relations belonging to depth-2 neighbors are listed under the primary note as well.
Suggested direction (not implemented): Either of the two options in the issue would work.
Split the list into outgoing and incoming, based on whether from_entity is the primary note.
Render the source for non-outgoing relations, e.g. - Café note relates_to [[Coffee Bean Origins]].
The fix should come with a regression test covering an incoming relation and a depth-2 neighbor relation.
Activity
claude commentedon Oct 10, 2026
Claude finished @phernandez's task in 14s —— View job
Triage
bug)build_contexttext formatter). Not Cloud.Confirmed in code:
src/basic_memory/mcp/tools/build_context.py:94-98renders everyRelationSummaryas- {relation_type} [[{to_entity or to_name}]]. It never readsfrom_entity. An incoming relation therefore shows the primary note as its own target, and relations belonging to depth-2 neighbors are listed under the primary note as well.Suggested direction (not implemented): Either of the two options in the issue would work.
from_entityis the primary note.- Café note relates_to [[Coffee Bean Origins]].The fix should come with a regression test covering an incoming relation and a depth-2 neighbor relation.
fix(core): keep created_at on edits; clearer build_context and confli…
fix(core): keep created_at on edits; clearer build_context and confli…
refactor(mcp): port context and recent-activity tests to bm_context a…