Loading index from a redis client #10939
Replies: 4 comments 1 reply
-
🤖 Hey @rahulkrprajapati, good to see you back! Hope you're doing well. Yes, the The When you add a new set of nodes, you can reinitialize the new_nodes = [...] # your new nodes
self.base_index.insert_nodes(new_nodes) This will add the new nodes to the index and update the storage context accordingly. Please note that the You can find more details about these methods in the VectorStoreIndex source code. I hope this helps! If you have any more questions, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
@dosu-bot I would need to push in the new nodes to both the doctore and vector_index store that are mentioned in the storage context for AutoMergingRetriever. How do I do it? |
Beta Was this translation helpful? Give feedback.
-
🤖 To add new nodes to both the document store and the VectorStoreIndex in the storage context for the AutoMergingRetriever in your Python class constructor, you can use the Here is an example of how you can use this method: # Assuming `nodes` is your list of nodes and `typesense_store` is an instance of TypesenseVectorStore
typesense_store.add(nodes) This method first creates the documents to be upserted using the The The Please note that the The
This is evident from the def _create_upsert_docs(self, nodes: List[BaseNode]) -> List[dict]:
upsert_docs = []
for node in nodes:
doc = {
"id": node.node_id,
"vec": node.get_embedding(),
f"{self._text_key}": node.get_content(metadata_mode=MetadataMode.NONE),
"ref_doc_id": node.ref_doc_id,
f"{self._metadata_key}": node_to_metadata_dict(
node, remove_text=True, flat_metadata=self.flat_metadata
),
}
upsert_docs.append(doc)
return upsert_docs This method iterates over the You can find more details in the TypesenseVectorStore class in the llama-index-legacy/llama_index/legacy/vector_stores/typesense.py file in the LlamaIndex repository. Sources
|
Beta Was this translation helpful? Give feedback.
-
🤖 It looks like you're trying to modify the vector index store in your code. What specific changes are you looking to make? Are you encountering any issues with the current implementation? I'd be happy to help you with any questions or concerns you have.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
my doc store and storage context are defined as:
inside my class constructor. would it vectorstoreindex load the index from the storage context that is already there and would by retriver and auto merger work?
also everytime I add a new set of nodes how do I need to reinitialize the vector store index ? How do I do it?
Beta Was this translation helpful? Give feedback.
All reactions