retriever for vector store search #10994
Replies: 2 comments
-
|
Hi @mubashir1osmani! I'm Dosu and I’m helping the phoenix team. Yes, retriever spans in Phoenix are supposed to show the sources (documents) fetched from your vector store, including their metadata and content. If your retriever span is empty, it usually means the span isn't being properly instrumented or the attributes for the retrieved documents aren't being set as expected. Phoenix expects retriever spans to have attributes like For manual instrumentation, you should wrap your vector store search in a span like this: with tracer.start_as_current_span("vector_store_search", openinference_span_kind="RETRIEVER") as span:
docs = vector_store.search(query, limit=5)
for i, doc in enumerate(docs):
span.set_attribute(f"retrieval.documents.{i}.document.id", doc.id)
span.set_attribute(f"retrieval.documents.{i}.document.content", doc.content)
span.set_attribute(f"retrieval.documents.{i}.document.metadata", json.dumps(doc.metadata))If you're using LangChain or LlamaIndex and still seeing empty retriever spans, check that you're on a compatible version (there are known issues with some recent versions, e.g., If you see sources in your metadata but not in the retriever span, double-check that your retriever span is actually being created and that the attributes are being set as described above. Also, make sure your export configuration isn't dropping spans before they reach Phoenix [source]. Let me know if you want help with a specific code snippet or setup! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
We have created an issue in the OpenInference repo to track this issue |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hi, just wondering how retriever span kind works in phoenix, im using a vector store to fetch from sources which i can see in my metadata but the retriever span is completely empty
isnt it supposed to show me sources used from the vector store?
Beta Was this translation helpful? Give feedback.
All reactions