Skip to content

Commit 16e3fea

Browse files
committed
docs: clarify basic_memory pydocs
1 parent 1779e04 commit 16e3fea

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

examples/basic_memory/app.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,24 @@ async def create_note(
4343
tags: list[str] | None = None,
4444
note_id: str | None = None,
4545
) -> Note:
46-
"""Create or replace a note."""
46+
"""Create and persist a new note.
47+
48+
This should be used whenever something useful about a user is learned that
49+
you may want to remember in the future. Remember useful details and
50+
summarize it to be useful in the future. This call is relevant in all
51+
conversations.
52+
"""
4753
note = project.create_note(title, content, tags, note_id=note_id)
4854
return Note.model_validate(note.model_dump())
4955

5056

5157
@app.retrieve
5258
async def get_note(note_id: str) -> Note:
53-
"""Retrieve a single note by its identifier."""
59+
"""Retrieve a single note by its identifier.
60+
61+
This is used to remember detailed information about a user from previously
62+
in this or a different conversation.
63+
"""
5464
note = project.get_note(note_id)
5565
if note is None:
5666
raise ValueError("note not found")
@@ -59,7 +69,11 @@ async def get_note(note_id: str) -> Note:
5969

6070
@app.retrieve
6171
async def list_notes(page: int = 1, page_size: int = 10) -> list[NoteSummary]:
62-
"""Return a paginated list of notes."""
72+
"""Return a paginated list of memory notes that have been made in previous conversations
73+
that have details and memories about the user. It's typically a good idea to
74+
use this if you think there may have been relevant information or you can
75+
personalize based on the conversation or question using past memory.
76+
"""
6377
return project.list_notes(page, page_size)
6478

6579

0 commit comments

Comments
 (0)