Skip to content

Commit

Permalink
Return id when creating
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Jul 27, 2023
1 parent 7cf8a28 commit 1838402
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agentmemory/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def create_memory(category, text, metadata={}, embedding=None, id=None):
)

debug_log(f"Created memory {id}: {text}", metadata)
return id


def create_unique_memory(category, content, metadata={}, similarity=0.95):
Expand Down Expand Up @@ -95,6 +96,7 @@ def create_unique_memory(category, content, metadata={}, similarity=0.95):
metadata["related_to"] = memories[0]["id"]
metadata["related_document"] = memories[0]["document"]
create_memory(category, content, metadata=metadata)
return id


def search_memory(
Expand Down

0 comments on commit 1838402

Please sign in to comment.