Skip to content

Conversation

@Wilson-G
Copy link

Fixes two issues that prevented memory retrieval from working:

  1. FTS contentless table issue (search_service.py)

    • FTS table is created with content='' (contentless)
    • Directly reading FTS columns returns NULL
    • Fixed by using rowid JOIN to source tables
  2. category_primary mismatch (memory.py)

    • get_essential_conversations queried 'essential_%'
    • But actual values are 'conscious_context', 'conscious-info', etc.
    • Fixed by matching both 'essential%' and 'conscious%' patterns

Tested: retrieve_context and get_essential_conversations now return correct results

Will G added 2 commits November 28, 2025 09:19
Fixes two issues that prevented memory retrieval from working:

1. FTS contentless table issue (search_service.py)
   - FTS table is created with content='' (contentless)
   - Directly reading FTS columns returns NULL
   - Fixed by using rowid JOIN to source tables

2. category_primary mismatch (memory.py)
   - get_essential_conversations queried 'essential_%'
   - But actual values are 'conscious_context', 'conscious-info', etc.
   - Fixed by matching both 'essential%' and 'conscious%' patterns

Tested: retrieve_context and get_essential_conversations now return correct results
WHAT: 将 FTS 表从 contentless 模式改为存储完整数据
WHY: contentless FTS 表的 rowid 与源表不对应,导致 JOIN 时匹配不到正确记录,搜索返回空结果
HOW:
1. FTS 表直接存储 memory_id、memory_type、user_id、searchable_content 等字段
2. 搜索时直接从 FTS 表读取,不再依赖 rowid
3. 只在需要 processed_data、importance_score 等额外字段时才通过 memory_id JOIN 源表
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant