From d47cb8d28418c69a6981bea7e66e501aa1a64322 Mon Sep 17 00:00:00 2001 From: Dev Khant Date: Thu, 19 Jun 2025 13:51:20 +0530 Subject: [PATCH] Doc: Fix example in quickstart page (#2986) --- docs/quickstart.mdx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx index 4ebca6c8..3f3d99fb 100644 --- a/docs/quickstart.mdx +++ b/docs/quickstart.mdx @@ -333,11 +333,23 @@ const memory = new Memory(); ```python Code # For a user -result = m.add("I like to drink coffee in the morning and go for a walk.", user_id="alice", metadata={"category": "preferences"}) +messages = [ + { + "role": "user", + "content": "I like to drink coffee in the morning and go for a walk" + } +] +result = m.add(messages, user_id="alice", metadata={"category": "preferences"}) ``` ```typescript TypeScript -const result = memory.add("I like to drink coffee in the morning and go for a walk.", { userId: "alice", metadata: { category: "preferences" } }); +const messages = [ + { + role: "user", + content: "I like to drink coffee in the morning and go for a walk" + } +]; +const result = memory.add(messages, { userId: "alice", metadata: { category: "preferences" } }); ``` ```json Output