Rockset
Rockset is a real-time search and analytics database built for the cloud. Rockset uses a Converged Index™ with an efficient store for vector embeddings to serve low latency, high concurrency search queries at scale. Rockset has full support for metadata filtering and handles real-time ingestion for constantly updating, streaming data.
This notebook demonstrates how to use Rockset
as a vector store in LangChain. Before getting started, make sure you have access to a Rockset
account and an API key available. Start your free trial today.
You'll need to install langchain-community
with pip install -qU langchain-community
to use this integration
Setting Up Your Environment​
-
Leverage the
Rockset
console to create a collection with the Write API as your source. In this walkthrough, we create a collection namedÂlangchain_demo
.Configure the following ingest transformation to mark your embeddings field and take advantage of performance and storage optimizations:
(We used OpenAI
text-embedding-ada-002
for this examples, where #length_of_vector_embedding = 1536)
SELECT _input.* EXCEPT(_meta),
VECTOR_ENFORCE(_input.description_embedding, #length_of_vector_embedding, 'float') as description_embedding
FROM _input
-
After creating your collection, use the console to retrieve an API key. For the purpose of this notebook, we assume you are using theÂ
Oregon(us-west-2)
region. -
Install the rockset-python-client to enable LangChain to communicate directly with
Rockset
.
%pip install --upgrade --quiet rockset
LangChain Tutorial​
Follow along in your own Python notebook to generate and store vector embeddings in Rockset. Start using Rockset to search for documents similar to your search queries.