mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 14:18:52 +00:00
docs: vectorstores, different updates and fixes (#4939)
# docs: vectorstores, different updates and fixes Multiple updates: - added/improved descriptions - fixed header levels - added headers - fixed headers
This commit is contained in:
parent
8f8593aac5
commit
a9bb3147d7
@ -7,11 +7,9 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Annoy\n",
|
"# Annoy\n",
|
||||||
"\n",
|
"\n",
|
||||||
"> \"Annoy (Approximate Nearest Neighbors Oh Yeah) is a C++ library with Python bindings to search for points in space that are close to a given query point. It also creates large read-only file-based data structures that are mmapped into memory so that many processes may share the same data.\"\n",
|
"> [Annoy](https://github.com/spotify/annoy) (`Approximate Nearest Neighbors Oh Yeah`) is a C++ library with Python bindings to search for points in space that are close to a given query point. It also creates large read-only file-based data structures that are mmapped into memory so that many processes may share the same data.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook shows how to use functionality related to the `Annoy` vector database.\n",
|
"This notebook shows how to use functionality related to the `Annoy` vector database."
|
||||||
"\n",
|
|
||||||
"via [Annoy](https://github.com/spotify/annoy) \n"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -25,6 +23,18 @@
|
|||||||
"```"
|
"```"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "6107872c-09e8-4254-a89c-17e0a0764e82",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"#!pip install annoy"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "6613d222",
|
"id": "6613d222",
|
||||||
@ -35,9 +45,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": null,
|
||||||
"id": "dc7351b5",
|
"id": "dc7351b5",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from langchain.embeddings import HuggingFaceEmbeddings\n",
|
"from langchain.embeddings import HuggingFaceEmbeddings\n",
|
||||||
@ -48,9 +60,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": 4,
|
||||||
"id": "d2cb5f7d",
|
"id": "d2cb5f7d",
|
||||||
"metadata": {},
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"texts = [\"pizza is great\", \"I love salad\", \"my car\", \"a dog\"]\n",
|
"texts = [\"pizza is great\", \"I love salad\", \"my car\", \"a dog\"]\n",
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
"attachments": {},
|
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# AtlasDB\n",
|
"# Atlas\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook shows you how to use functionality related to the `AtlasDB`.\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"[Atlas](https://docs.nomic.ai/index.html) a platform for interacting with both small and internet scale unstructured datasets by Nomic "
|
">[Atlas](https://docs.nomic.ai/index.html) is a platform for interacting with both small and internet scale unstructured datasets by `Nomic`. \n",
|
||||||
|
"\n",
|
||||||
|
"This notebook shows you how to use functionality related to the `AtlasDB` vectorstore."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -582,7 +582,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Creating dataset on AWS S3"
|
"### Creating dataset on AWS S3"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"id": "7ee37d28",
|
"id": "7ee37d28",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Setup\n",
|
"## Setup\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Uncomment the below cells to install docarray and get/set your OpenAI api key if you haven't already done so."
|
"Uncomment the below cells to install docarray and get/set your OpenAI api key if you haven't already done so."
|
||||||
]
|
]
|
||||||
@ -61,7 +61,7 @@
|
|||||||
"tags": []
|
"tags": []
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"# Using DocArrayHnswSearch"
|
"## Using DocArrayHnswSearch"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@
|
|||||||
"id": "ed6f905b-4853-4a44-9730-614aa8e22b78",
|
"id": "ed6f905b-4853-4a44-9730-614aa8e22b78",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Similarity search"
|
"### Similarity search"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -149,7 +149,7 @@
|
|||||||
"id": "3febb987-e903-416f-af26-6897d84c8d61",
|
"id": "3febb987-e903-416f-af26-6897d84c8d61",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Similarity search with score"
|
"### Similarity search with score"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -219,7 +219,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.3"
|
"version": "3.10.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"id": "5031a3ec",
|
"id": "5031a3ec",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Setup\n",
|
"## Setup\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Uncomment the below cells to install docarray and get/set your OpenAI api key if you haven't already done so."
|
"Uncomment the below cells to install docarray and get/set your OpenAI api key if you haven't already done so."
|
||||||
]
|
]
|
||||||
@ -53,6 +53,14 @@
|
|||||||
"# os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY"
|
"# os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6e57a389-f637-4b8f-9ab2-759ae7485f78",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Using DocArrayInMemorySearch"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -91,7 +99,7 @@
|
|||||||
"id": "efbb6684-3846-4332-a624-ddd4d75844c1",
|
"id": "efbb6684-3846-4332-a624-ddd4d75844c1",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Similarity search"
|
"### Similarity search"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -138,7 +146,7 @@
|
|||||||
"id": "43896697-f99e-47b6-9117-47a25e9afa9c",
|
"id": "43896697-f99e-47b6-9117-47a25e9afa9c",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Similarity search with score"
|
"### Similarity search with score"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -202,7 +210,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.3"
|
"version": "3.10.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
@ -18,6 +18,14 @@
|
|||||||
"Check [this](https://opensearch.org/docs/latest/search-plugins/knn/index/) for more details."
|
"Check [this](https://opensearch.org/docs/latest/search-plugins/knn/index/) for more details."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "94963977-9dfc-48b7-872a-53f2947f46c6",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Installation"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -80,6 +88,16 @@
|
|||||||
"embeddings = OpenAIEmbeddings()"
|
"embeddings = OpenAIEmbeddings()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "01a9a035",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### similarity_search using Approximate k-NN\n",
|
||||||
|
"\n",
|
||||||
|
"`similarity_search` using `Approximate k-NN` Search with Custom Parameters"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -111,14 +129,6 @@
|
|||||||
"print(docs[0].page_content)"
|
"print(docs[0].page_content)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "01a9a035",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"#### similarity_search using Approximate k-NN Search with Custom Parameters"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -155,7 +165,9 @@
|
|||||||
"id": "0d0cd877",
|
"id": "0d0cd877",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"#### similarity_search using Script Scoring with Custom Parameters"
|
"### similarity_search using Script Scoring\n",
|
||||||
|
"\n",
|
||||||
|
"`similarity_search` using `Script Scoring` with Custom Parameters"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -194,7 +206,9 @@
|
|||||||
"id": "a4af96cc",
|
"id": "a4af96cc",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"#### similarity_search using Painless Scripting with Custom Parameters"
|
"### similarity_search using Painless Scripting\n",
|
||||||
|
"\n",
|
||||||
|
"`similarity_search` using `Painless Scripting` with Custom Parameters"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -233,7 +247,7 @@
|
|||||||
"id": "73264864",
|
"id": "73264864",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"#### Using a preexisting OpenSearch instance\n",
|
"### Using a preexisting OpenSearch instance\n",
|
||||||
"\n",
|
"\n",
|
||||||
"It's also possible to use a preexisting OpenSearch instance with documents that already have vectors present."
|
"It's also possible to use a preexisting OpenSearch instance with documents that already have vectors present."
|
||||||
]
|
]
|
||||||
|
@ -11,6 +11,13 @@
|
|||||||
"This notebook shows how to use functionality related to the [Redis vector database](https://redis.com/solutions/use-cases/vector-database/)."
|
"This notebook shows how to use functionality related to the [Redis vector database](https://redis.com/solutions/use-cases/vector-database/)."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Installing"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -41,6 +48,13 @@
|
|||||||
"os.environ['OPENAI_API_KEY'] = getpass.getpass('OpenAI API Key:')"
|
"os.environ['OPENAI_API_KEY'] = getpass.getpass('OpenAI API Key:')"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Example"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 1,
|
||||||
@ -192,7 +206,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## RedisVectorStoreRetriever\n",
|
"## Redis as Retriever\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Here we go over different options for using the vector store as a retriever.\n",
|
"Here we go over different options for using the vector store as a retriever.\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
@ -6,8 +6,12 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Tair\n",
|
"# Tair\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook shows how to use functionality related to the Tair vector database.\n",
|
">[Tair](https://www.alibabacloud.com/help/en/tair/latest/what-is-tair) is a cloud native in-memory database service developed by `Alibaba Cloud`. \n",
|
||||||
"To run, you should have an [Tair](https://www.alibabacloud.com/help/en/tair/latest/what-is-tair) instance up and running."
|
"It provides rich data models and enterprise-grade capabilities to support your real-time online scenarios while maintaining full compatibility with open source `Redis`. `Tair` also introduces persistent memory-optimized instances that are based on the new non-volatile memory (NVM) storage medium.\n",
|
||||||
|
"\n",
|
||||||
|
"This notebook shows how to use functionality related to the `Tair` vector database.\n",
|
||||||
|
"\n",
|
||||||
|
"To run, you should have a `Tair` instance up and running."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -121,9 +125,9 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.9.1"
|
"version": "3.10.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
"nbformat_minor": 1
|
"nbformat_minor": 4
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user