Fix: Delete relations from vector DB in both directions
This commit is contained in:
parent
ebcabe29ca
commit
f60bad92f0
1 changed files with 6 additions and 4 deletions
|
|
@ -84,10 +84,12 @@ async def adelete_by_relation(
|
||||||
return
|
return
|
||||||
|
|
||||||
# Delete relation from vector database
|
# Delete relation from vector database
|
||||||
relation_id = compute_mdhash_id(
|
rel_ids_to_delete = [
|
||||||
source_entity + target_entity, prefix="rel-"
|
compute_mdhash_id(source_entity + target_entity, prefix="rel-"),
|
||||||
)
|
compute_mdhash_id(target_entity + source_entity, prefix="rel-"),
|
||||||
await relationships_vdb.delete([relation_id])
|
]
|
||||||
|
|
||||||
|
await relationships_vdb.delete(rel_ids_to_delete)
|
||||||
|
|
||||||
# Delete relation from knowledge graph
|
# Delete relation from knowledge graph
|
||||||
await chunk_entity_relation_graph.remove_edges(
|
await chunk_entity_relation_graph.remove_edges(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue