Skip to content

Commit becd7f9

Browse files
authored
Documentation improvements: Remove duplicate READMEs, consistent titles (#2118)
* Remove duplicate samples * More consistent docs * Add debugging tips * Move formats again * Fix typo with ACA * Update docs/data_ingestion.md
1 parent 58833bd commit becd7f9

20 files changed

+122
-807
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
# ChatGPT-like app with your data using Azure OpenAI and Azure AI Search (Python)
1+
<!--
2+
---
3+
name: RAG chat app with your data (Python)
4+
description: Chat with your domain data using Azure OpenAI and Azure AI Search.
5+
languages:
6+
- python
7+
- typescript
8+
- bicep
9+
- azdeveloper
10+
products:
11+
- azure-openai
12+
- azure-cognitive-search
13+
- azure-app-service
14+
- azure
15+
page_type: sample
16+
urlFragment: azure-search-openai-demo
17+
---
18+
-->
19+
20+
# RAG chat app with Azure OpenAI and Azure AI Search (Python)
21+
22+
This solution creates a ChatGPT-like frontend experience over your own documents using RAG (Retrieval Augmented Generation). It uses Azure OpenAI Service to access GPT models, and Azure AI Search for data indexing and retrieval.
223

324
This solution's backend is written in Python. There are also [**JavaScript**](https://aka.ms/azai/js/code), [**.NET**](https://aka.ms/azai/net/code), and [**Java**](https://aka.ms/azai/java/code) samples based on this one. Learn more about [developing AI apps using Azure AI Services](https://aka.ms/azai).
425

docs/appservice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Debugging the app on App Service
1+
# RAG chat: Debugging the app on App Service
22

33
When you run `azd up` or `azd deploy`, it deploys your application to App Service,
44
and displays the deployed endpoint in the console.

docs/azd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deploying with the Azure Developer CLI
1+
# RAG chat: Deploying with the Azure Developer CLI
22

33
This guide includes advanced topics that are not necessary for a basic deployment. If you are new to the project, please consult the main [README](../README.md#deploying) for steps on deploying the project.
44

docs/azure_app_service.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Deploying on Azure App Service
1+
# RAG chat: Deploying on Azure App Service
22

33
Due to [a limitation](https://github.com/Azure/azure-dev/issues/2736) of the Azure Developer CLI (`azd`), there can be only one host option in the [azure.yaml](../azure.yaml) file.
44
By default, `host: containerapp` is used and `host: appservice` is commented out.
55

6-
To deploy to Azure Container Apps, please follow the following steps:
6+
To deploy to Azure App Service, please follow the following steps:
77

88
1. Comment out `host: containerapp` and uncomment `host: appservice` in the [azure.yaml](../azure.yaml) file.
99

docs/azure_container_apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deploying on Azure Container Apps
1+
# RAG chat: Deploying on Azure Container Apps
22

33
Due to [a limitation](https://github.com/Azure/azure-dev/issues/2736) of the Azure Developer CLI (`azd`), there can be only one host option in the [azure.yaml](../azure.yaml) file.
44
By default, `host: containerapp` is used and `host: appservice` is commented out.

docs/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Customizing the Chat App
1+
# RAG chat: Customizing the chat app
22

33
This guide provides more details for customizing the Chat App.
44

docs/data_ingestion.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# Indexing documents for the Chat App
1+
# RAG chat: Data ingestion
22

3-
This guide provides more details for using the `prepdocs` script to index documents for the Chat App.
3+
The [azure-search-openai-demo](/) project can set up a full RAG chat app on Azure AI Search and OpenAI so that you can chat on custom data, like internal enterprise data or domain-specific knowledge sets. For full instructions on setting up the project, consult the [main README](/README.md), and then return here for detailed instructions on the data ingestion component.
4+
5+
The chat app provides two ways to ingest data: manual indexing and integrated vectorization. This document explains the differences between the two approaches and provides an overview of the manual indexing process.
46

57
- [Supported document formats](#supported-document-formats)
6-
- [Overview of the manual indexing process](#overview-of-the-manual-indexing-process)
8+
- [Manual indexing process](#manual-indexing-process)
79
- [Chunking](#chunking)
810
- [Categorizing data for enhanced search](#enhancing-search-functionality-with-data-categorization)
911
- [Indexing additional documents](#indexing-additional-documents)
1012
- [Removing documents](#removing-documents)
11-
- [Overview of Integrated Vectorization](#overview-of-integrated-vectorization)
13+
- [Integrated Vectorization](#integrated-vectorization)
1214
- [Indexing of additional documents](#indexing-of-additional-documents)
1315
- [Removal of documents](#removal-of-documents)
1416
- [Scheduled indexing](#scheduled-indexing)
17+
- [Debugging tips](#debugging-tips)
1518

1619
## Supported document formats
1720

18-
In order to ingest a document format, we need a tool that can turn it into text. By default, use Azure Document Intelligence (DI in the table below), but we also have local parsers for several formats. The local parsers are not as sophisticated as Azure Document Intelligence, but they can be used to decrease charges.
21+
In order to ingest a document format, we need a tool that can turn it into text. By default, the manual indexing uses Azure Document Intelligence (DI in the table below), but we also have local parsers for several formats. The local parsers are not as sophisticated as Azure Document Intelligence, but they can be used to decrease charges.
1922

2023
| Format | Manual indexing | Integrated Vectorization |
2124
| ------ | ------------------------------------ | ------------------------ |
@@ -29,7 +32,7 @@ In order to ingest a document format, we need a tool that can turn it into text.
2932

3033
The Blob indexer used by the Integrated Vectorization approach also supports a few [additional formats](https://learn.microsoft.com/azure/search/search-howto-indexing-azure-blob-storage#supported-document-formats).
3134

32-
## Overview of the manual indexing process
35+
## Manual indexing process
3336

3437
The [`prepdocs.py`](../app/backend/prepdocs.py) script is responsible for both uploading and indexing documents. The typical usage is to call it using `scripts/prepdocs.sh` (Mac/Linux) or `scripts/prepdocs.ps1` (Windows), as these scripts will set up a Python virtual environment and pass in the required parameters based on the current `azd` environment. You can pass additional arguments directly to the script, for example `scripts/prepdocs.ps1 --removeall`. Whenever `azd up` or `azd provision` is run, the script is called automatically.
3538

@@ -42,12 +45,6 @@ The script uses the following steps to index documents:
4245
3. Split the PDFs into chunks of text.
4346
4. Upload the chunks to Azure AI Search. If using vectors (the default), also compute the embeddings and upload those alongside the text.
4447

45-
### Enhancing search functionality with data categorization
46-
47-
To enhance search functionality, categorize data during the ingestion process with the `--category` argument, for example `scripts/prepdocs.ps1 --category ExampleCategoryName`. This argument specifies the category to which the data belongs, enabling you to filter search results based on these categories.
48-
49-
After running the script with the desired category, ensure these categories are added to the 'Include Category' dropdown list. This can be found in the developer settings of [`Chat.tsx`](../app/frontend/src/pages/chat/Chat.tsx) and [`Ask.tsx`](../app/frontend/src/pages/ask/Ask.tsx). The default option for this dropdown is "All". By including specific categories, you can refine your search results more effectively.
50-
5148
### Chunking
5249

5350
We're often asked why we need to break up the PDFs into chunks when Azure AI Search supports searching large documents.
@@ -56,6 +53,12 @@ Chunking allows us to limit the amount of information we send to OpenAI due to t
5653

5754
If needed, you can modify the chunking algorithm in `scripts/prepdocslib/textsplitter.py`.
5855

56+
### Enhancing search functionality with data categorization
57+
58+
To enhance search functionality, categorize data during the ingestion process with the `--category` argument, for example `scripts/prepdocs.ps1 --category ExampleCategoryName`. This argument specifies the category to which the data belongs, enabling you to filter search results based on these categories.
59+
60+
After running the script with the desired category, ensure these categories are added to the 'Include Category' dropdown list. This can be found in the developer settings of [`Chat.tsx`](../app/frontend/src/pages/chat/Chat.tsx) and [`Ask.tsx`](../app/frontend/src/pages/ask/Ask.tsx). The default option for this dropdown is "All". By including specific categories, you can refine your search results more effectively.
61+
5962
### Indexing additional documents
6063

6164
To upload more PDFs, put them in the data/ folder and run `./scripts/prepdocs.sh` or `./scripts/prepdocs.ps1`.
@@ -70,7 +73,7 @@ To remove all documents, use `scripts/prepdocs.sh --removeall` or `scripts/prepd
7073

7174
You can also remove individual documents by using the `--remove` flag. Open either `scripts/prepdocs.sh` or `scripts/prepdocs.ps1` and replace `/data/*` with `/data/YOUR-DOCUMENT-FILENAME-GOES-HERE.pdf`. Then run `scripts/prepdocs.sh --remove` or `scripts/prepdocs.ps1 --remove`.
7275

73-
## Overview of Integrated Vectorization
76+
## Integrated Vectorization
7477

7578
Azure AI Search includes an [integrated vectorization feature](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-the-public-preview-of-integrated-vectorization-in/ba-p/3960809#:~:text=Integrated%20vectorization%20is%20a%20new%20feature%20of%20Azure,pull-indexers%2C%20and%20vectorization%20of%20text%20queries%20through%20vectorizers), a cloud-based approach to data ingestion. Integrated vectorization takes care of document format cracking, data extraction, chunking, vectorization, and indexing, all with Azure technologies.
7679

@@ -99,3 +102,30 @@ The Azure AI Search indexer will take care of removing those documents from the
99102
### Scheduled indexing
100103

101104
If you would like the indexer to run automatically, you can set it up to [run on a schedule](https://learn.microsoft.com/azure/search/search-howto-schedule-indexers).
105+
106+
## Debugging tips
107+
108+
If you are not sure if a file successfully uploaded, you can query the index from the Azure Portal or from the REST API. Open the index and paste the queries below into the search bar.
109+
110+
To see all the filenames uploaded to the index:
111+
112+
```json
113+
{
114+
"search": "*",
115+
"count": true,
116+
"top": 1,
117+
"facets": ["sourcefile"]
118+
}
119+
```
120+
121+
To search for specific filenames:
122+
123+
```json
124+
{
125+
"search": "*",
126+
"count": true,
127+
"top": 1,
128+
"filter": "sourcefile eq 'employee_handbook.pdf'",
129+
"facets": ["sourcefile"]
130+
}
131+
```

docs/deploy_existing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Deploying with existing Azure resources
2+
# RAG chat: Deploying with existing Azure resources
33

44
If you already have existing Azure resources, or if you want to specify the exact name of new Azure Resource, you can do so by setting `azd` environment values.
55
You should set these values before running `azd up`. Once you've set them, return to the [deployment steps](../README.md#deploying).

docs/deploy_features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Enabling optional features
2+
# RAG chat: Enabling optional features
33

44
This document covers optional features that can be enabled in the deployed Azure resources.
55
You should typically enable these features before running `azd up`. Once you've set them, return to the [deployment steps](../README.md#deploying).

docs/deploy_lowcost.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Deploying with minimal costs
1+
# RAG chat: Deploying with minimal costs
22

33
This AI RAG chat application is designed to be easily deployed using the Azure Developer CLI, which provisions the infrastructure according to the Bicep files in the `infra` folder. Those files describe each of the Azure resources needed, and configures their SKU (pricing tier) and other parameters. Many Azure services offer a free tier, but the infrastructure files in this project do *not* default to the free tier as there are often limitations in that tier.
44

0 commit comments

Comments
 (0)