Find answers from the community

Updated 9 months ago

Retrieval

is it possible to see the vector store retrived context text after

self.embed_model = HuggingFaceEmbedding(model_name="sentence-transformers/all-MiniLM-L12-v2")
self.vector_store = QdrantVectorStore(client=self.document_store, collection_name=self.index)
self.vector_index = VectorStoreIndex.from_vector_store( vector_store=self.vector_store, embed_model=self.embed_model)

self.query_engine = self.vector_index.as_query_engine(similarity_top_k=self.top_k,llm=self.llm)
response = self.query_engine.query(query)
W
o
6 comments
You want to check the retrieved nodes?
yes I want to understand what came back from the vector store and if thats a good match to the LLMs response. its mainly for debugging
print(response.source_nodes)
I did have a look into that but there was just the meta information about the source document but not the exact text snippet, or dit I not see it because im blind? I got glasses and im old so that might be possible πŸ˜‰
Haha, try this

Plain Text
sources = [s.node.get_text() for s in response.source_nodes]
print(sources)
oh thats cool, thank you so much πŸ™‚
Add a reply
Sign up and join the conversation on Discord