From a9bb3147d75ee259a0194eb2f97aca623249b04e Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Thu, 18 May 2023 15:35:47 -0700 Subject: [PATCH] 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 --- .../indexes/vectorstores/examples/annoy.ipynb | 30 +++++++++++----- .../indexes/vectorstores/examples/atlas.ipynb | 8 ++--- .../vectorstores/examples/deeplake.ipynb | 2 +- .../vectorstores/examples/docarray_hnsw.ipynb | 10 +++--- .../examples/docarray_in_memory.ipynb | 16 ++++++--- .../vectorstores/examples/opensearch.ipynb | 36 +++++++++++++------ .../indexes/vectorstores/examples/redis.ipynb | 16 ++++++++- .../indexes/vectorstores/examples/tair.ipynb | 12 ++++--- 8 files changed, 92 insertions(+), 38 deletions(-) diff --git a/docs/modules/indexes/vectorstores/examples/annoy.ipynb b/docs/modules/indexes/vectorstores/examples/annoy.ipynb index 0ea7407b..bf71d5bf 100644 --- a/docs/modules/indexes/vectorstores/examples/annoy.ipynb +++ b/docs/modules/indexes/vectorstores/examples/annoy.ipynb @@ -7,11 +7,9 @@ "source": [ "# Annoy\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", - "This notebook shows how to use functionality related to the `Annoy` vector database.\n", - "\n", - "via [Annoy](https://github.com/spotify/annoy) \n" + "This notebook shows how to use functionality related to the `Annoy` vector database." ] }, { @@ -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", "id": "6613d222", @@ -35,9 +45,11 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "dc7351b5", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "from langchain.embeddings import HuggingFaceEmbeddings\n", @@ -48,9 +60,11 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "id": "d2cb5f7d", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "texts = [\"pizza is great\", \"I love salad\", \"my car\", \"a dog\"]\n", diff --git a/docs/modules/indexes/vectorstores/examples/atlas.ipynb b/docs/modules/indexes/vectorstores/examples/atlas.ipynb index 4ea60e8c..ec0c489e 100644 --- a/docs/modules/indexes/vectorstores/examples/atlas.ipynb +++ b/docs/modules/indexes/vectorstores/examples/atlas.ipynb @@ -1,15 +1,15 @@ { "cells": [ { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "# AtlasDB\n", + "# Atlas\n", "\n", - "This notebook shows you how to use functionality related to the `AtlasDB`.\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." ] }, { diff --git a/docs/modules/indexes/vectorstores/examples/deeplake.ipynb b/docs/modules/indexes/vectorstores/examples/deeplake.ipynb index e49965a2..3f51b826 100644 --- a/docs/modules/indexes/vectorstores/examples/deeplake.ipynb +++ b/docs/modules/indexes/vectorstores/examples/deeplake.ipynb @@ -582,7 +582,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Creating dataset on AWS S3" + "### Creating dataset on AWS S3" ] }, { diff --git a/docs/modules/indexes/vectorstores/examples/docarray_hnsw.ipynb b/docs/modules/indexes/vectorstores/examples/docarray_hnsw.ipynb index 01686c6a..94f6b952 100644 --- a/docs/modules/indexes/vectorstores/examples/docarray_hnsw.ipynb +++ b/docs/modules/indexes/vectorstores/examples/docarray_hnsw.ipynb @@ -17,7 +17,7 @@ "id": "7ee37d28", "metadata": {}, "source": [ - "# Setup\n", + "## Setup\n", "\n", "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": [] }, "source": [ - "# Using DocArrayHnswSearch" + "## Using DocArrayHnswSearch" ] }, { @@ -102,7 +102,7 @@ "id": "ed6f905b-4853-4a44-9730-614aa8e22b78", "metadata": {}, "source": [ - "## Similarity search" + "### Similarity search" ] }, { @@ -149,7 +149,7 @@ "id": "3febb987-e903-416f-af26-6897d84c8d61", "metadata": {}, "source": [ - "## Similarity search with score" + "### Similarity search with score" ] }, { @@ -219,7 +219,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/docs/modules/indexes/vectorstores/examples/docarray_in_memory.ipynb b/docs/modules/indexes/vectorstores/examples/docarray_in_memory.ipynb index 8bc6ffdf..306439ea 100644 --- a/docs/modules/indexes/vectorstores/examples/docarray_in_memory.ipynb +++ b/docs/modules/indexes/vectorstores/examples/docarray_in_memory.ipynb @@ -17,7 +17,7 @@ "id": "5031a3ec", "metadata": {}, "source": [ - "# Setup\n", + "## Setup\n", "\n", "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" ] }, + { + "cell_type": "markdown", + "id": "6e57a389-f637-4b8f-9ab2-759ae7485f78", + "metadata": {}, + "source": [ + "## Using DocArrayInMemorySearch" + ] + }, { "cell_type": "code", "execution_count": null, @@ -91,7 +99,7 @@ "id": "efbb6684-3846-4332-a624-ddd4d75844c1", "metadata": {}, "source": [ - "## Similarity search" + "### Similarity search" ] }, { @@ -138,7 +146,7 @@ "id": "43896697-f99e-47b6-9117-47a25e9afa9c", "metadata": {}, "source": [ - "## Similarity search with score" + "### Similarity search with score" ] }, { @@ -202,7 +210,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.10.6" } }, "nbformat": 4, diff --git a/docs/modules/indexes/vectorstores/examples/opensearch.ipynb b/docs/modules/indexes/vectorstores/examples/opensearch.ipynb index 1e55970b..a78fde3f 100644 --- a/docs/modules/indexes/vectorstores/examples/opensearch.ipynb +++ b/docs/modules/indexes/vectorstores/examples/opensearch.ipynb @@ -18,6 +18,14 @@ "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", "execution_count": null, @@ -80,6 +88,16 @@ "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", "execution_count": null, @@ -111,14 +129,6 @@ "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", "execution_count": null, @@ -155,7 +165,9 @@ "id": "0d0cd877", "metadata": {}, "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", "metadata": {}, "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", "metadata": {}, "source": [ - "#### Using a preexisting OpenSearch instance\n", + "### Using a preexisting OpenSearch instance\n", "\n", "It's also possible to use a preexisting OpenSearch instance with documents that already have vectors present." ] diff --git a/docs/modules/indexes/vectorstores/examples/redis.ipynb b/docs/modules/indexes/vectorstores/examples/redis.ipynb index 89d81312..45e6d670 100644 --- a/docs/modules/indexes/vectorstores/examples/redis.ipynb +++ b/docs/modules/indexes/vectorstores/examples/redis.ipynb @@ -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/)." ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Installing" + ] + }, { "cell_type": "code", "execution_count": null, @@ -41,6 +48,13 @@ "os.environ['OPENAI_API_KEY'] = getpass.getpass('OpenAI API Key:')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example" + ] + }, { "cell_type": "code", "execution_count": 1, @@ -192,7 +206,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## RedisVectorStoreRetriever\n", + "## Redis as Retriever\n", "\n", "Here we go over different options for using the vector store as a retriever.\n", "\n", diff --git a/docs/modules/indexes/vectorstores/examples/tair.ipynb b/docs/modules/indexes/vectorstores/examples/tair.ipynb index 75f3610f..26e31837 100644 --- a/docs/modules/indexes/vectorstores/examples/tair.ipynb +++ b/docs/modules/indexes/vectorstores/examples/tair.ipynb @@ -6,8 +6,12 @@ "source": [ "# Tair\n", "\n", - "This notebook shows how to use functionality related to the Tair vector database.\n", - "To run, you should have an [Tair](https://www.alibabacloud.com/help/en/tair/latest/what-is-tair) instance up and running." + ">[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", + "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", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.10.6" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 }