Skip to content

Add observability support for the existing Vector Stores #1244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Aug 19, 2024

Related to #1243

 Add observability support to:
 - Cassandra
 - Chroma
 - Elasticsearch
 - Milvus
 - Neo4j
 - OpenSearch
 - Qdrant
 - Redis
 - Typesense
 - Weaviate
 - Pinecone
 - Oracle
 - Gemifire
 - MongoDB
 - HanaDB

 Add autoconfiguration obsrvability for the above vector stores.
 Add integration tests for all vector stores.
@tzolov tzolov force-pushed the align-vector-stores-with-observability-support branch from a9e1036 to 057e26b Compare August 19, 2024 08:57
@tzolov tzolov changed the title [WIP] Add observability support for the existing Vector Stores Add observability support for the existing Vector Stores Aug 19, 2024
@tzolov tzolov marked this pull request as ready for review August 19, 2024 08:57

return VectorStoreObservationContext.builder(VectorStoreProvider.AZURE_VECTOR_STORE.value(), operationName)
.withDimensions(this.embeddingModel.dimensions())
.withSimilarityMetric(this.initializeSchema ? VectorStoreSimilarityMetric.COSINE.value() : "Unknown")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be null instead of "Unknown", so that the observation value will end up being KeyValue.NONE? For other attributes, when we can't infer the value, we fall back to "none".

return VectorStoreObservationContext.builder(VectorStoreProvider.CHROMA_VECTOR_STORE.value(), operationName)
.withDimensions(this.embeddingModel.dimensions())
.withCollectionName(this.collectionName + ":" + this.collectionId)
.withFieldName(this.initializeSchema ? DISTANCE_FIELD_NAME : KeyValue.NONE_VALUE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest keeping KeyValue concepts outside the vector store implementation and instead set it to null, so that we let the conventions handle "null" values (users might provide their implementation of the Conventions and decide to handle "null" values differently than KeyValue.NONE_VALUE ).

@@ -23,6 +23,22 @@ public enum VectorStoreProvider {

// @formatter:off
PG_VECTOR("pg_vector"),
AZURE_VECTOR_STORE("azure_vector_store"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep these names framework-agnostic for better interoperability with LLM observability backends. For example, I would use chroma and elasticsearch instead of chroma_vector_store and elasticsearch_vector_store

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. It also improves the readability.

@tzolov
Copy link
Contributor Author

tzolov commented Aug 19, 2024

Thanks for the suggestions @ThomasVitale
Hopefully last commit address them all.

@ThomasVitale
Copy link
Contributor

@tzolov super! It's so great to get observability instrumentation for all vector stores!

@markpollack
Copy link
Member

merged in 93fa2bf

@markpollack markpollack added this to the 1.0.0-M2 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants