mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 06:14:37 +00:00
docs: Register langchain-singlestore integration (#30841)
I created and published `langchain-singlestoe` integration package that should replace SingleStoreDB community implementation.
This commit is contained in:
parent
096f0e5966
commit
5ffcd01c41
118
docs/docs/integrations/caches/singlestore_semantic_cache.ipynb
Normal file
118
docs/docs/integrations/caches/singlestore_semantic_cache.ipynb
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "e49f1e0d",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# SingleStoreSemanticCache\n",
|
||||||
|
"\n",
|
||||||
|
"This example demonstrates how to get started with the SingleStore semantic cache.\n",
|
||||||
|
"\n",
|
||||||
|
"### Integration Overview\n",
|
||||||
|
"\n",
|
||||||
|
"`SingleStoreSemanticCache` leverages `SingleStoreVectorStore` to cache LLM responses directly in a SingleStore database, enabling efficient semantic retrieval and reuse of results.\n",
|
||||||
|
"\n",
|
||||||
|
"### Integration details\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"| Class | Package | JS support |\n",
|
||||||
|
"| :--- | :--- | :---: |\n",
|
||||||
|
"| SingleStoreSemanticCache | langchain_singlestore | ❌ | "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "0730d6a1-c893-4840-9817-5e5251676d5d",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Installation\n",
|
||||||
|
"\n",
|
||||||
|
"This cache lives in the `langchain-singlestore` package:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "652d6238-1f87-422a-b135-f5abbb8652fc",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%pip install -qU langchain-singlestore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "5c5f2839-4020-424e-9fc9-07777eede442",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Usage"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "51a60dbe-9f2e-4e04-bb62-23968f17164a",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_core.globals import set_llm_cache\n",
|
||||||
|
"from langchain_singlestore import SingleStoreSemanticCache\n",
|
||||||
|
"\n",
|
||||||
|
"set_llm_cache(\n",
|
||||||
|
" SingleStoreSemanticCache(\n",
|
||||||
|
" embedding=YourEmbeddings(),\n",
|
||||||
|
" host=\"root:pass@localhost:3306/db\",\n",
|
||||||
|
" )\n",
|
||||||
|
")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "cddda8ef",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%%time\n",
|
||||||
|
"# The first time, it is not yet in cache, so it should take longer\n",
|
||||||
|
"llm.invoke(\"Tell me a joke\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "c474168f",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%%time\n",
|
||||||
|
"# The second time, while not a direct hit, the question is semantically similar to the original question,\n",
|
||||||
|
"# so it uses the cached result!\n",
|
||||||
|
"llm.invoke(\"Tell me one joke\")"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "langchain-singlestore-BD1RbQ07-py3.11",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.11.11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
187
docs/docs/integrations/document_loaders/singlestore.ipynb
Normal file
187
docs/docs/integrations/document_loaders/singlestore.ipynb
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"---\n",
|
||||||
|
"sidebar_label: SingleStore\n",
|
||||||
|
"---"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# SingleStoreLoader\n",
|
||||||
|
"\n",
|
||||||
|
"The `SingleStoreLoader` allows you to load documents directly from a SingleStore database table. It is part of the `langchain-singlestore` integration package.\n",
|
||||||
|
"\n",
|
||||||
|
"## Overview\n",
|
||||||
|
"\n",
|
||||||
|
"### Integration Details\n",
|
||||||
|
"\n",
|
||||||
|
"| Class | Package | JS Support |\n",
|
||||||
|
"| :--- | :--- | :---: |\n",
|
||||||
|
"| `SingleStoreLoader` | `langchain_singlestore` | ❌ |\n",
|
||||||
|
"\n",
|
||||||
|
"### Features\n",
|
||||||
|
"- Load documents lazily to handle large datasets efficiently.\n",
|
||||||
|
"- Supports native asynchronous operations.\n",
|
||||||
|
"- Easily configurable to work with different database schemas.\n",
|
||||||
|
"\n",
|
||||||
|
"## Setup\n",
|
||||||
|
"\n",
|
||||||
|
"To use the `SingleStoreLoader`, you need to install the `langchain-singlestore` package. Follow the installation instructions below."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Installation\n",
|
||||||
|
"\n",
|
||||||
|
"Install **langchain_singlestore**."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%pip install -qU langchain_singlestore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Initialization\n",
|
||||||
|
"\n",
|
||||||
|
"To initialize `SingleStoreLoader`, you need to provide connection parameters for the SingleStore database and specify the table and fields to load documents from.\n",
|
||||||
|
"\n",
|
||||||
|
"### Required Parameters:\n",
|
||||||
|
"- **host** (`str`): Hostname, IP address, or URL for the database.\n",
|
||||||
|
"- **table_name** (`str`): Name of the table to query. Defaults to `embeddings`.\n",
|
||||||
|
"- **content_field** (`str`): Field containing document content. Defaults to `content`.\n",
|
||||||
|
"- **metadata_field** (`str`): Field containing document metadata. Defaults to `metadata`.\n",
|
||||||
|
"\n",
|
||||||
|
"### Optional Parameters:\n",
|
||||||
|
"- **id_field** (`str`): Field containing document IDs. Defaults to `id`.\n",
|
||||||
|
"\n",
|
||||||
|
"### Connection Pool Parameters:\n",
|
||||||
|
"- **pool_size** (`int`): Number of active connections in the pool. Defaults to `5`.\n",
|
||||||
|
"- **max_overflow** (`int`): Maximum connections beyond `pool_size`. Defaults to `10`.\n",
|
||||||
|
"- **timeout** (`float`): Connection timeout in seconds. Defaults to `30`.\n",
|
||||||
|
"\n",
|
||||||
|
"### Additional Options:\n",
|
||||||
|
"- **pure_python** (`bool`): Enables pure Python mode.\n",
|
||||||
|
"- **local_infile** (`bool`): Allows local file uploads.\n",
|
||||||
|
"- **charset** (`str`): Character set for string values.\n",
|
||||||
|
"- **ssl_key**, **ssl_cert**, **ssl_ca** (`str`): Paths to SSL files.\n",
|
||||||
|
"- **ssl_disabled** (`bool`): Disables SSL.\n",
|
||||||
|
"- **ssl_verify_cert** (`bool`): Verifies server's certificate.\n",
|
||||||
|
"- **ssl_verify_identity** (`bool`): Verifies server's identity.\n",
|
||||||
|
"- **autocommit** (`bool`): Enables autocommits.\n",
|
||||||
|
"- **results_type** (`str`): Structure of query results (e.g., `tuples`, `dicts`)."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_singlestore.document_loaders import SingleStoreLoader\n",
|
||||||
|
"\n",
|
||||||
|
"loader = SingleStoreLoader(\n",
|
||||||
|
" host=\"127.0.0.1:3306/db\",\n",
|
||||||
|
" table_name=\"documents\",\n",
|
||||||
|
" content_field=\"content\",\n",
|
||||||
|
" metadata_field=\"metadata\",\n",
|
||||||
|
" id_field=\"id\",\n",
|
||||||
|
")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Load"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"docs = loader.load()\n",
|
||||||
|
"docs[0]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"print(docs[0].metadata)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Lazy Load"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"page = []\n",
|
||||||
|
"for doc in loader.lazy_load():\n",
|
||||||
|
" page.append(doc)\n",
|
||||||
|
" if len(page) >= 10:\n",
|
||||||
|
" # do some paged operation, e.g.\n",
|
||||||
|
" # index.upsert(page)\n",
|
||||||
|
"\n",
|
||||||
|
" page = []"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## API reference\n",
|
||||||
|
"\n",
|
||||||
|
"For detailed documentation of all SingleStore Document Loader features and configurations head to the github page: [https://github.com/singlestore-labs/langchain-singlestore/](https://github.com/singlestore-labs/langchain-singlestore/)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.11.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 4
|
||||||
|
}
|
@ -2525,7 +2525,17 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"## `SingleStoreDB` semantic cache\n",
|
"## `SingleStoreDB` semantic cache\n",
|
||||||
"\n",
|
"\n",
|
||||||
"You can use [SingleStoreDB](https://python.langchain.com/docs/integrations/vectorstores/singlestoredb/) as a semantic cache to cache prompts and responses."
|
"You can use [SingleStore](https://python.langchain.com/docs/integrations/vectorstores/singlestore/) as a semantic cache to cache prompts and responses."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "596e15e8",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%pip install -qU langchain-singlestore"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2535,11 +2545,11 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from langchain_community.cache import SingleStoreDBSemanticCache\n",
|
|
||||||
"from langchain_openai import OpenAIEmbeddings\n",
|
"from langchain_openai import OpenAIEmbeddings\n",
|
||||||
|
"from langchain_singlestore.cache import SingleStoreSemanticCache\n",
|
||||||
"\n",
|
"\n",
|
||||||
"set_llm_cache(\n",
|
"set_llm_cache(\n",
|
||||||
" SingleStoreDBSemanticCache(\n",
|
" SingleStoreSemanticCache(\n",
|
||||||
" embedding=OpenAIEmbeddings(),\n",
|
" embedding=OpenAIEmbeddings(),\n",
|
||||||
" host=\"root:pass@localhost:3306/db\",\n",
|
" host=\"root:pass@localhost:3306/db\",\n",
|
||||||
" )\n",
|
" )\n",
|
||||||
|
62
docs/docs/integrations/providers/singlestore.ipynb
Normal file
62
docs/docs/integrations/providers/singlestore.ipynb
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# SingleStore Integration\n",
|
||||||
|
"\n",
|
||||||
|
"[SingleStore](https://singlestore.com/) is a high-performance, distributed SQL database designed to excel in both [cloud](https://www.singlestore.com/cloud/) and on-premises environments. It offers a versatile feature set, seamless deployment options, and exceptional performance.\n",
|
||||||
|
"\n",
|
||||||
|
"This integration provides the following components to leverage SingleStore's capabilities:\n",
|
||||||
|
"\n",
|
||||||
|
"- **`SingleStoreLoader`**: Load documents directly from a SingleStore database table.\n",
|
||||||
|
"- **`SingleStoreSemanticCache`**: Use SingleStore as a semantic cache for efficient storage and retrieval of embeddings.\n",
|
||||||
|
"- **`SingleStoreChatMessageHistory`**: Store and retrieve chat message history in SingleStore.\n",
|
||||||
|
"- **`SingleStoreVectorStore`**: Store document embeddings and perform fast vector and full-text searches.\n",
|
||||||
|
"\n",
|
||||||
|
"These components enable efficient document storage, embedding management, and advanced search capabilities, combining full-text and vector-based search for fast and accurate queries."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {
|
||||||
|
"id": "y8ku6X96sebl"
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_singlestore import (\n",
|
||||||
|
" SingleStoreChatMessageHistory,\n",
|
||||||
|
" SingleStoreLoader,\n",
|
||||||
|
" SingleStoreSemanticCache,\n",
|
||||||
|
" SingleStoreVectorStore,\n",
|
||||||
|
")"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"colab": {
|
||||||
|
"provenance": []
|
||||||
|
},
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.10.11"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 1
|
||||||
|
}
|
520
docs/docs/integrations/vectorstores/singlestore.ipynb
Normal file
520
docs/docs/integrations/vectorstores/singlestore.ipynb
Normal file
@ -0,0 +1,520 @@
|
|||||||
|
{
|
||||||
|
"cells": [
|
||||||
|
{
|
||||||
|
"cell_type": "raw",
|
||||||
|
"id": "1957f5cb",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"---\n",
|
||||||
|
"sidebar_label: SingleStore\n",
|
||||||
|
"---"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "ef1f0986",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"# SingleStoreVectorStore\n",
|
||||||
|
"\n",
|
||||||
|
">[SingleStore](https://singlestore.com/) is a robust, high-performance distributed SQL database solution designed to excel in both [cloud](https://www.singlestore.com/cloud/) and on-premises environments. Boasting a versatile feature set, it offers seamless deployment options while delivering unparalleled performance.\n",
|
||||||
|
"\n",
|
||||||
|
"A standout feature of SingleStore is its advanced support for vector storage and operations, making it an ideal choice for applications requiring intricate AI capabilities such as text similarity matching. With built-in vector functions like [dot_product](https://docs.singlestore.com/managed-service/en/reference/sql-reference/vector-functions/dot_product.html) and [euclidean_distance](https://docs.singlestore.com/managed-service/en/reference/sql-reference/vector-functions/euclidean_distance.html), SingleStore empowers developers to implement sophisticated algorithms efficiently.\n",
|
||||||
|
"\n",
|
||||||
|
"For developers keen on leveraging vector data within SingleStore, a comprehensive tutorial is available, guiding them through the intricacies of [working with vector data](https://docs.singlestore.com/managed-service/en/developer-resources/functional-extensions/working-with-vector-data.html). This tutorial delves into the Vector Store within SingleStoreDB, showcasing its ability to facilitate searches based on vector similarity. Leveraging vector indexes, queries can be executed with remarkable speed, enabling swift retrieval of relevant data.\n",
|
||||||
|
"\n",
|
||||||
|
"Moreover, SingleStore's Vector Store seamlessly integrates with [full-text indexing based on Lucene](https://docs.singlestore.com/cloud/developer-resources/functional-extensions/working-with-full-text-search/), enabling powerful text similarity searches. Users can filter search results based on selected fields of document metadata objects, enhancing query precision.\n",
|
||||||
|
"\n",
|
||||||
|
"What sets SingleStore apart is its ability to combine vector and full-text searches in various ways, offering flexibility and versatility. Whether prefiltering by text or vector similarity and selecting the most relevant data, or employing a weighted sum approach to compute a final similarity score, developers have multiple options at their disposal.\n",
|
||||||
|
"\n",
|
||||||
|
"In essence, SingleStore provides a comprehensive solution for managing and querying vector data, offering unparalleled performance and flexibility for AI-driven applications.\n",
|
||||||
|
"\n",
|
||||||
|
"| Class | Package | JS support |\n",
|
||||||
|
"| :--- | :--- | :---: |\n",
|
||||||
|
"| SingleStoreVectorStore | langchain_singlestore | ✅ | "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "36fdc060",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Setup\n",
|
||||||
|
"\n",
|
||||||
|
"To access SingleStore vector stores you'll need to install the `langchain-singlestore` integration package."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "raw",
|
||||||
|
"id": "64e28aa6",
|
||||||
|
"metadata": {
|
||||||
|
"vscode": {
|
||||||
|
"languageId": "raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"source": [
|
||||||
|
"%pip install -qU \"langchain-singlestore\""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "93df377e",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Initialization\n",
|
||||||
|
"\n",
|
||||||
|
"To initialize `SingleStoreVectorStore`, you need an `Embeddings` object and connection parameters for the SingleStore database.\n",
|
||||||
|
"\n",
|
||||||
|
"### Required Parameters:\n",
|
||||||
|
"- **embedding** (`Embeddings`): A text embedding model.\n",
|
||||||
|
"\n",
|
||||||
|
"### Optional Parameters:\n",
|
||||||
|
"- **distance_strategy** (`DistanceStrategy`): Strategy for calculating vector distances. Defaults to `DOT_PRODUCT`. Options:\n",
|
||||||
|
" - `DOT_PRODUCT`: Computes the scalar product of two vectors.\n",
|
||||||
|
" - `EUCLIDEAN_DISTANCE`: Computes the Euclidean distance between two vectors.\n",
|
||||||
|
"\n",
|
||||||
|
"- **table_name** (`str`): Name of the table. Defaults to `embeddings`.\n",
|
||||||
|
"- **content_field** (`str`): Field for storing content. Defaults to `content`.\n",
|
||||||
|
"- **metadata_field** (`str`): Field for storing metadata. Defaults to `metadata`.\n",
|
||||||
|
"- **vector_field** (`str`): Field for storing vectors. Defaults to `vector`.\n",
|
||||||
|
"- **id_field** (`str`): Field for storing IDs. Defaults to `id`.\n",
|
||||||
|
"\n",
|
||||||
|
"- **use_vector_index** (`bool`): Enables vector indexing (requires SingleStore 8.5+). Defaults to `False`.\n",
|
||||||
|
"- **vector_index_name** (`str`): Name of the vector index. Ignored if `use_vector_index` is `False`.\n",
|
||||||
|
"- **vector_index_options** (`dict`): Options for the vector index. Ignored if `use_vector_index` is `False`.\n",
|
||||||
|
"- **vector_size** (`int`): Size of the vector. Required if `use_vector_index` is `True`.\n",
|
||||||
|
"\n",
|
||||||
|
"- **use_full_text_search** (`bool`): Enables full-text indexing on content. Defaults to `False`.\n",
|
||||||
|
"\n",
|
||||||
|
"### Connection Pool Parameters:\n",
|
||||||
|
"- **pool_size** (`int`): Number of active connections in the pool. Defaults to `5`.\n",
|
||||||
|
"- **max_overflow** (`int`): Maximum connections beyond `pool_size`. Defaults to `10`.\n",
|
||||||
|
"- **timeout** (`float`): Connection timeout in seconds. Defaults to `30`.\n",
|
||||||
|
"\n",
|
||||||
|
"### Database Connection Parameters:\n",
|
||||||
|
"- **host** (`str`): Hostname, IP, or URL for the database.\n",
|
||||||
|
"- **user** (`str`): Database username.\n",
|
||||||
|
"- **password** (`str`): Database password.\n",
|
||||||
|
"- **port** (`int`): Database port. Defaults to `3306`.\n",
|
||||||
|
"- **database** (`str`): Database name.\n",
|
||||||
|
"\n",
|
||||||
|
"### Additional Options:\n",
|
||||||
|
"- **pure_python** (`bool`): Enables pure Python mode.\n",
|
||||||
|
"- **local_infile** (`bool`): Allows local file uploads.\n",
|
||||||
|
"- **charset** (`str`): Character set for string values.\n",
|
||||||
|
"- **ssl_key**, **ssl_cert**, **ssl_ca** (`str`): Paths to SSL files.\n",
|
||||||
|
"- **ssl_disabled** (`bool`): Disables SSL.\n",
|
||||||
|
"- **ssl_verify_cert** (`bool`): Verifies server's certificate.\n",
|
||||||
|
"- **ssl_verify_identity** (`bool`): Verifies server's identity.\n",
|
||||||
|
"- **autocommit** (`bool`): Enables autocommits.\n",
|
||||||
|
"- **results_type** (`str`): Structure of query results (e.g., `tuples`, `dicts`)."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "dc37144c-208d-4ab3-9f3a-0407a69fe052",
|
||||||
|
"metadata": {
|
||||||
|
"tags": []
|
||||||
|
},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import os\n",
|
||||||
|
"\n",
|
||||||
|
"from langchain_singlestore.vectorstores import SingleStoreVectorStore\n",
|
||||||
|
"\n",
|
||||||
|
"os.environ[\"SINGLESTOREDB_URL\"] = \"root:pass@localhost:3306/db\"\n",
|
||||||
|
"\n",
|
||||||
|
"vector_store = SingleStoreVectorStore(embeddings=embeddings)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "ac6071d4",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Manage vector store\n",
|
||||||
|
"\n",
|
||||||
|
"The `SingleStoreVectorStore` assumes that a Document's ID is an integer. Below are examples of how to manage the vector store.\n",
|
||||||
|
"\n",
|
||||||
|
"### Add items to vector store\n",
|
||||||
|
"\n",
|
||||||
|
"You can add documents to the vector store as follows:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "26e0c6e6",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%pip install -qU langchain-core"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "17f5efc0",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_core.documents import Document\n",
|
||||||
|
"\n",
|
||||||
|
"docs = [\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"In the parched desert, a sudden rainstorm brought relief,\n",
|
||||||
|
" as the droplets danced upon the thirsty earth, rejuvenating the landscape\n",
|
||||||
|
" with the sweet scent of petrichor.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"rain\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"Amidst the bustling cityscape, the rain fell relentlessly,\n",
|
||||||
|
" creating a symphony of pitter-patter on the pavement, while umbrellas\n",
|
||||||
|
" bloomed like colorful flowers in a sea of gray.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"rain\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"High in the mountains, the rain transformed into a delicate\n",
|
||||||
|
" mist, enveloping the peaks in a mystical veil, where each droplet seemed to\n",
|
||||||
|
" whisper secrets to the ancient rocks below.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"rain\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"Blanketing the countryside in a soft, pristine layer, the\n",
|
||||||
|
" snowfall painted a serene tableau, muffling the world in a tranquil hush\n",
|
||||||
|
" as delicate flakes settled upon the branches of trees like nature's own \n",
|
||||||
|
" lacework.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"snow\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"In the urban landscape, snow descended, transforming\n",
|
||||||
|
" bustling streets into a winter wonderland, where the laughter of\n",
|
||||||
|
" children echoed amidst the flurry of snowballs and the twinkle of\n",
|
||||||
|
" holiday lights.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"snow\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
" Document(\n",
|
||||||
|
" page_content=\"\"\"Atop the rugged peaks, snow fell with an unyielding\n",
|
||||||
|
" intensity, sculpting the landscape into a pristine alpine paradise,\n",
|
||||||
|
" where the frozen crystals shimmered under the moonlight, casting a\n",
|
||||||
|
" spell of enchantment over the wilderness below.\"\"\",\n",
|
||||||
|
" metadata={\"category\": \"snow\"},\n",
|
||||||
|
" ),\n",
|
||||||
|
"]\n",
|
||||||
|
"\n",
|
||||||
|
"\n",
|
||||||
|
"vector_store.add_documents(docs)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "c738c3e0",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Update items in vector store\n",
|
||||||
|
"\n",
|
||||||
|
"To update an existing document in the vector store, use the following code:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "f0aa8b71",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"updated_document = Document(\n",
|
||||||
|
" page_content=\"qux\", metadata={\"source\": \"https://another-example.com\"}\n",
|
||||||
|
")\n",
|
||||||
|
"\n",
|
||||||
|
"vector_store.update_documents(document_id=\"1\", document=updated_document)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "dcf1b905",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Delete items from vector store\n",
|
||||||
|
"\n",
|
||||||
|
"To delete documents from the vector store, use the following code:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "ef61e188",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"vector_store.delete(ids=[\"3\"])"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "c3620501",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Query vector store\n",
|
||||||
|
"\n",
|
||||||
|
"Once your vector store has been created and the relevant documents have been added you will most likely wish to query it during the running of your chain or agent. \n",
|
||||||
|
"\n",
|
||||||
|
"### Query directly\n",
|
||||||
|
"\n",
|
||||||
|
"Performing a simple similarity search can be done as follows:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "aa0a16fa",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"results = vector_store.similarity_search(query=\"trees in the snow\", k=1)\n",
|
||||||
|
"for doc in results:\n",
|
||||||
|
" print(f\"* {doc.page_content} [{doc.metadata}]\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "3ed9d733",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"If you want to execute a similarity search and receive the corresponding scores you can run:\n",
|
||||||
|
"\n",
|
||||||
|
"- TODO: Edit and then run code cell to generate output"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "5efd2eaa",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"results = vector_store.similarity_search_with_score(query=\"trees in the snow\", k=1)\n",
|
||||||
|
"for doc, score in results:\n",
|
||||||
|
" print(f\"* [SIM={score:3f}] {doc.page_content} [{doc.metadata}]\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "fdaae211",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Metadata filtering\n",
|
||||||
|
"SingleStoreDB elevates search capabilities by enabling users to enhance and refine search results through prefiltering based on metadata fields. This functionality empowers developers and data analysts to fine-tune queries, ensuring that search results are precisely tailored to their requirements. By filtering search results using specific metadata attributes, users can narrow down the scope of their queries, focusing only on relevant data subsets. "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "5c9e9989",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"query = \"trees branches\"\n",
|
||||||
|
"docs = vector_store.similarity_search(\n",
|
||||||
|
" query, filter={\"category\": \"snow\"}\n",
|
||||||
|
") # Find documents that correspond to the query and has category \"snow\"\n",
|
||||||
|
"print(docs[0].page_content)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "c14b0bc3",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Vector index\n",
|
||||||
|
"Enhance your search efficiency with SingleStore DB version 8.5 or above by leveraging [ANN vector indexes](https://docs.singlestore.com/cloud/reference/sql-reference/vector-functions/vector-indexing/). By setting `use_vector_index=True` during vector store object creation, you can activate this feature. Additionally, if your vectors differ in dimensionality from the default OpenAI embedding size of 1536, ensure to specify the `vector_size` parameter accordingly. "
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "e1f2a202",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Search strategies\n",
|
||||||
|
"SingleStoreDB presents a diverse range of search strategies, each meticulously crafted to cater to specific use cases and user preferences. The default `VECTOR_ONLY` strategy utilizes vector operations such as `dot_product` or `euclidean_distance` to calculate similarity scores directly between vectors, while `TEXT_ONLY` employs Lucene-based full-text search, particularly advantageous for text-centric applications. For users seeking a balanced approach, `FILTER_BY_TEXT` first refines results based on text similarity before conducting vector comparisons, whereas `FILTER_BY_VECTOR` prioritizes vector similarity, filtering results before assessing text similarity for optimal matches. Notably, both `FILTER_BY_TEXT` and `FILTER_BY_VECTOR` necessitate a full-text index for operation. Additionally, `WEIGHTED_SUM` emerges as a sophisticated strategy, calculating the final similarity score by weighing vector and text similarities, albeit exclusively utilizing dot_product distance calculations and also requiring a full-text index. These versatile strategies empower users to fine-tune searches according to their unique needs, facilitating efficient and precise data retrieval and analysis. Moreover, SingleStoreDB's hybrid approaches, exemplified by `FILTER_BY_TEXT`, `FILTER_BY_VECTOR`, and `WEIGHTED_SUM` strategies, seamlessly blend vector and text-based searches to maximize efficiency and accuracy, ensuring users can fully leverage the platform's capabilities for a wide range of applications."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "15093016",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"from langchain_singlestore.vectorstores import DistanceStrategy\n",
|
||||||
|
"\n",
|
||||||
|
"docsearch = SingleStoreVectorStore.from_documents(\n",
|
||||||
|
" docs,\n",
|
||||||
|
" embeddings,\n",
|
||||||
|
" distance_strategy=DistanceStrategy.DOT_PRODUCT, # Use dot product for similarity search\n",
|
||||||
|
" use_vector_index=True, # Use vector index for faster search\n",
|
||||||
|
" use_full_text_search=True, # Use full text index\n",
|
||||||
|
")\n",
|
||||||
|
"\n",
|
||||||
|
"vectorResults = docsearch.similarity_search(\n",
|
||||||
|
" \"rainstorm in parched desert, rain\",\n",
|
||||||
|
" k=1,\n",
|
||||||
|
" search_strategy=SingleStoreVectorStore.SearchStrategy.VECTOR_ONLY,\n",
|
||||||
|
" filter={\"category\": \"rain\"},\n",
|
||||||
|
")\n",
|
||||||
|
"print(vectorResults[0].page_content)\n",
|
||||||
|
"\n",
|
||||||
|
"textResults = docsearch.similarity_search(\n",
|
||||||
|
" \"rainstorm in parched desert, rain\",\n",
|
||||||
|
" k=1,\n",
|
||||||
|
" search_strategy=SingleStoreVectorStore.SearchStrategy.TEXT_ONLY,\n",
|
||||||
|
")\n",
|
||||||
|
"print(textResults[0].page_content)\n",
|
||||||
|
"\n",
|
||||||
|
"filteredByTextResults = docsearch.similarity_search(\n",
|
||||||
|
" \"rainstorm in parched desert, rain\",\n",
|
||||||
|
" k=1,\n",
|
||||||
|
" search_strategy=SingleStoreVectorStore.SearchStrategy.FILTER_BY_TEXT,\n",
|
||||||
|
" filter_threshold=0.1,\n",
|
||||||
|
")\n",
|
||||||
|
"print(filteredByTextResults[0].page_content)\n",
|
||||||
|
"\n",
|
||||||
|
"filteredByVectorResults = docsearch.similarity_search(\n",
|
||||||
|
" \"rainstorm in parched desert, rain\",\n",
|
||||||
|
" k=1,\n",
|
||||||
|
" search_strategy=SingleStoreVectorStore.SearchStrategy.FILTER_BY_VECTOR,\n",
|
||||||
|
" filter_threshold=0.1,\n",
|
||||||
|
")\n",
|
||||||
|
"print(filteredByVectorResults[0].page_content)\n",
|
||||||
|
"\n",
|
||||||
|
"weightedSumResults = docsearch.similarity_search(\n",
|
||||||
|
" \"rainstorm in parched desert, rain\",\n",
|
||||||
|
" k=1,\n",
|
||||||
|
" search_strategy=SingleStoreVectorStore.SearchStrategy.WEIGHTED_SUM,\n",
|
||||||
|
" text_weight=0.2,\n",
|
||||||
|
" vector_weight=0.8,\n",
|
||||||
|
")\n",
|
||||||
|
"print(weightedSumResults[0].page_content)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "0c235cdc",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"### Query by turning into retriever\n",
|
||||||
|
"\n",
|
||||||
|
"You can also transform the vector store into a retriever for easier usage in your chains. \n"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "f3460093",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"retriever = vector_store.as_retriever(search_kwargs={\"k\": 1})\n",
|
||||||
|
"retriever.invoke(\"trees in the snow\")"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "8bf60ab4",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Multi-modal Example: Leveraging CLIP and OpenClip Embeddings\n",
|
||||||
|
"\n",
|
||||||
|
"In the realm of multi-modal data analysis, the integration of diverse information types like images and text has become increasingly crucial. One powerful tool facilitating such integration is [CLIP](https://openai.com/research/clip), a cutting-edge model capable of embedding both images and text into a shared semantic space. By doing so, CLIP enables the retrieval of relevant content across different modalities through similarity search.\n",
|
||||||
|
"\n",
|
||||||
|
"To illustrate, let's consider an application scenario where we aim to effectively analyze multi-modal data. In this example, we harness the capabilities of [OpenClip multimodal embeddings](/docs/integrations/text_embedding/open_clip), which leverage CLIP's framework. With OpenClip, we can seamlessly embed textual descriptions alongside corresponding images, enabling comprehensive analysis and retrieval tasks. Whether it's identifying visually similar images based on textual queries or finding relevant text passages associated with specific visual content, OpenClip empowers users to explore and extract insights from multi-modal data with remarkable efficiency and accuracy."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "710f6be9",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"%pip install -U langchain openai lanchain-singlestore langchain-experimental"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "e26825f1",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import os\n",
|
||||||
|
"\n",
|
||||||
|
"from langchain_experimental.open_clip import OpenCLIPEmbeddings\n",
|
||||||
|
"from langchain_singlestore.vectorstores import SingleStoreVectorStore\n",
|
||||||
|
"\n",
|
||||||
|
"os.environ[\"SINGLESTOREDB_URL\"] = \"root:pass@localhost:3306/db\"\n",
|
||||||
|
"\n",
|
||||||
|
"TEST_IMAGES_DIR = \"../../modules/images\"\n",
|
||||||
|
"\n",
|
||||||
|
"docsearch = SingleStoreVectorStore(OpenCLIPEmbeddings())\n",
|
||||||
|
"\n",
|
||||||
|
"image_uris = sorted(\n",
|
||||||
|
" [\n",
|
||||||
|
" os.path.join(TEST_IMAGES_DIR, image_name)\n",
|
||||||
|
" for image_name in os.listdir(TEST_IMAGES_DIR)\n",
|
||||||
|
" if image_name.endswith(\".jpg\")\n",
|
||||||
|
" ]\n",
|
||||||
|
")\n",
|
||||||
|
"\n",
|
||||||
|
"# Add images\n",
|
||||||
|
"docsearch.add_images(uris=image_uris)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "c87779e8",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## Usage for retrieval-augmented generation\n",
|
||||||
|
"\n",
|
||||||
|
"For guides on how to use this vector store for retrieval-augmented generation (RAG), see the following sections:\n",
|
||||||
|
"\n",
|
||||||
|
"- [Tutorials](/docs/tutorials/)\n",
|
||||||
|
"- [How-to: Question and answer with RAG](https://python.langchain.com/docs/how_to/#qa-with-rag)\n",
|
||||||
|
"- [Retrieval conceptual docs](https://python.langchain.com/docs/concepts/retrieval)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "6f717924",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"## API reference\n",
|
||||||
|
"\n",
|
||||||
|
"For detailed documentation of all SingleStore Document Loader features and configurations head to the github page: [https://github.com/singlestore-labs/langchain-singlestore/](https://github.com/singlestore-labs/langchain-singlestore/)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"kernelspec": {
|
||||||
|
"display_name": "Python 3 (ipykernel)",
|
||||||
|
"language": "python",
|
||||||
|
"name": "python3"
|
||||||
|
},
|
||||||
|
"language_info": {
|
||||||
|
"codemirror_mode": {
|
||||||
|
"name": "ipython",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"file_extension": ".py",
|
||||||
|
"mimetype": "text/x-python",
|
||||||
|
"name": "python",
|
||||||
|
"nbconvert_exporter": "python",
|
||||||
|
"pygments_lexer": "ipython3",
|
||||||
|
"version": "3.10.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nbformat": 4,
|
||||||
|
"nbformat_minor": 5
|
||||||
|
}
|
@ -606,6 +606,10 @@ packages:
|
|||||||
- name: langchain-ydb
|
- name: langchain-ydb
|
||||||
path: .
|
path: .
|
||||||
repo: ydb-platform/langchain-ydb
|
repo: ydb-platform/langchain-ydb
|
||||||
|
- name: langchain-singlestore
|
||||||
|
name_title: SingleStore
|
||||||
|
path: .
|
||||||
|
repo: singlestore-labs/langchain-singlestore
|
||||||
- name: langchain-galaxia-retriever
|
- name: langchain-galaxia-retriever
|
||||||
provider_page: galaxia
|
provider_page: galaxia
|
||||||
path: .
|
path: .
|
||||||
|
Loading…
Reference in New Issue
Block a user