Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

docs: fix mangled Python formatting in pgvector & Neon vector store guides (#5853)

Kartika87c9ce36728
diff --git a/docs/components/vectordbs/dbs/neon.mdx b/docs/components/vectordbs/dbs/neon.mdx
index 257b1eb5d..c925218fb 100644
--- a/docs/components/vectordbs/dbs/neon.mdx
+++ b/docs/components/vectordbs/dbs/neon.mdx
@@ -21,34 +21,33 @@ from mem0 import Memory
load_dotenv()
config = {
-"vector_store": {
-"provider": "pgvector",
-"config": {
-"connection_string": os.environ["DATABASE_URL"],
-"collection_name": "memories",
-"embedding_model_dims": 1536,
-"hnsw": True,
-},
-},
+ "vector_store": {
+ "provider": "pgvector",
+ "config": {
+ "connection_string": os.environ["DATABASE_URL"],
+ "collection_name": "memories",
+ "embedding_model_dims": 1536,
+ "hnsw": True,
+ },
+ },
}
m = Memory.from_config(config)
messages = [
-{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
-{"role": "assistant", "content": "How about 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."},
+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
+ {"role": "assistant", "content": "How about 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"})
results = m.search(
-"What movies should I recommend?",
-filters={"user_id": "alice"},
+ "What movies should I recommend?",
+ filters={"user_id": "alice"},
)
print(results)
-
-````
+```
```typescript TypeScript
import "dotenv/config";
@@ -87,7 +86,7 @@ const results = await m.search("What movies should I recommend?", {
});
console.log(results);
-````
+```
</CodeGroup>
diff --git a/docs/components/vectordbs/dbs/pgvector.mdx b/docs/components/vectordbs/dbs/pgvector.mdx
index 302f31200..f322a0a95 100644
--- a/docs/components/vectordbs/dbs/pgvector.mdx
+++ b/docs/components/vectordbs/dbs/pgvector.mdx
@@ -15,27 +15,27 @@ from mem0 import Memory
os.environ["OPENAI_API_KEY"] = "sk-xx"
config = {
-"vector_store": {
-"provider": "pgvector",
-"config": {
-"user": "test",
-"password": "123",
-"host": "127.0.0.1",
-"port": "5432",
-},
-}
+ "vector_store": {
+ "provider": "pgvector",
+ "config": {
+ "user": "test",
+ "password": "123",
+ "host": "127.0.0.1",
+ "port": "5432",
+ },
+ }
}
m = Memory.from_config(config)
messages = [
-{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
-{"role": "assistant", "content": "How about 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."},
+ {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
+ {"role": "assistant", "content": "How about 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
import { Memory } from "mem0ai/oss";
@@ -62,7 +62,7 @@ const messages = [
];
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
-````
+```
</CodeGroup>