Merge branch 'main' into vb/add-graph-command-docs

This commit is contained in:
vbarda
2024-12-04 18:37:20 -05:00
18 changed files with 553 additions and 192 deletions
+4 -1
View File
@@ -276,9 +276,11 @@ The attributes it has are:
Beyond simple retrieval, the store also supports semantic search, allowing you to find memories based on meaning rather than exact matches. To enable this, configure the store with an embedding model:
```python
from langchain.embeddings import init_embeddings
store = InMemoryStore(
index={
"embed": "openai:text-embedding-3-small", # Embedding provider
"embed": init_embeddings("openai:text-embedding-3-small"), # Embedding provider
"dims": 1536, # Embedding dimensions
"fields": ["food_preference", "$"] # Fields to embed
}
@@ -289,6 +291,7 @@ Now when searching, you can use natural language queries to find relevant memori
```python
# Find memories about food preferences
# (This can be done after putting memories into the store)
memories = store.search(
namespace_for_memory,
query="What does the user like to eat?",
@@ -297,7 +297,6 @@
}
],
"source": [
"embeddings = init_embeddings(\"openai:text-embedding-3-small\")\n",
"store = InMemoryStore(\n",
" index={\n",
" \"embed\": embeddings,\n",