Skip to content

Commit

Permalink
hold lock on memory read to prevent reading during a write.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 672851018
Change-Id: I797a7a0379531a98ed9fa55f911edff627e497dc
  • Loading branch information
jagapiou authored and copybara-github committed Sep 10, 2024
1 parent 7b9e9b3 commit 4066851
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion concordia/components/agent/memory_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def retrieve(
A list of memory results.
"""
self._check_phase()
return self._memory.retrieve(query, scoring_fn, limit)
with self._lock:
return self._memory.retrieve(query, scoring_fn, limit)

def add(
self,
Expand Down

0 comments on commit 4066851

Please sign in to comment.