Issue: LanceDB BigInt Error Causes Smart-Extractor to Skip [cases] Category
Problem Description
The smart-extractor is skipping all [cases] category memories with the error message:
memory-pro: smart-extractor: skipped [cases] LanceDB BigInt error -> Use Number() coercion before arithmetic
This triggers a fallback to regex capture, which finds 0 capturable texts.
Root Cause Analysis
The issue originates from extraction-prompts.ts, which includes guidance for the LLM about BigInt handling:
// extraction-prompts.ts:103-110
## cases
```json
{
"category": "cases",
"abstract": "LanceDB BigInt error -> Use Number() coercion before arithmetic",
"overview": "## Problem\\nLanceDB 0.26+ returns BigInt for numeric columns\\n\\n## Solution\\nCoerce values with Number(...) before arithmetic",
"content": "When LanceDB returns BigInt values, wrap them with Number() before doing arithmetic operations."
}
When the LLM processes existing memories in the [cases] category, it interprets this guidance as a reason to skip them, resulting in:
stats.created = 0
stats.merged = 0
stats.skipped > 0
- Triggers "falling back to regex capture"
Evidence
Log excerpt:
00:36:47 [plugins] memory-pro: smart-extractor: skipped [cases] LanceDB BigInt error -> Use Number() coercion before arithme
00:37:50 [plugins] memory-lancedb-pro: smart extraction produced no persisted memories for agent dc-channel--1476866394556465252 (created=0, merged=0, skipped=4); falling back to regex capture
00:37:50 [plugins] memory-lancedb-pro: regex fallback found 0 capturable texts for agent dc-channel--1476866394556465252
Code Fix Status
The store.ts already has Number() coercion in multiple locations (lines 553-554, 607-608, 675-686, 749-750, 887-888, 1019-1020, 1230-1231):
// store.ts:685-686
importance: Number(row.importance),
timestamp: Number(row.timestamp),
// store.ts:675
const rawScore = row._score != null ? Number(row._score) : 0;
All accesses to row.importance, row.timestamp, and row._score are properly wrapped with Number().
Solution
The prompt in extraction-prompts.ts is misleading the LLM. The fix should either:
- Remove the misleading guidance from the cases category prompt, OR
- Clarify that this is guidance for CODE WRITING, not for evaluating existing memories
Recommended fix: Update the cases category prompt to clarify its purpose.
Test Case
Create a unit test to verify:
- LanceDB returns BigInt for numeric columns
- Memory operations work correctly with Number() coercion
- [cases] category memories are not incorrectly skipped
Related Issues
Issue: LanceDB BigInt Error Causes Smart-Extractor to Skip [cases] Category
Problem Description
The smart-extractor is skipping all
[cases]category memories with the error message:This triggers a fallback to regex capture, which finds 0 capturable texts.
Root Cause Analysis
The issue originates from extraction-prompts.ts, which includes guidance for the LLM about BigInt handling:
When the LLM processes existing memories in the
[cases]category, it interprets this guidance as a reason to skip them, resulting in:stats.created = 0stats.merged = 0stats.skipped > 0Evidence
Log excerpt:
Code Fix Status
The
store.tsalready hasNumber()coercion in multiple locations (lines 553-554, 607-608, 675-686, 749-750, 887-888, 1019-1020, 1230-1231):All accesses to
row.importance,row.timestamp, androw._scoreare properly wrapped withNumber().Solution
The prompt in
extraction-prompts.tsis misleading the LLM. The fix should either:Recommended fix: Update the
casescategory prompt to clarify its purpose.Test Case
Create a unit test to verify:
Related Issues