Skip to content
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

Add Azure Cognitive Search as a Vector Store #82

Closed
gm2552 opened this issue Nov 6, 2023 · 0 comments
Closed

Add Azure Cognitive Search as a Vector Store #82

gm2552 opened this issue Nov 6, 2023 · 0 comments

Comments

@gm2552
Copy link

gm2552 commented Nov 6, 2023

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.

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

No branches or pull requests

1 participant