Skip to content

Commit 84bb42e

Browse files
committed
Update README
1 parent 3bbf04f commit 84bb42e

File tree

6 files changed

+48
-9
lines changed

6 files changed

+48
-9
lines changed

adi_function_app/GETTING_STARTED.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Getting Started with Document Intelligence Function App
2+
3+
To get started, perform the following steps:
4+
5+
1. Setup Azure OpenAI in your subscription with **gpt-4o-mini** & an embedding model, an Python Function App, AI Search and a storage account.
6+
2. Clone this repository and deploy the AI Search rag documents indexes from `deploy_ai_search`.
7+
3. Run `uv sync` within the adi_function_app directory to install dependencies.
8+
4. Configure the environment variables of the function app based on the provided sample
9+
5. Package your Azure Function and upload to your Function App
10+
6. Upload a document for indexing or send a direct HTTP request to the Azure Function.

adi_function_app/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ The properties returned from the ADI Custom Skill and Chunking are then used to
4242
- Keyphrase extraction
4343
- Vectorisation
4444

45+
> [!NOTE]
46+
> See `GETTING_STARTED.md` for a step by step guide of how to use the accelerator.
47+
4548
## Sample Output
4649

4750
Using the [Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone](https://arxiv.org/pdf/2404.14219) as an example, the following output can be obtained for page 7:

text_2_sql/GETTING_STARTED.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Getting Started with Agentic Text2SQL Component
2+
3+
To get started, perform the following steps:
4+
5+
1. Setup Azure OpenAI in your subscription with **gpt-4o-mini** & an embedding model, alongside a SQL Server sample database, AI Search and a storage account.
6+
2. Clone this repository and deploy the AI Search text2sql indexes from `deploy_ai_search`.
7+
3. Run `uv sync` within the text_2_sql directory to install dependencies.
8+
4. Configure the .env file based on the provided sample
9+
5. Generate a data dictionary for your target server using the instructions in `data_dictionary`.
10+
6. Upload these data dictionaries to the relevant contains in your storage account. Wait for them to be automatically indexed.
11+
7. Navigate to `autogen` directory to view the AutoGen implementation. Follow the steps in `Iteration 5 - Agentic Vector Based Text2SQL.ipynb` to get started.

text_2_sql/README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This portion of the repo contains code to implement a multi-shot approach to Tex
44

55
The sample provided works with Azure SQL Server, although it has been easily adapted to other SQL sources such as Snowflake.
66

7-
> [!IMPORTANT]
7+
> [!NOTE]
88
>
99
> - Previous versions of this approach have now been moved to `previous_iterations/semantic_kernel`. These will not be updated.
1010
@@ -14,6 +14,9 @@ The following diagram shows a workflow for how the Text2SQL plugin would be inco
1414

1515
![High level workflow for a plugin driven RAG application](../images/Plugin%20Based%20RAG%20Flow.png "High Level Workflow")
1616

17+
> [!NOTE]
18+
> See `GETTING_STARTED.md` for a step by step guide of how to use the accelerator.
19+
1720
## Why Text2SQL instead of indexing the database contents?
1821

1922
Generating SQL queries and executing them to provide context for the RAG application provided several benefits in the use case this was designed for.
@@ -57,6 +60,10 @@ As the query cache is shared between users (no data is stored in the cache), a n
5760

5861
![Vector Based with Query Cache Logical Flow.](./images/Agentic%20Text2SQL%20Query%20Cache.png "Agentic Vector Based with Query Cache Logical Flow")
5962

63+
#### Parallel execution
64+
65+
After the first agent has rewritten and decomposed the user input, we execute each of the individual questions in parallel for the quickest time to generate an answer.
66+
6067
### Caching Strategy
6168

6269
The cache strategy implementation is a simple way to prove that the system works. You can adopt several different strategies for cache population. Below are some of the strategies that could be used:
@@ -68,6 +75,10 @@ The cache strategy implementation is a simple way to prove that the system works
6875

6976
## Sample Output
7077

78+
> [!NOTE]
79+
>
80+
> - Full payloads for input / outputs can be found in `text_2_sql_core/src/text_2_sql_core/payloads/interaction_payloads.py`.
81+
7182
### What is the top performing product by quantity of units sold?
7283

7384
#### SQL Query Generated
@@ -81,14 +92,12 @@ The cache strategy implementation is a simple way to prove that the system works
8192
"answer": "The top-performing product by quantity of units sold is the **Classic Vest, S** from the **Classic Vest** product model, with a total of 87 units sold [1][2].",
8293
"sources": [
8394
{
84-
"title": "Sales Order Detail",
85-
"chunk": "| ProductID | TotalUnitsSold |\n|-----------|----------------|\n| 864 | 87 |\n",
86-
"reference": "SELECT TOP 1 ProductID, SUM(OrderQty) AS TotalUnitsSold FROM SalesLT.SalesOrderDetail GROUP BY ProductID ORDER BY TotalUnitsSold DESC;"
95+
"sql_rows": "| ProductID | TotalUnitsSold |\n|-----------|----------------|\n| 864 | 87 |\n",
96+
"sql_query": "SELECT TOP 1 ProductID, SUM(OrderQty) AS TotalUnitsSold FROM SalesLT.SalesOrderDetail GROUP BY ProductID ORDER BY TotalUnitsSold DESC;"
8797
},
8898
{
89-
"title": "Product and Description",
90-
"chunk": "| Name | ProductModel |\n|----------------|---------------|\n| Classic Vest, S| Classic Vest |\n",
91-
"reference": "SELECT Name, ProductModel FROM SalesLT.vProductAndDescription WHERE ProductID = 864;"
99+
"sql_rows": "| Name | ProductModel |\n|----------------|---------------|\n| Classic Vest, S| Classic Vest |\n",
100+
"sql_query": "SELECT Name, ProductModel FROM SalesLT.vProductAndDescription WHERE ProductID = 864;"
92101
}
93102
]
94103
}
@@ -110,6 +119,10 @@ The top-performing product by quantity of units sold is the **Classic Vest, S**
110119
|----------------|---------------|
111120
| Classic Vest, S| Classic Vest |
112121

122+
## Disambiguation Requests
123+
124+
If the LLM is unable to understand or answer the question asked, it can ask the user follow up questions with a DisambiguationRequest. In cases where multiple columns may be the correct one, or that there user may be referring to several different filter values, the LLM can produce a series of options for the end user to select from.
125+
113126
## Data Dictionary
114127

115128
### entities.json

text_2_sql/autogen/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ The system produces standardized JSON output through the Answer and Sources Agen
163163
"sources": [
164164
{
165165
"sql_query": "The SQL query used",
166-
"sql_rows": ["Array of result rows"],
167-
"markdown_table": "Formatted markdown table of results"
166+
"sql_rows": ["Array of result rows"]
168167
}
169168
]
170169
}

text_2_sql/text_2_sql_core/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Text2SQL Core
2+
3+
This portion of the repository contains the core prompts, code and config used to power the text2sql agentic flow. As much of the code as possible is kept separate from the AutoGen implementation to enable it to be easily rewritten for another framework in the future.

0 commit comments

Comments
 (0)