fix(v3): migration crashes + entity linking on OSS (#4836)
Co-authored-by: Soumil Rathi <soumilrathi@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Soumil Rathi
Claude Opus 4.6
parent
a5a688295e
commit
d8d776636f
+16
-7
@@ -334,6 +334,14 @@ class Memory(MemoryBase):
|
||||
entity_config.collection_name = entity_collection
|
||||
elif isinstance(entity_config, dict):
|
||||
entity_config['collection_name'] = entity_collection
|
||||
# For Qdrant, share the existing client to avoid RocksDB lock contention
|
||||
# when using embedded mode (path=...). QdrantConfig.client takes precedence
|
||||
# over host/port/path.
|
||||
if self.config.vector_store.provider == "qdrant" and hasattr(self.vector_store, "client"):
|
||||
if hasattr(entity_config, "client"):
|
||||
entity_config.client = self.vector_store.client
|
||||
elif isinstance(entity_config, dict):
|
||||
entity_config["client"] = self.vector_store.client
|
||||
self._entity_store = VectorStoreFactory.create(
|
||||
self.config.vector_store.provider, entity_config
|
||||
)
|
||||
@@ -1188,8 +1196,6 @@ class Memory(MemoryBase):
|
||||
entity_boosts = self._compute_entity_boosts(query_entities, filters)
|
||||
|
||||
# Step 7: Build candidate set from semantic results
|
||||
# BM25 acts as a boost signal only (not recall-expanding) -- candidates must
|
||||
# pass the semantic threshold gate, so only semantic results are candidates.
|
||||
candidates = []
|
||||
for mem in semantic_results:
|
||||
mem_id = str(mem.id)
|
||||
@@ -1234,9 +1240,6 @@ class Memory(MemoryBase):
|
||||
score=scored["score"],
|
||||
).model_dump()
|
||||
|
||||
# Add score breakdown to metadata
|
||||
memory_item_dict["score_breakdown"] = scored.get("score_breakdown", {})
|
||||
|
||||
for key in promoted_payload_keys:
|
||||
if key in payload:
|
||||
memory_item_dict[key] = payload[key]
|
||||
@@ -1640,6 +1643,14 @@ class AsyncMemory(MemoryBase):
|
||||
entity_config.collection_name = entity_collection
|
||||
elif isinstance(entity_config, dict):
|
||||
entity_config['collection_name'] = entity_collection
|
||||
# For Qdrant, share the existing client to avoid RocksDB lock contention
|
||||
# when using embedded mode (path=...). QdrantConfig.client takes precedence
|
||||
# over host/port/path.
|
||||
if self.config.vector_store.provider == "qdrant" and hasattr(self.vector_store, "client"):
|
||||
if hasattr(entity_config, "client"):
|
||||
entity_config.client = self.vector_store.client
|
||||
elif isinstance(entity_config, dict):
|
||||
entity_config["client"] = self.vector_store.client
|
||||
self._entity_store = VectorStoreFactory.create(
|
||||
self.config.vector_store.provider, entity_config
|
||||
)
|
||||
@@ -2480,8 +2491,6 @@ class AsyncMemory(MemoryBase):
|
||||
score=scored["score"],
|
||||
).model_dump()
|
||||
|
||||
memory_item_dict["score_breakdown"] = scored.get("score_breakdown", {})
|
||||
|
||||
for key in promoted_payload_keys:
|
||||
if key in payload:
|
||||
memory_item_dict[key] = payload[key]
|
||||
|
||||
Reference in New Issue
Block a user