# once you get document object from SimpleDirectory, convert them into Node # parse nodes parser = SentenceSplitter() nodes = parser.get_nodes_from_documents(documents) #Then pass these nodes into the `add` method. vector_store.add(nodes)
from llama_index.core.schema import TextNode node1 = TextNode(text="<text_chunk>", id_="<node_id>") node2 = TextNode(text="<text_chunk>", id_="<node_id>") vector_store.add([node1,node2])
embed_model = OpenAIEmbedding() node_texts = [node.text for node in nodes] embeddings = embed_model.get_text_embedding_batch(node_texts) for (node, embedding) in zip(nodes, embeddings): node.embedding = embedding vector_store.add(nodes)