#7543·crewAI

[BUG] [BUG] LanceDBStorage 作用域前缀过滤器跨路径边界: `/app` 匹配 `/apple`

作者: coderdailyone创建于 2026年9月17日更新于 2026年9月17日

import tempfile from CrewAI.memory.storage.lancedb_storage import LanceDBStorage from CrewAI.memory.types import MemoryRecord s = LanceDBStorage(path=tempfile.mkdtemp(), vector_dim=4, compact_every=0) s.save([ MemoryRecord(content="app", scope="/app", embedding=[0.0]*4), MemoryRecord(content="child", scope="/app/sub", embedding=[0.0]*4), MemoryRecord(content="sib", scope="/apple", embedding=[0.0]*4), MemoryRecord(content="root", scope="/", embedding=[0.0]*4), ])

print(sorted(r.scope for r, _ in s.search([0.0]*4, scope_prefix="/app")))

['/app', '/app/sub', '/apple'] <- expected ['/app', '/app/sub']

print(s.count("/app")) # 3 <- expected 2 s.delete(scope_prefix="/app", categories=["mine"])

also deletes the matching /apple record <- expected: /apple untouched

内容来源: crewAIInc/crewAI