----------------------
To create the sentence index in one instance and the retriever in another, you would need to save the sentence index after creation and then load it in the instance where you want to create the retriever.
However, based on the provided knowledge sources, there isn't a direct example of saving and loading a sentence index in LlamaIndex. But, there are examples of creating a
VectorStoreIndex
from various sources, which might be similar to what you're trying to achieve.
Here's how you can create a
VectorStoreIndex
from documents with sentence splitting transformation:
from llama_index.core import VectorStoreIndex
from llama_index.core.node_parser import SentenceSplitter
splitter = SentenceSplitter(chunk_size=256)
index = VectorStoreIndex.from_documents(documents, transformations=[splitter])
Source:
Reciprocal Rerank Fusion Retriever Setup ()
And here's how you can create a
VectorStoreIndex
from an existing vector store:
vector_store = PineconeVectorStore(pinecone.Index("quickstart"))
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)
Source:
Vector Store Index usage examples ()
You might be able to adapt these examples to your use case. However, for the exact method of saving and loading a sentence index, you might need to refer to the LlamaIndex documentation or source code, as it's not covered in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------