diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c16709cf..74759a54 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,4 +2,4 @@ # Each line is a file pattern followed by one or more owners. # These owners will be the default owners for everything in the repo. -* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @dongbumlee +* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @dongbumlee @Vinay-Microsoft @aniaroramsft diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f9cc3d5f..ae2bd72c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,9 +2,10 @@ # package ecosystems to update and where the package manifests are located. # For more details, refer to the documentation: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + version: 2 updates: - # GitHub Actions dependencies + # GitHub Actions dependencies (grouped) - package-ecosystem: "github-actions" directory: "/" schedule: @@ -12,9 +13,13 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + all-actions: + patterns: + - "*" - # .NET NuGet dependencies for Backend API (Multiple Projects) + # .NET NuGet dependencies (grouped) - package-ecosystem: "nuget" directory: "/App/backend-api/Microsoft.GS.DPS" schedule: @@ -22,7 +27,11 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + nuget-deps: + patterns: + - "*" - package-ecosystem: "nuget" directory: "/App/backend-api/Microsoft.GS.DPS.Host" @@ -31,9 +40,12 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + nuget-deps: + patterns: + - "*" - # .NET NuGet dependencies for Kernel Memory Clients - package-ecosystem: "nuget" directory: "/App/kernel-memory/clients/dotnet/SemanticKernelPlugin" schedule: @@ -41,7 +53,11 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + nuget-deps: + patterns: + - "*" - package-ecosystem: "nuget" directory: "/App/kernel-memory/clients/dotnet/WebClient" @@ -50,9 +66,13 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + nuget-deps: + patterns: + - "*" - # npm dependencies for Frontend App + # npm dependencies for Frontend App (grouped) - package-ecosystem: "npm" directory: "/App/frontend-app" schedule: @@ -60,4 +80,8 @@ updates: commit-message: prefix: "build" target-branch: "dependabotchanges" - open-pull-requests-limit: 100 + open-pull-requests-limit: 10 + groups: + frontend-deps: + patterns: + - "*" \ No newline at end of file diff --git a/.github/workflows/scheduled-Dependabot-PRs-Auto-Merge.yml b/.github/workflows/scheduled-Dependabot-PRs-Auto-Merge.yml new file mode 100644 index 00000000..1cfc0975 --- /dev/null +++ b/.github/workflows/scheduled-Dependabot-PRs-Auto-Merge.yml @@ -0,0 +1,152 @@ +# ------------------------------------------------------------------------------ +# Scheduled Dependabot PRs Auto-Merge Workflow +# +# Purpose: +# - Automatically detect, rebase (if needed), and merge Dependabot PRs targeting +# the `dependabotchanges` branch, supporting different merge strategies. +# +# Features: +# ✅ Filters PRs authored by Dependabot and targets the specific base branch +# ✅ Rebases PRs with conflicts and auto-resolves using "prefer-theirs" strategy +# ✅ Attempts all three merge strategies: merge, squash, rebase (first success wins) +# ✅ Handles errors gracefully, logs clearly +# +# Triggers: +# - Scheduled daily run (midnight UTC) +# - Manual trigger (via GitHub UI) +# +# Required Permissions: +# - contents: write +# - pull-requests: write +# ------------------------------------------------------------------------------ + +name: Scheduled Dependabot PRs Auto-Merge + +on: + schedule: + - cron: '0 0 * * *' # Runs once a day at midnight UTC + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + merge-dependabot: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install GitHub CLI + run: | + sudo apt update + sudo apt install -y gh + - name: Fetch & Filter Dependabot PRs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "🔍 Fetching all Dependabot PRs targeting 'dependabotchanges'..." + > matched_prs.txt + pr_batch=$(gh pr list --state open --json number,title,author,baseRefName,url \ + --jq '.[] | "\(.number)|\(.title)|\(.author.login)|\(.baseRefName)|\(.url)"') + while IFS='|' read -r number title author base url; do + author=$(echo "$author" | xargs) + base=$(echo "$base" | xargs) + if [[ "$author" == "app/dependabot" && "$base" == "dependabotchanges" ]]; then + echo "$url" >> matched_prs.txt + echo "✅ Matched PR #$number - $title" + else + echo "❌ Skipped PR #$number - $title (Author: $author, Base: $base)" + fi + done <<< "$pr_batch" + echo "👉 Matched PRs:" + cat matched_prs.txt || echo "None" + - name: Rebase PR if Conflicts Exist + if: success() + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [[ ! -s matched_prs.txt ]]; then + echo "⚠️ No matching PRs to process." + exit 0 + fi + while IFS= read -r pr_url; do + pr_number=$(basename "$pr_url") + echo "🔁 Checking PR #$pr_number for conflicts..." + mergeable=$(gh pr view "$pr_number" --json mergeable --jq '.mergeable') + if [[ "$mergeable" == "CONFLICTING" ]]; then + echo "⚠️ Merge conflicts detected. Performing manual rebase for PR #$pr_number..." + head_branch=$(gh pr view "$pr_number" --json headRefName --jq '.headRefName') + base_branch=$(gh pr view "$pr_number" --json baseRefName --jq '.baseRefName') + git fetch origin "$base_branch":"$base_branch" + git fetch origin "$head_branch":"$head_branch" + git checkout "$head_branch" + git config user.name "github-actions" + git config user.email "action@github.com" + # Attempt rebase with 'theirs' strategy + if git rebase --strategy=recursive -X theirs "$base_branch"; then + echo "✅ Rebase successful. Pushing..." + git push origin "$head_branch" --force + else + echo "❌ Rebase failed. Aborting..." + git rebase --abort || true + fi + else + echo "✅ PR #$pr_number is mergeable. Skipping rebase." + fi + done < matched_prs.txt + + - name: Auto-Merge PRs using available strategy + if: success() + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [[ ! -s matched_prs.txt ]]; then + echo "⚠️ No matching PRs to process." + exit 0 + fi + while IFS= read -r pr_url; do + pr_number=$(basename "$pr_url") + echo "🔍 Checking mergeability for PR #$pr_number" + attempt=0 + max_attempts=8 + mergeable="" + sleep 5 # Let GitHub calculate mergeable status + while [[ $attempt -lt $max_attempts ]]; do + mergeable=$(gh pr view "$pr_number" --json mergeable --jq '.mergeable' 2>/dev/null || echo "UNKNOWN") + echo "🔁 Attempt $((attempt+1))/$max_attempts: mergeable=$mergeable" + if [[ "$mergeable" == "MERGEABLE" ]]; then + success=0 + for strategy in rebase squash merge; do + echo "🚀 Trying to auto-merge PR #$pr_number using '$strategy' strategy..." + set -x + merge_output=$(gh pr merge --auto --"$strategy" "$pr_url" 2>&1) + merge_status=$? + set +x + echo "$merge_output" + if [[ $merge_status -eq 0 ]]; then + echo "✅ Auto-merge succeeded using '$strategy'." + success=1 + break + else + echo "❌ Auto-merge failed using '$strategy'. Trying next strategy..." + fi + done + if [[ $success -eq 0 ]]; then + echo "❌ All merge strategies failed for PR #$pr_number" + fi + break + elif [[ "$mergeable" == "CONFLICTING" ]]; then + echo "❌ Cannot merge due to conflicts. Skipping PR #$pr_number" + break + else + echo "🕒 Waiting for GitHub to determine mergeable status..." + sleep 15 + fi + ((attempt++)) + done + if [[ "$mergeable" != "MERGEABLE" && "$mergeable" != "CONFLICTING" ]]; then + echo "❌ Mergeability undetermined after $max_attempts attempts. Skipping PR #$pr_number" + fi + done < matched_prs.txt || echo "⚠️ Completed loop with some errors, but continuing gracefully." \ No newline at end of file diff --git a/App/kernel-memory/Directory.Packages.props b/App/kernel-memory/Directory.Packages.props index 78eea99d..e3e39b2b 100644 --- a/App/kernel-memory/Directory.Packages.props +++ b/App/kernel-memory/Directory.Packages.props @@ -5,7 +5,7 @@ - + diff --git a/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs b/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs index a358d6fa..9e84fcc4 100644 --- a/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs +++ b/App/kernel-memory/service/Core/DataFormats/Pdf/PdfMarkdownDecoder.cs @@ -38,7 +38,10 @@ public async Task DecodeAsync(string filename, CancellationToken ca public async Task DecodeAsync(BinaryData data, CancellationToken cancellationToken = default) { - var content = new AnalyzeDocumentContent() { Base64Source = data }; + var analyzeDocumentOptions = new AnalyzeDocumentOptions("prebuilt-layout", data) + { + OutputContentFormat = DocumentContentFormat.Markdown + }; //this invocation should be blocking during process DocumentIntelligenceClientOptions options = new() @@ -49,7 +52,7 @@ public async Task DecodeAsync(BinaryData data, CancellationToken ca this._client = new DocumentIntelligenceClient(new Uri(this._endpoint), new AzureKeyCredential(this._apiKey), options); Operation operation = null; - operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", content, outputContentFormat: ContentFormat.Markdown, cancellationToken: cancellationToken).ConfigureAwait(false); + operation = await this._client.AnalyzeDocumentAsync(WaitUntil.Completed, analyzeDocumentOptions, cancellationToken).ConfigureAwait(false); AnalyzeResult result = operation.Value; diff --git a/Deployment/kubernetes/enable_approuting.psm1 b/Deployment/kubernetes/enable_approuting.psm1 index 1abe83a4..01bd9121 100644 --- a/Deployment/kubernetes/enable_approuting.psm1 +++ b/Deployment/kubernetes/enable_approuting.psm1 @@ -14,8 +14,6 @@ function Enable-AppRouting { # Enable application routing az aks approuting enable --resource-group $ResourceGroupName --name $ClusterName - # Enable HTTP application routing addon - az aks enable-addons --resource-group $ResourceGroupName --name $ClusterName --addons http_application_routing } Export-ModuleMember -Function Enable-AppRouting \ No newline at end of file diff --git a/Deployment/resourcedeployment.ps1 b/Deployment/resourcedeployment.ps1 index eaabae69..9c906047 100644 --- a/Deployment/resourcedeployment.ps1 +++ b/Deployment/resourcedeployment.ps1 @@ -398,17 +398,20 @@ class DeploymentResult { function Check-Docker { try { - # Try to get Docker info to check if Docker daemon is running - $dockerInfo = docker info 2>&1 - if ($dockerInfo -match "ERROR: error during connect") { + # Try to get Docker info to check if Docker daemon is running + $dockerInfo = docker info 2>&1 + if ($LASTEXITCODE -ne 0 -or $dockerInfo -match "error during connect") { return $false - } else { + } + else { return $true } - } catch { + } + catch { Write-Host "An error occurred while checking Docker status." -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor Red - return $false } + return $false + } } # Check if Docker is running before proceeding diff --git a/Images/readme/customerTruth.png b/Images/readme/customerTruth.png deleted file mode 100644 index 20cc799b..00000000 Binary files a/Images/readme/customerTruth.png and /dev/null differ diff --git a/Images/readme/quickDeploy.png b/Images/readme/quickDeploy.png deleted file mode 100644 index 846e0e1f..00000000 Binary files a/Images/readme/quickDeploy.png and /dev/null differ diff --git a/Images/readme/supportingDocuments.png b/Images/readme/supportingDocuments.png deleted file mode 100644 index 0a4d4b3d..00000000 Binary files a/Images/readme/supportingDocuments.png and /dev/null differ diff --git a/Images/readme/userStory.png b/Images/readme/userStory.png deleted file mode 100644 index ba485f54..00000000 Binary files a/Images/readme/userStory.png and /dev/null differ diff --git a/README.md b/README.md index 2ebbabb2..fb94e87e 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,212 @@ -# Document Knowledge Mining Accelerator +# Document knowledge mining solution accelerator -MENU: [**USER STORY**](#user-story) \| [**QUICK DEPLOY**](#quick-deploy) \| [**SUPPORTING DOCUMENTS**](#supporting-documents) \| -[**CUSTOMER TRUTH**](#customer-truth) +Ingest, extract, and classify content from a high volume of assets to gain deeper insights and generate relevant suggestions for quick and easy reasoning. This enables the ability to conduct chat-based insight discovery, analysis, and receive suggested prompt guidance to further explore your data. +
+ +
+ +[**SOLUTION OVERVIEW**](#solution-overview) \| [**QUICK DEPLOY**](#quick-deploy) \| [**BUSINESS USE CASE**](#business-use-case) \| [**SUPPORTING DOCUMENTATION**](#supporting-documentation) -

+


-User story + +

+Solution overview

-### Solution accelerator overview +This solution leverages Azure OpenAI and Azure AI Document Intelligence in a hybrid approach by combining Optical Character Recognition (OCR) and multi-modal Large Language Model (LLM) to extract information from documents to provide insights without pre-training including text documents, handwritten text, charts, graphs, tables, and form fields. + +### Solution architecture +|![image](./docs/images/readme/solution-architecture.png)| +|---| + +### How to customize +If you'd like to customize the solution accelerator, here are some common areas to start: + +[Technical architecture](./docs/TechnicalArchitecture.md) + +[Content and data processing workflow](./docs/DataProcessing.md) + +
-This solution accelerator helps you ingest, extract, and classify content from a high volume of assets to gain deeper insights and generate relevant suggestions for quick and easy reasoning. It allows you to analyze, compare, and summarize content with multi-modal processing of documents, handwritten text, charts, graphs, tables, and form fields. It leverages Azure OpenAI and Azure AI Document Intelligence in a hybrid approach by combining Optical Character Recognition (OCR) and multi-modal Large Language Model (LLM) to extract information from documents to provide insights without pre-training. ### Key features +
Click to learn more about the key features this solution enables -- **Ingest and extract real-world entities:** Process and extract information unique to your ingested data pipeline such as people, products, events, places, or behaviors. Used to populate filters. + - **Ingest and extract real-world entities**
+ Process and extract information unique to your ingested data pipeline such as people, products, events, places, or behaviors. Used to populate filters. + + - **Chat-based insights discovery**
+ Choose to chat with all indexed assets, a single asset, select a set of assets, or chat with a generated list of assets from a based on a user-led keyword search. -- **​Chat-based insights discovery​:** Choose to chat with all indexed assets, a single asset, select a set of assets, or chat with a generated list of assets from a based on a user-led keyword search. + - **Text and document data analysis**
+ Analyze, compare, and synthesize materials into deep insights, making content accessible through natural language prompting. -- **Text and document data analysis:** Analyze, compare, and synthesize materials into deep insights, making content accessible through natural language prompting. + - **Prompt ​suggestion ​guidance**
+ Suggest a next best set of questions based on the prompt inquiry. Include referenced materials to guide deeper avenues of user-led discovery.​ -- **Prompt ​suggestion ​guidance:** Suggest a next best set of questions based on the prompt inquiry. Include referenced materials to guide deeper avenues of user-led discovery. + - **​Multi-modal information processing**
+ Ingest and extract knowledge from multiple content types and various format types. Enhance with scanned images, handwritten forms, and text-based tables.​ -- **​Multi-modal information processing:** Ingest and extract knowledge from multiple content types and various format types. Enhance with scanned images, handwritten forms, and text-based tables.​ +
-

-![image](./Images/readme/screenshot.png) -### Scenario +

+

+Quick deploy +

-In large, enterprise organizations it's difficult and time consuming to analyze large volumes of data. Imagine a mortgage lender working with both residential and commercial clients and she facilitates financing for buyers and sellers by negotiating loan terms, processing mortgage applications, and ensures compliance with federal regulations. +### How to install or deploy +Follow the quick deploy steps on the deployment guide to deploy this solution to your own Azure subscription. -Her challenges include: -- Analyzing large volumes of data in a timely manner, limiting quick decision-making.​ -- Inability to compare and synthesize documents limits the contextual relevance of insights.​ -- Inability to extract information from charts and tables leads to incomplete analysis and poor decision-making. +[Click here to launch the deployment guide](./docs/DeploymentGuide.md) +

-The goal of this solution accelerator is to: -- Automate document ingestion to avoid missing critical terms and ensure accuracy.​ -- Leverage extracted data to make better-informed loan decisions.​ -- Accelerate loan approvals while reducing manual effort. -### Business value -**Automate content processing**
-Process and extract essential details unique to your ingested data pipeline such as people, products, events, places, or behaviors to quickly streamline document review and analysis. +> ⚠️ **Important: Check Azure OpenAI Quota Availability** +
To ensure sufficient quota is available in your subscription, please follow [quota check instructions guide](./docs/DeploymentGuide.md#regional-availability) before you deploy the solution. -**Enhance insight discovery**
-User-led insight discovery is enabled through indexed, single, and multi-asset selection, including user generated asset lists used to contextualize, compare and synthesize materials into deep insights. +
-**Increase user productivity**
-Improve productivity with natural language prompting and next best query suggestion, including reference materials and automated filter generation, to guide deeper avenues of user-lead discovery. +### Prerequisites and costs -**Surface multi-modal insights**
-Data ingested from multiple content types, such as images, handwritten forms, and text-based tables, is extracted and analyzed to surface key insights in conversational context. +To deploy this solution accelerator, ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the necessary permissions to create **resource groups, resources, app registrations, and assign roles at the resource group level**. This should include Contributor role at the subscription level and Role Based Access Control role on the subscription and/or resource group level. Follow the steps in [Azure Account Set Up](./docs/AzureAccountSetUp.md). +*Note: Due to model availability within various data center regions, the following services have been hard-coded to specific regions:* -### Who should use this solution accelerator? +* **Azure Open AI (GPT 4o mini):**
+The solution relies on `GPT-4o mini` and `text-embedding-3-large` models which are all currently available in the 'WestUS3', 'EastUS', 'EastUS2', 'SwedenCentral' region. +Please check the +[model summary table and region availability](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#embeddings) if needed. -Developers should use this solution accelerator in scenarios where they need to extend the capabilities of Azure OpenAI on their data, particularly when dealing with complex data analysis or document processing tasks that go beyond standard use cases. For example, when there is a need to integrate and analyze multiple data modalities (e.g., text, images, structured data) to gain comprehensive insights. +* **Azure AI Document Intelligence (East US):**
+The solution relies on a `2023-10-31-preview` or later that is currently available in `East US` region. +The deployment region for this model is fixed in 'East US' -The accelerator presented here provides several options, for example: -- Data ingestion pipeline -- Entity mapping -- Key phrase and topic analysis -- Semantic search -- Chat with Unstructured (RAG 2.0) -- Image Processing -- Multi-modal processing  -- Natural language text analysis and summarization +Check the [Azure Products by Region](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/?products=all®ions=all) page and select a **region** where the following services are available. +Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage. The majority of the Azure resources used in this infrastructure are on usage-based pricing tiers. However, Azure Container Registry has a fixed cost per registry per day. +Use the [Azure pricing calculator](https://azure.microsoft.com/en-us/pricing/calculator) to calculate the cost of this solution in your subscription. +Review a [sample pricing sheet](https://azure.com/e/94cf771516ec4812b36c5f2e3e6b4121) in the event you want to customize and scale usage. +_Note: This is not meant to outline all costs as selected SKUs, scaled use, customizations, and integrations into your own tenant can affect the total consumption of this sample solution. The sample pricing sheet is meant to give you a starting point to customize the estimate for your specific needs._ -### Solution accelerator architecture -![image](./Images/readme/architecture.png) +
+| Product | Description | Cost | +|---|---|---| +| [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/) | Used for chat exerpeince/RAG in wen app, data processing workflow for extraction and summarization. | [Pricing](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/) | +| [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/) | Processed and extracted document information is added to an Azure AI Search vecortized index. | [Pricing](https://learn.microsoft.com/en-us/azure/search/) | +| [Azure AI Document Intelligence](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/)| Used during data processing workflow where documents have Optical Character Recognition (OCR) applied to extract data. | [Pricing](https://azure.microsoft.com/en-us/pricing/details/ai-document-intelligence/) | +| [Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/)| Private registry where the Document Processor, AI Service, and Web App images are built, stored and managed. | [Pricing](https://azure.microsoft.com/pricing/details/container-registry/) | +| [Azure Kubernetes Service (AKS)](https://learn.microsoft.com/azure/aks/)| The solution is deployed as a managed container app with with high availability, scalability, and region portability. | [Pricing](https://azure.microsoft.com/en-us/pricing/details/kubernetes-service/) | +| [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/)| UI web application for the solution built with React and TypeScript. | [Pricing]() | +| [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/)| Storage of document files that are being proessed. | [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/) | +| [Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/)| Pipeline workflow steps and processing job management. | [Pricing](https://github.com/microsoft/content-processing-solution-accelerator/blob/main) | +| [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/)| Processed document results and chat history storage. | [Pricing](https://azure.microsoft.com/en-us/pricing/details/cosmos-db/autoscale-provisioned/) | -


-Quick deploy + +>⚠️ **Important:** To avoid unnecessary costs, remember to take down your app if it's no longer in use, +either by deleting the resource group in the Portal or running `azd down`. + +

+

+Business use case

-### Prerequisites -To use this solution accelerator, you will need access to an [Azure subscription](https://azure.microsoft.com/free/) with permission to create resource groups and resources. While not required, a prior understanding of Azure OpenAI, Azure AI Search, Azure AI Document Intelligence, Azure App Service, Azure Kubernetes Service, Azure Container Registry, Azure Blob Storage, Azure Queue Storage, and Azure Cosmos DB will be helpful. +|![image](./docs/images/readme/ui.png)| +|---| -For additional training and support, please see: +
-1. [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) -2. [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/) -3. [Azure AI Document Intelligence](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/) -4. [Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/) -5. [Azure Kubernetes Service (AKS)](https://learn.microsoft.com/azure/aks/) -6. [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/) -7. [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/) -8. [Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/) -9. [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/) +In large, enterprise organizations it's difficult and time consuming to analyze large volumes of data. Imagine a mortgage lender working with both residential and commercial clients and she facilitates financing for buyers and sellers by negotiating loan terms, processing mortgage applications, and ensures compliance with federal regulations. -### **How to install/deploy** +Her challenges include: -Follow the quick deploy steps on the [deployment guide](./README.DEPLOYMENT.md) to deploy this solution to your own Azure subscription. +* Analyzing large volumes of data in a timely manner, limiting quick decision-making.​ +* Inability to compare and synthesize documents limits the contextual relevance of insights.​ +* Inability to extract information from charts and tables leads to incomplete analysis and poor decision-making. -
-

-
-Supporting documents -

+The goal of this solution accelerator is to: +* Automate document ingestion to avoid missing critical terms and ensure accuracy.​ +* Leverage extracted data to make better-informed loan decisions.​ +* Accelerate loan approvals while reducing manual effort. -- [Technical Architecture](./App/Technical_Architecture.md) -- [Content Processing Workflow](./App/Data_Processing.md) +⚠️ The sample data used in this repository is synthetic and generated using Azure OpenAI service. The data is intended for use as sample data only. -
-

-
-Customer truth -

-Customer stories coming soon. -
+### Business value +
Click to learn more about what value this solution provides + + - **Automate content processing**
+ Process and extract essential details unique to your ingested data pipeline such as people, products, events, places, or behaviors to quickly streamline document review and analysis. + + - **Enhance insight discovery**
+ User-led insight discovery is enabled through indexed, single, and multi-asset selection, including user generated asset lists used to contextualize, compare and synthesize materials into deep insights. + + - **Increase user productivity**
+ Improve productivity with natural language prompting and next best query suggestion, including reference materials and automated filter generation, to guide deeper avenues of user-lead discovery. + + - **Surface multi-modal insights**
+ Data ingested from multiple content types, such as images, handwritten forms, and text-based tables, is extracted and analyzed to surface key insights in conversational context -

-
-Responsible AI Transparency FAQ + +

+ +

+ +

+Supporting documentation

-Please refer to [Transparency FAQ](./TRANSPARENCY_FAQ.md) for responsible AI transparency details of this solution accelerator. +### Security guidelines + +This template uses Azure Key Vault to store all connections to communicate between resources. + +This template also uses [Managed Identity](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) for local development and deployment. + +To ensure continued best practices in your own repository, we recommend that anyone creating solutions based on our templates ensure that the [Github secret scanning](https://docs.github.com/code-security/secret-scanning/about-secret-scanning) setting is enabled. + +You may want to consider additional security measures, such as: + +* Enabling Microsoft Defender for Cloud to [secure your Azure resources](https://learn.microsoft.com/en-us/azure/defender-for-cloud/). +* Protecting the Azure Container Apps instance with a [firewall](https://learn.microsoft.com/azure/container-apps/waf-app-gateway) and/or [Virtual Network](https://learn.microsoft.com/azure/container-apps/networking?tabs=workload-profiles-env%2Cazure-cli).
-### Document Upload Limit +### Cross references +Check out similar solution accelerators + +| Solution Accelerator | Description | +|---|---| +| [Conversation knowledge mining](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator) | Derive insights from volumes of conversational data using generative AI. It offers key phrase extraction, topic modeling, and interactive chat experiences through an intuitive web interface. | +| [Content processing](https://github.com/microsoft/content-processing-solution-accelerator) | Programmatically extract data and apply schemas to unstructured documents across text-based and multi-modal content using Azure AI Foundry, Azure OpenAI, Azure AI Content Understanding, and Azure Cosmos DB. | +| [Build your own copilot - client advisor](https://github.com/microsoft/build-your-own-copilot-solution-accelerator) | This copilot helps client advisors to save time and prepare relevant discussion topics for scheduled meetings. It provides an overview of daily client meetings with seamless navigation between viewing client profiles and chatting with structured data. | + + +
+ -Please ensure that the document you upload does not exceed a maximum size of 250 MB. +## Provide feedback +Have questions, find a bug, or want to request a feature? [Submit a new issue](https://github.com/microsoft/document-knowledge-mining-solution-accelerator/issues) on this repo and we'll connect. + +
+ +## Responsible AI Transparency FAQ +Please refer to [Transparency FAQ](./TRANSPARENCY_FAQ.md) for responsible AI transparency details of this solution accelerator. + +
## Disclaimers diff --git a/docs/AzureAccountSetUp.md b/docs/AzureAccountSetUp.md new file mode 100644 index 00000000..22ffa836 --- /dev/null +++ b/docs/AzureAccountSetUp.md @@ -0,0 +1,14 @@ +## Azure account setup + +1. Sign up for a [free Azure account](https://azure.microsoft.com/free/) and create an Azure Subscription. +2. Check that you have the necessary permissions: + * Your Azure account must have `Microsoft.Authorization/roleAssignments/write` permissions, such as [Role Based Access Control Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview), [User Access Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#user-access-administrator), or [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner). + * Your Azure account also needs `Microsoft.Resources/deployments/write` permissions on the subscription level. + +You can view the permissions for your account and subscription by following the steps below: +- Navigate to the [Azure Portal](https://portal.azure.com/) and click on `Subscriptions` under 'Navigation' +- Select the subscription you are using for this accelerator from the list. + - If you try to search for your subscription and it does not come up, make sure no filters are selected. +- Select `Access control (IAM)` and you can see the roles that are assigned to your account for this subscription. + - If you want to see more information about the roles, you can go to the `Role assignments` + tab and search by your account name and then click the role you want to view more information about. \ No newline at end of file diff --git a/App/Data_Processing.md b/docs/DataProcessing.md similarity index 91% rename from App/Data_Processing.md rename to docs/DataProcessing.md index 10b7f1af..a7252bff 100644 --- a/App/Data_Processing.md +++ b/docs/DataProcessing.md @@ -1,8 +1,8 @@ -## Content Processing +## Content and Data Processing Workflow Additional details about how content processing is handled in the solution. This includes the workflow steps and how to use your own data in the solution. ### Workflow -![image](../Images/readme_deployment/DocumentProcess.png) +![image](./images/deployment/DocumentProcess.png) 1. Document upload
Documents added to blob storage. Processing is triggered based on file check-in. @@ -34,6 +34,10 @@ You can upload through the user interface files that you would like processed. T 2. Bulk File Processing
You can take buik file processing since the web app saves uploaded files here also. This would be the ideal to upload a large number of document or files that are large in size. + > **Document Upload Limit:**
+ Please ensure that the document you upload does not exceed a maximum size of 250 MB. + + ### Modifying Processing Prompts Prompt based processing is used for context extraction, summarization, and keyword/entity extraction. Modifications to the prompts will change what is extracted for the related workflow step. diff --git a/README.DEPLOYMENT.md b/docs/DeploymentGuide.md similarity index 91% rename from README.DEPLOYMENT.md rename to docs/DeploymentGuide.md index 49c91739..6ede4c62 100644 --- a/README.DEPLOYMENT.md +++ b/docs/DeploymentGuide.md @@ -1,4 +1,4 @@ -# Deployment Guide for Services +# Deployment Guide > This repository presents a solution and reference architecture for the Knowledge Mining solution accelerator. Please note that the **provided code serves as a demonstration and is not an officially supported Microsoft offering**. > @@ -10,8 +10,6 @@ * [Deploy to Azure](#deploy-to-azure) * [Post-Deploy Configuration](#post-deploy-configuration) * [Next Steps](#next-steps) - * [Test APIs](./docs/TestApis.md) - * [Deploy Power Platform Client](./DeployPowerPlatformClient.md) ## Prerequisites @@ -43,7 +41,7 @@ 3. Go to **Settings** and select **Resource Providers**. 4. Check for Microsoft.Compute and click Register if it is not already registered.
- ResourceProvider + ResourceProvider ## Regional Availability @@ -62,7 +60,7 @@ The deployment region for this model is fixed in 'East US' ## Deployment -The automated deployment process is very straightforward and simplified via a single [deployment script](./Deployment/resourcedeployment.ps1) that completes in approximately 10-15 minutes: +The automated deployment process is very straightforward and simplified via a single [deployment script](../Deployment/resourcedeployment.ps1) that completes in approximately 10-15 minutes: ### Automated Deployment Steps: 1. Deploy Azure resources. @@ -92,7 +90,7 @@ powershell.exe -ExecutionPolicy Bypass -File ".\resourcedeployment.ps1" ``` You will be prompted for the following parameters with this Screen : - + 1. **Subscription ID** - copy/paste from Azure portal 1. **Location** - Azure data center where resources will be deployed. @@ -130,7 +128,7 @@ Let's check the message and configure your model's TPM rate higher to get better You can check the Application URL from the final console message. Don't miss this Url information. This is the application's endpoint URL and it should be used for your data importing process. -Success Deployment +Success Deployment ## Next Steps @@ -152,10 +150,10 @@ Don't miss this Url information. This is the application's endpoint URL and it s 1. Browse to the project in Azure AI Foundry, and select **each of the 2 models** within the `Deployments` menu: -Select Model +Select Model 2. Increase the TPM value for **each model** for faster report generation: -Set Token per minute +Set Token per minute ### 2. Data Uploading and Processing After increasing the TPM limit for each model, let's upload and process the sample documents. diff --git a/App/Technical_Architecture.md b/docs/TechnicalArchitecture.md similarity index 98% rename from App/Technical_Architecture.md rename to docs/TechnicalArchitecture.md index dfa6ce7d..bca3ea72 100644 --- a/App/Technical_Architecture.md +++ b/docs/TechnicalArchitecture.md @@ -2,7 +2,7 @@ Additional details about the technical architecture of the Document Knowledge Mining solution accelerator. This describes the purpose and additional context of each component in the solution. -![image](../Images/readme/architecture.png) +![image](./images/readme/solution-architecture.png) ### Ingress Controller diff --git a/Images/readme_deployment/Control_Model_TPM000.png b/docs/images/deployment/Control_Model_TPM000.png similarity index 100% rename from Images/readme_deployment/Control_Model_TPM000.png rename to docs/images/deployment/Control_Model_TPM000.png diff --git a/Images/readme_deployment/Control_Model_TPM001.png b/docs/images/deployment/Control_Model_TPM001.png similarity index 100% rename from Images/readme_deployment/Control_Model_TPM001.png rename to docs/images/deployment/Control_Model_TPM001.png diff --git a/Images/readme_deployment/Deployment_Screen01.png b/docs/images/deployment/Deployment_Screen01.png similarity index 100% rename from Images/readme_deployment/Deployment_Screen01.png rename to docs/images/deployment/Deployment_Screen01.png diff --git a/Images/readme_deployment/Deployment_Screen02.png b/docs/images/deployment/Deployment_Screen02.png similarity index 100% rename from Images/readme_deployment/Deployment_Screen02.png rename to docs/images/deployment/Deployment_Screen02.png diff --git a/Images/readme_deployment/DocumentProcess.png b/docs/images/deployment/DocumentProcess.png similarity index 100% rename from Images/readme_deployment/DocumentProcess.png rename to docs/images/deployment/DocumentProcess.png diff --git a/Images/readme_deployment/Subscription_ResourceProvider.png b/docs/images/deployment/Subscription_ResourceProvider.png similarity index 100% rename from Images/readme_deployment/Subscription_ResourceProvider.png rename to docs/images/deployment/Subscription_ResourceProvider.png diff --git a/docs/images/readme/business-scenario.png b/docs/images/readme/business-scenario.png new file mode 100644 index 00000000..017032cc Binary files /dev/null and b/docs/images/readme/business-scenario.png differ diff --git a/docs/images/readme/quick-deploy.png b/docs/images/readme/quick-deploy.png new file mode 100644 index 00000000..421c0c1f Binary files /dev/null and b/docs/images/readme/quick-deploy.png differ diff --git a/Images/readme/architecture.png b/docs/images/readme/solution-architecture.png similarity index 100% rename from Images/readme/architecture.png rename to docs/images/readme/solution-architecture.png diff --git a/docs/images/readme/solution-overview.png b/docs/images/readme/solution-overview.png new file mode 100644 index 00000000..483dbfcd Binary files /dev/null and b/docs/images/readme/solution-overview.png differ diff --git a/docs/images/readme/supporting-documentation.png b/docs/images/readme/supporting-documentation.png new file mode 100644 index 00000000..b498805c Binary files /dev/null and b/docs/images/readme/supporting-documentation.png differ diff --git a/Images/readme/screenshot.png b/docs/images/readme/ui.png similarity index 100% rename from Images/readme/screenshot.png rename to docs/images/readme/ui.png