Document Summary Widget

Overview

The Document Summary Widget is a powerful tool designed to display a concise summary of a document within the chat interface. It enables seamless document upload, processing, and summarization, making it ideal for AI-driven workflows that involve document-based insights.

Key Components:

Document Dropbox – Allows users to upload multiple documents, automatically adding them to the ongoing conversation. ✅ Document Summary Section – Displays a structured summary, including:

  • Title: Defaults to Quick Summary, but can be customized using the documentType key.

  • Summary (Description): A concise, AI-generated summary of the document’s key insights.

🔹 Example Use-Case: A loan processing AI extracts and summarizes key details from financial statements, allowing loan officers to quickly assess an applicant’s financial standing.

Configurations

Widget Setup

The Document Summary Widget must be configured at the agent level within the Widgets Tab of the Agent Configuration.

Workflow Integration

To function correctly, the widget requires a configured workflow that processes the document summary.

1️⃣ Workflow Setup: A workflow must be created to generate the document summary. 2️⃣ Triggering the Summary: The "Refresh Document Summary" event must be emitted using the Emit Event Node. 3️⃣ Event Payload Format:

{
  "documentId": "<document-id>"
}

4️⃣ Workflow Output Format:

  • If the documentType key is provided, the title is formatted as "Quick Summary - [DocumentType]".

  • If the documentType key is not provided, the title defaults to "Quick Summary".

How It Works:

📌 Step 1: A user uploads a document via the Document Dropbox. 📌 Step 2: The Emit Event Node triggers the "Refresh Document Summary" event. 📌 Step 3: The workflow retrieves the document, processes it, and returns the summary. 📌 Step 4: The widget displays the summary in the chat interface.

🔹 Example Scenario: A legal AI assistant extracts key clauses from a contract and presents them as a structured summary in the widget.

Applications of the Widget

The Document Summary Widget plays a crucial role in automating document summarization and data extraction within AI-driven workflows. Below are its key applications based on its functionality.

1️⃣ Document Summarization

✔ Provides concise summaries of uploaded documents, allowing users to quickly grasp key insights. ✔ Ensures that document information is readily available within the ongoing conversation.

🔹 Example: A financial analyst AI summarizes balance sheets, highlighting key financial metrics like revenue, liabilities, and net profit.


2️⃣ Efficient Document Upload

✔ Supports multiple document uploads through the Document Dropbox. ✔ Automatically adds uploaded documents to the conversation for further processing.

🔹 Example: A loan processing system enables users to upload KYC documents, which are then automatically linked to their application for verification.


3️⃣ Customizable Summary Generation

✔ The summary is generated using a workflow, allowing for custom logic based on business requirements. ✔ Developers can fetch summaries via an API call, extract key insights using LLMs, or retrieve structured data from an agent-specific table.

🔹 Example: A legal AI assistant extracts and summarizes key clauses from uploaded contracts, making it easier for users to review critical terms.


4️⃣ Event-Driven Data Processing

✔ The "Refresh Document Summary" event ensures the summary widget updates dynamically when a document is uploaded. ✔ Workflows can customize the summary generation logic, allowing for structured data processing.

🔹 Example: A customer service chatbot analyzes product manuals uploaded by users and retrieves relevant troubleshooting guides for support.


5️⃣ Document Upload & Information Extraction

✔ Uploaded documents are automatically linked to the conversation with a predefined message: "Could you save this document and extract the necessary information from it?" ✔ The agent can be configured to process the document and extract required data.

🔹 Example: A business compliance AI extracts financial compliance details from uploaded audit reports.

Limitations of the Widget

While the Document Summary Widget provides an efficient way to upload, summarize, and extract document insights, it has certain limitations that developers should consider when integrating it into workflows.

1️⃣ Requires the "Refresh Document Summary" Event for Updates

✔ The Emit Event Node must be used to trigger the "Refresh Document Summary" event to ensure the widget updates correctly. ✔ Without this event, the widget will not process new documents or display updated summaries.

🔹 Developer Note: Ensure that the workflow correctly emits the event with the required documentId.


2️⃣ The Widget Does Not Open Automatically

✔ Even when a document is uploaded and processed, the widget does not open by default. ✔ Users must manually click on the Document Summary item in the left sidebar to view the summary.

🔹 Developer Note: If an automatic display is required, consider designing a UI workflow trigger to prompt users to open the widget.


3️⃣ Predefined System Message After Upload

✔ After uploading a document via the Document Dropbox, the system automatically appends a predefined message to the conversation: "Could you save this document and extract the necessary information from it?" ✔ This message cannot be customized, meaning the agent workflow must be designed to appropriately handle and interpret this query.

🔹 Developer Note: Ensure intent classification and workflow design align with this message to avoid misinterpretation by the AI agent.

Last updated