The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
Doc: Update examples in LLMs, VectorDBs and Embedding models pages (#2288)
Dev Khant2556c5fe882f
diff --git a/docs/components/embedders/models/azure_openai.mdx b/docs/components/embedders/models/azure_openai.mdxindex 9848562b8..2a6809589 100644--- a/docs/components/embedders/models/azure_openai.mdx+++ b/docs/components/embedders/models/azure_openai.mdx@@ -37,7 +37,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```### Configdiff --git a/docs/components/embedders/models/gemini.mdx b/docs/components/embedders/models/gemini.mdxindex 40e5cad33..077f9ca58 100644--- a/docs/components/embedders/models/gemini.mdx+++ b/docs/components/embedders/models/gemini.mdx@@ -23,7 +23,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```### Configdiff --git a/docs/components/embedders/models/huggingface.mdx b/docs/components/embedders/models/huggingface.mdxindex 4b8d8c7e5..b8b00835e 100644--- a/docs/components/embedders/models/huggingface.mdx+++ b/docs/components/embedders/models/huggingface.mdx@@ -22,7 +22,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```### Configdiff --git a/docs/components/embedders/models/ollama.mdx b/docs/components/embedders/models/ollama.mdxindex 263d82276..d2829a8ee 100644--- a/docs/components/embedders/models/ollama.mdx+++ b/docs/components/embedders/models/ollama.mdx@@ -18,7 +18,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```### Configdiff --git a/docs/components/embedders/models/openai.mdx b/docs/components/embedders/models/openai.mdxindex 47a0e611b..68be78a97 100644--- a/docs/components/embedders/models/openai.mdx+++ b/docs/components/embedders/models/openai.mdx@@ -23,7 +23,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")``````typescript TypeScriptdiff --git a/docs/components/embedders/models/together.mdx b/docs/components/embedders/models/together.mdxindex 160e47464..9f1695c3c 100644--- a/docs/components/embedders/models/together.mdx+++ b/docs/components/embedders/models/together.mdx@@ -25,7 +25,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```### Configdiff --git a/docs/components/embedders/models/vertexai.mdx b/docs/components/embedders/models/vertexai.mdxindex f2a0a896f..88cc08a3e 100644--- a/docs/components/embedders/models/vertexai.mdx+++ b/docs/components/embedders/models/vertexai.mdx@@ -25,7 +25,13 @@ config = {}m = Memory.from_config(config)-m.add("I'm visiting Paris", user_id="john")+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="john")```The embedding types can be one of the following:- SEMANTIC_SIMILARITYdiff --git a/docs/components/llms/models/anthropic.mdx b/docs/components/llms/models/anthropic.mdxindex abfdbbd53..84ed10113 100644--- a/docs/components/llms/models/anthropic.mdx+++ b/docs/components/llms/models/anthropic.mdx@@ -26,7 +26,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})``````typescript TypeScript@@ -45,7 +51,13 @@ const config = {};const memory = new Memory(config);-await memory.add("Likes to play cricket on weekends", { userId: "alice", metadata: { category: "hobbies" } });+const messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });```</CodeGroup>diff --git a/docs/components/llms/models/aws_bedrock.mdx b/docs/components/llms/models/aws_bedrock.mdxindex 7578524a5..bd04d99ba 100644--- a/docs/components/llms/models/aws_bedrock.mdx+++ b/docs/components/llms/models/aws_bedrock.mdx@@ -30,7 +30,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/llms/models/azure_openai.mdx b/docs/components/llms/models/azure_openai.mdxindex ea32b6730..bacb82980 100644--- a/docs/components/llms/models/azure_openai.mdx+++ b/docs/components/llms/models/azure_openai.mdx@@ -36,7 +36,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```We also support the new [OpenAI structured-outputs](https://platform.openai.com/docs/guides/structured-outputs/introduction) model.diff --git a/docs/components/llms/models/deepseek.mdx b/docs/components/llms/models/deepseek.mdxindex 77f226ab7..af1783a1c 100644--- a/docs/components/llms/models/deepseek.mdx+++ b/docs/components/llms/models/deepseek.mdx@@ -26,7 +26,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```You can also configure the API base URL in the config:diff --git a/docs/components/llms/models/gemini.mdx b/docs/components/llms/models/gemini.mdxindex a40c26503..4c166ea42 100644--- a/docs/components/llms/models/gemini.mdx+++ b/docs/components/llms/models/gemini.mdx@@ -25,7 +25,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/google_AI.mdx b/docs/components/llms/models/google_AI.mdxindex b1c22b1e4..4e08ea744 100644--- a/docs/components/llms/models/google_AI.mdx+++ b/docs/components/llms/models/google_AI.mdx@@ -25,7 +25,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/groq.mdx b/docs/components/llms/models/groq.mdxindex 5f9ab8661..d8f0727ce 100644--- a/docs/components/llms/models/groq.mdx+++ b/docs/components/llms/models/groq.mdx@@ -28,7 +28,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})``````typescript TypeScript@@ -47,7 +53,13 @@ const config = {};const memory = new Memory(config);-await memory.add("Likes to play cricket on weekends", { userId: "alice", metadata: { category: "hobbies" } });+const messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });```</CodeGroup>diff --git a/docs/components/llms/models/litellm.mdx b/docs/components/llms/models/litellm.mdxindex 00b5afb06..d66669f86 100644--- a/docs/components/llms/models/litellm.mdx+++ b/docs/components/llms/models/litellm.mdx@@ -20,7 +20,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/mistral_AI.mdx b/docs/components/llms/models/mistral_AI.mdxindex 3cd7449c5..fdecd625a 100644--- a/docs/components/llms/models/mistral_AI.mdx+++ b/docs/components/llms/models/mistral_AI.mdx@@ -25,7 +25,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/ollama.mdx b/docs/components/llms/models/ollama.mdxindex eac73685a..757fd2cc0 100644--- a/docs/components/llms/models/ollama.mdx+++ b/docs/components/llms/models/ollama.mdx@@ -20,7 +20,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/openai.mdx b/docs/components/llms/models/openai.mdxindex c1e075043..337151eb8 100644--- a/docs/components/llms/models/openai.mdx+++ b/docs/components/llms/models/openai.mdx@@ -36,7 +36,13 @@ config = {# }m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})``````typescript TypeScript@@ -55,7 +61,13 @@ const config = {};const memory = new Memory(config);-await memory.add("Likes to play cricket on weekends", { userId: "alice", metadata: { category: "hobbies" } });+const messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });```</CodeGroup>diff --git a/docs/components/llms/models/together.mdx b/docs/components/llms/models/together.mdxindex dd685a29f..63182918e 100644--- a/docs/components/llms/models/together.mdx+++ b/docs/components/llms/models/together.mdx@@ -21,7 +21,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/llms/models/xAI.mdx b/docs/components/llms/models/xAI.mdxindex d7a365f5f..0d2ec1c90 100644--- a/docs/components/llms/models/xAI.mdx+++ b/docs/components/llms/models/xAI.mdx@@ -27,7 +27,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```## Configdiff --git a/docs/components/vectordbs/dbs/azure_ai_search.mdx b/docs/components/vectordbs/dbs/azure_ai_search.mdxindex 5bb2a9526..b109759c5 100644--- a/docs/components/vectordbs/dbs/azure_ai_search.mdx+++ b/docs/components/vectordbs/dbs/azure_ai_search.mdx@@ -22,7 +22,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/chroma.mdx b/docs/components/vectordbs/dbs/chroma.mdxindex a5fd527e5..ed798ebbe 100644--- a/docs/components/vectordbs/dbs/chroma.mdx+++ b/docs/components/vectordbs/dbs/chroma.mdx@@ -19,7 +19,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/elasticsearch.mdx b/docs/components/vectordbs/dbs/elasticsearch.mdxindex fa33a9297..e3f19e5d2 100644--- a/docs/components/vectordbs/dbs/elasticsearch.mdx+++ b/docs/components/vectordbs/dbs/elasticsearch.mdx@@ -29,7 +29,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/milvus.mdx b/docs/components/vectordbs/dbs/milvus.mdxindex 12193f462..4e93ba0ab 100644--- a/docs/components/vectordbs/dbs/milvus.mdx+++ b/docs/components/vectordbs/dbs/milvus.mdx@@ -19,7 +19,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/opensearch.mdx b/docs/components/vectordbs/dbs/opensearch.mdxindex 507d08615..e5d8f7de2 100644--- a/docs/components/vectordbs/dbs/opensearch.mdx+++ b/docs/components/vectordbs/dbs/opensearch.mdx@@ -29,7 +29,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/pgvector.mdx b/docs/components/vectordbs/dbs/pgvector.mdxindex 412271df3..011a3f982 100644--- a/docs/components/vectordbs/dbs/pgvector.mdx+++ b/docs/components/vectordbs/dbs/pgvector.mdx@@ -21,7 +21,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})```### Configdiff --git a/docs/components/vectordbs/dbs/qdrant.mdx b/docs/components/vectordbs/dbs/qdrant.mdxindex 1c6f00763..1fe21c678 100644--- a/docs/components/vectordbs/dbs/qdrant.mdx+++ b/docs/components/vectordbs/dbs/qdrant.mdx@@ -21,7 +21,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})``````typescript TypeScript@@ -40,7 +46,13 @@ const config = {};const memory = new Memory(config);-await memory.add("Likes to play cricket on weekends", { userId: "alice", metadata: { category: "hobbies" } });+const messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });```</CodeGroup>diff --git a/docs/components/vectordbs/dbs/redis.mdx b/docs/components/vectordbs/dbs/redis.mdxindex 039a1aff8..3e1b7cc96 100644--- a/docs/components/vectordbs/dbs/redis.mdx+++ b/docs/components/vectordbs/dbs/redis.mdx@@ -32,7 +32,13 @@ config = {}m = Memory.from_config(config)-m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"})+messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+m.add(messages, user_id="alice", metadata={"category": "movies"})``````typescript TypeScript@@ -52,7 +58,13 @@ const config = {};const memory = new Memory(config);-await memory.add("Likes to play cricket on weekends", { userId: "alice", metadata: { category: "hobbies" } });+const messages = [+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},+ {"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},+ {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."},+ {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}+]+await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });```</CodeGroup>