You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionapp -->|Generate embeddings for chunks| aoai
48
+
functionapp -->|Generate embeddings for chunks (for external vectorization)| aoai
49
+
functionapp -->|Push chunks into search index (for push model)| acs
50
+
acs -->|Generate embeddings for chunks and search queries (for integrated vectorization)| aoai
49
51
acs -->|Populate search index from documents| storage
50
-
acs -->|Generate chunks and embeddings to index| functionapp
52
+
acs -->|Generate chunks and embeddings to index (for external vectorization)| functionapp
51
53
aoai -->|Find relevant context to build prompt for Azure OpenAI on your data| acs
52
54
```
53
55
54
56
When you deploy the solution, it creates an [Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) service which indexes document content from a blob storage container. (Note that documents are assumed to be in English.)
55
57
56
-
The documents in the index are also chunked into smaller pieces, and vector embeddings are created for these chunks using a Function App based on the [Azure OpenAI Embeddings Generator power skill](https://github.com/Azure-Samples/azure-search-power-skills/tree/main/Vector/EmbeddingGenerator). This allows you to easily try out [vector and hybrid search](https://learn.microsoft.com/azure/search/vector-search-overview). With Azure AI Search on its own, the responses *always* come directly from the source data, rather than being generated by an AI model. You can optionally use [semantic ranking](https://learn.microsoft.com/azure/search/semantic-search-overview) which *does* use AI, not to generate content but to increase the relevancy of the results and provide semantic answers and captions.
58
+
The documents in the index are also chunked into smaller pieces, and vector embeddings are created for these chunks using either [integrated vectorization](https://learn.microsoft.com/azure/search/vector-search-integrated-vectorization), or external vectorization using a Function App. This allows you to easily try out [vector and hybrid search](https://learn.microsoft.com/azure/search/vector-search-overview). With Azure AI Search on its own, the responses *always* come directly from the source data, rather than being generated by an AI model. You can optionally use [semantic ranking](https://learn.microsoft.com/azure/search/semantic-search-overview) which *does* use AI, not to generate content but to increase the relevancy of the results and provide semantic answers and captions.
57
59
58
60
The solution also deploys an [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview) service. It provides an embeddings model to generate the vector representations of the document chunks and search queries, and a GPT model to generate answers to your search queries. If you choose the option to use [Azure OpenAI "on your data"](https://learn.microsoft.com/azure/ai-services/openai/concepts/use-your-data), these AI-generated responses can be grounded in (and even limited to) the information in your Azure AI Search indexes. This option allows you to let Azure OpenAI orchestrate the [Retrieval Augmented Generation (RAG)](https://aka.ms/what-is-rag) pattern. This means your search query will first be used to retrieve the most relevant documents (or preferably *smaller chunks of those documents*) from your private data source. Those search results are then used as context in the prompt that gets sent to the AI model, along with the original search query. This allows the AI model to generate a response based on the most relevant source data, rather than the public data that was used to train the model. Next to letting Azure OpenAI orchestrate the RAG pattern, the web application can also use [Semantic Kernel](https://learn.microsoft.com/semantic-kernel/overview/) to perform that orchestration, using a prompt and other parameters you can control yourself.
59
61
@@ -109,9 +111,9 @@ This can easily be done by setting up the built-in [authentication and authoriza
109
111
110
112
## Configuration
111
113
112
-
The ARM template deploys the services and sets the configuration settings for the Web App and Function App. Most of these shouldn't be changed as they contain connection settings between the various services, but you can change the settings below for the App Service Web App.
114
+
The ARM template deploys the services and sets the configuration settings for the Web App and Function Apps. Most of these shouldn't be changed as they contain connection settings between the various services, but you can change the settings below for the App Service Web App.
113
115
114
-
> Note that the settings of the Function App shouldn't be changed, as the [power skill](https://github.com/Azure-Samples/azure-search-power-skills/tree/main/Vector/EmbeddingGenerator) was tweaked for this project to take any relevant settings from the request sent by the Azure AI Search skillset instead of from configuration (for example, the embedding model and chunk size to use).
116
+
> Note that the settings of the Function Apps shouldn't be changed, as the [power skill](https://github.com/Azure-Samples/azure-search-power-skills/tree/main/Vector/EmbeddingGenerator) was tweaked for this project to take any relevant settings from the request sent by the Azure AI Search skillset instead of from configuration (for example, the embedding model and chunk size to use).
115
117
116
118
| Setting | Purpose | Default value |
117
119
| ------- | ------- | ------------- |
@@ -121,12 +123,14 @@ The ARM template deploys the services and sets the configuration settings for th
121
123
|`OpenAIGptDeployment`| The deployment name of the [Azure OpenAI GPT model](https://learn.microsoft.com/azure/ai-services/openai/concepts/models) to use |`gpt-35-turbo`|
122
124
|`StorageContainerNameBlobDocuments`*| The name of the storage container that contains the documents |`blob-documents`|
123
125
|`StorageContainerNameBlobChunks`*| The name of the storage container that contains the document chunks |`blob-chunks`|
124
-
|`TextEmbedderNumTokens`| The number of tokens per chunk when splitting documents into smaller pieces |`2048`|
125
-
|`TextEmbedderTokenOverlap`| The number of tokens to overlap between consecutive chunks |`0`|
126
-
|`TextEmbedderMinChunkSize`| The minimum number of tokens of a chunk (smaller chunks are excluded) |`10`|
126
+
|`TextChunkerPageLength`| In case of integrated vectorization, the number of characters per page (chunk) when splitting documents into smaller pieces |`2000`|
127
+
|`TextChunkerPageOverlap`| In case of integrated vectorization, the number of characters to overlap between consecutive pages (chunks) |`500`|
128
+
|`TextEmbedderNumTokens`| In case of external vectorization, the number of tokens per chunk when splitting documents into smaller pieces |`2048`|
129
+
|`TextEmbedderTokenOverlap`| In case of external vectorization, the number of tokens to overlap between consecutive chunks |`0`|
130
+
|`TextEmbedderMinChunkSize`| In case of external vectorization, the minimum number of tokens of a chunk (smaller chunks are excluded) |`10`|
127
131
|`SearchIndexNameBlobDocuments`*| The name of the search index that contains the documents |`blob-documents`|
128
132
|`SearchIndexNameBlobChunks`*| The name of the search index that contains the document chunks |`blob-chunks`|
129
-
|`SearchIndexerSkillType`*| The type of chunking and embedding skill to use as part of the documents indexer: `pull` uses a [knowledge store](https://learn.microsoft.com/azure/search/knowledge-store-concept-intro) to store the chunk data in blobs and a separate indexer to pull these into the document chunks index; `push` directly uploads the data from the custom skill into the document chunks index |`pull`|
133
+
|`SearchIndexerSkillType`*| The type of chunking and embedding skill to use as part of the documents indexer: `integrated` uses [integrated vectorization](https://learn.microsoft.com/azure/search/vector-search-integrated-vectorization); `pull` uses a custom skill with a [knowledge store](https://learn.microsoft.com/azure/search/knowledge-store-concept-intro) to store the chunk data in blobs and a separate indexer to pull these into the document chunks index; `push` directly uploads the data from a custom skill into the document chunks index |`integrated`|
130
134
|`SearchIndexerScheduleMinutes`*| The number of minutes between indexer executions in Azure AI Search |`5`|
131
135
|`InitialDocumentUrls`| A space-separated list of URLs for the documents to include by default | A [resiliency](https://azure.microsoft.com/mediahandler/files/resourcefiles/resilience-in-azure-whitepaper/Resiliency-whitepaper.pdf) and [compliance](https://azure.microsoft.com/mediahandler/files/resourcefiles/data-residency-data-sovereignty-and-compliance-in-the-microsoft-cloud/Data_Residency_Data_Sovereignty_Compliance_Microsoft_Cloud.pdf) document |
132
136
|`DefaultSystemRoleInformation`| The default instructions for the AI model | "You are an AI assistant that helps people find information." |
publicboolLimitToDataSource{get;set;}=true;// "Limit responses to your data content"
15
16
publicstring?SystemRoleInformation{get;set;}// Give the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant’s personality, tell it what it should and shouldn’t answer, and tell it how to format responses. There’s no token limit for this section, but it will be included with every API call, so it counts against the overall token limit.
0 commit comments