Description
When used with Hermes Agent, the before_prompt_build hook receives internal agent prompts that cause FTS5 query failures and wasted LLM calls.
Steps to Reproduce
- Deploy MemTensor plugin with Hermes Agent v0.10.0
- Enable auto-recall functionality
- Wait for session end when Hermes fires
_SKILL_REVIEW_PROMPT
- Observe FTS5 query failures in logs
Example Error
[warn] FTS query failed for: "Review the conversation above consider saving updating skill if appropriate Focus on was non trivial approach used to complete task that required trial error changing course due to experiential findings along the way did the user expect desire different method outcome? If relevant skill already exists update it with what you learned Otherwise create new skill if the approach is reusable If nothing is worth saving just say Nothing to save stop", returning empty
Root Cause
The normalizeAutoRecallQuery() function in apps/memos-local-openclaw/index.ts doesn't filter out:
- Long instructional prompts (>300 chars)
- System prompt patterns ("You are...")
- Known Hermes review prompts ("Review the conversation above...")
These prompts are passed to FTS5 search, which fails because:
- The sanitized query is too long/complex
- The content is instructional, not searchable information
Impact
- FTS5 query failures: Logged as warnings, degrade search quality
- Wasted LLM calls:
filterRelevant() receives empty responses
- Degraded performance: FTS search falls back to vector-only search
Proposed Solution
Add early detection for instructional prompts in normalizeAutoRecallQuery():
if (query.length > 300) {
return ""; // System instructions, not user queries
}
if (/^You are\b/i.test(query)) {
return ""; // System prompt pattern
}
if (/Review the conversation above/i.test(query)) {
return ""; // Hermes review prompt
}
Related PR
#1594 - fix: skip instructional prompts in auto-recall query normalization
Environment
- Hermes Agent: v0.10.0
- MemTensor: v1.0.4
- Model: deepseek-v4-flash (reasoning model)
- OS: Linux (Docker container)
Description
When used with Hermes Agent, the
before_prompt_buildhook receives internal agent prompts that cause FTS5 query failures and wasted LLM calls.Steps to Reproduce
_SKILL_REVIEW_PROMPTExample Error
Root Cause
The
normalizeAutoRecallQuery()function inapps/memos-local-openclaw/index.tsdoesn't filter out:These prompts are passed to FTS5 search, which fails because:
Impact
filterRelevant()receives empty responsesProposed Solution
Add early detection for instructional prompts in
normalizeAutoRecallQuery():Related PR
#1594 - fix: skip instructional prompts in auto-recall query normalization
Environment