clawmem 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/mcp.ts +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmem",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "On-device context engine and memory for AI agents. Claude Code and OpenClaw. Hooks + MCP server + hybrid RAG search.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/mcp.ts CHANGED
@@ -878,11 +878,12 @@ This is the recommended entry point for ALL memory queries.`,
878
878
  if (tokens.length > 0) {
879
879
  const minMatch = Math.max(2, Math.ceil(tokens.length / 2));
880
880
  const titleHits = store.db.prepare(`
881
- SELECT collection || '/' || path as displayPath, title,
882
- ${tokens.map((_, i) => `(CASE WHEN LOWER(title) LIKE ? THEN 1 ELSE 0 END)`).join(" + ")} as match_count
883
- FROM documents
884
- WHERE active = 1 AND invalidated_at IS NULL
885
- HAVING match_count >= ?
881
+ SELECT displayPath, title, match_count FROM (
882
+ SELECT collection || '/' || path as displayPath, title, modified_at,
883
+ ${tokens.map(() => `(CASE WHEN LOWER(title) LIKE ? THEN 1 ELSE 0 END)`).join(" + ")} as match_count
884
+ FROM documents
885
+ WHERE active = 1 AND invalidated_at IS NULL
886
+ ) WHERE match_count >= ?
886
887
  ORDER BY match_count DESC, modified_at DESC
887
888
  LIMIT ?
888
889
  `).all(...tokens.map(t => `%${t}%`), minMatch, limit) as { displayPath: string; title: string; match_count: number }[];