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
Search results truncate note content at 4000 characters with no indicator #1455
search_notes / bm grep return each hit's content cut at CONTENT_DISPLAY_LIMIT = 4000 (repository/search_index_row.py) with no marker, no truncated flag, and no total length. A note of 4425 bytes comes back as exactly 4000 characters ending mid-token.
results[] for "Chapter 135 - The Chase - Third Day" has len(content) == 4000, ending - follows [[C. The file is 4425 bytes. Same for "Stubb".
Why it matters
An agent that parses relations or observations out of grep results (the skill's recommended one-call replacement for 136 reads) silently loses the tail of every long note: here the follows/precedes relations of the final chapter. Exit 0, plausible output, no signal. This is the same "silent truncation" class the literary-analysis skill already warns about for paging.
Expected
Either a content_truncated: true field (and ideally content_length) on the row, or a visible suffix marker, so the caller knows to cat the note. The cap itself is fine.
Type: Bug — SearchIndexRow.content (src/basic_memory/repository/search_index_row.py:87-92) silently slices content_snippet at CONTENT_DISPLAY_LIMIT (4000 chars) with no marker or metadata indicating truncation occurred, and no content_length/content_truncated field is surfaced through search_notes / bm grep --json.
Component: MCP search tools (search_notes) and the bm grep CLI, both backed by repository/search_index_row.py. Not cloud-specific.
Priority: Medium — output is well-formed and exits 0, so callers (including agents parsing relations/observations out of grep results, per the skill's guidance) get a plausible-looking but silently incomplete result. Not data loss or a full breakage, but a correctness trap with no signal.
Complexity: Simple — the cap logic and its single call site are already isolated in SearchIndexRow.content. Adding a content_truncated: bool (and optionally content_length: int) field to the row/serialization, or an explicit suffix marker, is a small, localized change plus test updates (tests/repository/test_search_index_row.py already covers this property).
Duplicate check: No open duplicates found. Related but distinct closed issues: #609 (richer content context for content-hit scoring) and #599 (return matched chunk text instead of truncated header) — neither addresses signaling truncation itself.
Activity
claude commentedon Sep 3, 2026
Claude finished @phernandez's task in 41s —— View job
Triage
Type: Bug —
SearchIndexRow.content(src/basic_memory/repository/search_index_row.py:87-92) silently slicescontent_snippetatCONTENT_DISPLAY_LIMIT(4000 chars) with no marker or metadata indicating truncation occurred, and nocontent_length/content_truncatedfield is surfaced throughsearch_notes/bm grep --json.Component: MCP search tools (
search_notes) and thebm grepCLI, both backed byrepository/search_index_row.py. Not cloud-specific.Priority: Medium — output is well-formed and exits 0, so callers (including agents parsing relations/observations out of grep results, per the skill's guidance) get a plausible-looking but silently incomplete result. Not data loss or a full breakage, but a correctness trap with no signal.
Complexity: Simple — the cap logic and its single call site are already isolated in
SearchIndexRow.content. Adding acontent_truncated: bool(and optionallycontent_length: int) field to the row/serialization, or an explicit suffix marker, is a small, localized change plus test updates (tests/repository/test_search_index_row.pyalready covers this property).Duplicate check: No open duplicates found. Related but distinct closed issues: #609 (richer content context for content-hit scoring) and #599 (return matched chunk text instead of truncated header) — neither addresses signaling truncation itself.
Labels applied:
bug.docs(skills): literary analysis, corrections from the Moby Dick run
docs(skills): literary analysis, corrections from the Moby Dick run