CrestApps.Core Azure AI Search - Prompt Templates
Add Azure AI Search
You are a CrestApps.Core expert. Configure the CrestApps.Core.Azure.AISearch and CrestApps.Core.AI.Azure.AISearch packages through the indexing builder.
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddIndexingServices(indexing => indexing
.AddAzureAISearch(
builder.Configuration.GetSection("CrestApps:AzureAISearch"),
search => search
.AddAIDocuments()
.AddAIDataSources()
.AddAIMemory())
)
);
AddCoreAzureAISearchServices(...) is the lower-level equivalent. It configures AzureAISearchConnectionOptions, IAzureAISearchClientFactory, a SearchIndexClient, and keyed services with provider key AISearchConstants.ProviderName.
Configuration
{
"CrestApps": {
"AzureAISearch": {
"Endpoint": "https://my-search.search.windows.net",
"AuthenticationType": "Default",
"IdentityClientId": "",
"IndexPrefix": ""
}
}
}
AzureAISearchConnectionOptions supports Endpoint, AuthenticationType, ApiKey, IdentityClientId, and IndexPrefix. Use Default or ManagedIdentity in hosted environments; protect an ApiKey outside source control.
What Each AI Option Adds
AddAIDocuments()registers theAIDocumentsprofile source, its index-profile handler, and keyedIVectorSearchService.AddAIDataSources()registers theDataSourceprofile source, data-source RAG services, theAzureAISearchIAIDataSourceSourceHandler, and its index-profile handler.AddAIMemory()registers theAIMemoryprofile source, its index-profile handler, and keyedIMemoryVectorSearchService.
The provider primitives register keyed IDataSourceContentManager, IDataSourceDocumentReader, IODataFilterTranslator, ISearchIndexManager, and ISearchDocumentManager. Resolve them with the Azure AI Search provider key rather than as unkeyed services.
External Sources and Indexing
An AIDataSource whose source type is AzureAISearch reads an externally managed Azure AI Search index. Keep that source configuration separate from the shared backend configuration used to write CrestApps knowledge-base chunks. Notify the synchronization pipeline through IAIDataSourceChangeNotifier when an external source changes.
AddAIDataSources() also composes the shared asynchronous RAG synchronization components, including IAIDataSourceIndexingQueue, IAIDataSourceIndexingService, AIDataSourceCatalogIndexingHandler, AIDataSourceSearchDocumentHandler, AIDataSourceIndexingBackgroundService, AIDataSourceAlignmentBackgroundService, and DataSourceSearchIndexProfileHandler.