I'm using Langchain to load a document, split it into chunks, embed those chunks, embed them and then store the embedding vectors into a langchain VectorStore database. My use case requires me to run an algorithm on the embedding vectors, which i have been trying to find a way to fetch but to no avail.
My idea is to be able to do something like this:
from langchain.text_splitter import CharacterTextSplitterfrom langchain_community.document_loaders import TextLoaderfrom langchain_community.vectorstores import SomeVectorStorefrom langchain_openai import OpenAIEmbeddingsloader = TextLoader("../document.txt")documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)embeddings = OpenAIEmbeddings()db = SomeVectoreStore.from_documents(docs, embeddings)# get all the embeddings and their corresponding chunks from the dbembeddings_and_thei_chunks = db.some_way_to_get_all_embeddings()