SemaDB
SemaDB from SemaFind is a no fuss vector similarity database for building AI applications. The hosted
SemaDB Cloud
offers a no fuss developer experience to get started.
The full documentation of the API along with examples and an interactive playground is available on RapidAPI.
This notebook demonstrates usage of the SemaDB Cloud
vector store.
You'll need to install langchain-community
with pip install -qU langchain-community
to use this integration
Load document embeddings​
To run things locally, we are using Sentence Transformers which are commonly used for embedding sentences. You can use any embedding model LangChain offers.
%pip install --upgrade --quiet sentence_transformers
from langchain_huggingface import HuggingFaceEmbeddings
model_name = "sentence-transformers/all-mpnet-base-v2"
embeddings = HuggingFaceEmbeddings(model_name=model_name)
from langchain_community.document_loaders import TextLoader
from langchain_text_splitters import CharacterTextSplitter
loader = TextLoader("../../how_to/state_of_the_union.txt")
documents = loader.load()
text_splitter = CharacterTextSplitter(chunk_size=400, chunk_overlap=0)
docs = text_splitter.split_documents(documents)
print(len(docs))
114