Azure Cognitive Search provides value add capabilities to users of Azure. In addition to supporting easy document upload and indexing, indexes that are configured with Vector storage could be integrated and consumed via a VectorStore implementation in Spring AI.

Expected Behavior

Azure Cognitive Search supports a Java search API for uploading, deleting, and searching documents using vector based queries and storage. This API could be wrapped in a Spring AI Vector Store implementation giving Spring AI and Azure users the ability to integrate their existing Cognitive Search indexes with Spring AI.

Conceptually, a user would create a SearchClient instance using existing methods and inject the instance along with an EmbeddingClient into a VectorStore implementation. Using bean creation methods and a PropertiesSource class, the VectorStore creation could look like the following

@Bean
public SearchClient searchClient(AzureSearchClientProperties props) {

    return new SearchClientBuilder().endpoint(props.getEndpoint())
        .credential(new AzureKeyCredential(props.getApiKey()))
        .indexName(props.getIndex())
        .buildClient();
}

@Bean
public VectorStore vectorStore(SearchClient searchClient, EmbeddingClient embeddingClient) {
    return new AzureCognitiveSearchVectorStore(searchClient, embeddingClient);
}

Current Behavior

Spring AI currently does not support Azure Cognitive Search as a VectorStore implementation.

Context

An Azure Spring sample project currently exists that implements a Cognitive Search based VectorStore. In addition, the Microsoft AI learning pages also demonstrate sample code that utilizes existing documents already uploaded and indexed into CognitiveSearch. It would be desirable for Spring AI to integrate with Azure Cognitive Search as another VectorStore implementation.