Analysis

AI Agent Architecture for Contract Analysis with Bedrock and Quick

Combining Amazon Bedrock AgentCore, Amazon Textract, and Amazon Quick dashboards for structured contract data extraction

4 min read
עב
AI Agent Architecture for Contract Analysis with Bedrock and Quick
Based on original reporting byAWS Machine Learning ↗Translated and summarized by our AI-assisted news systemHow we work

Executive summary

5 things to know

  1. Standard RAG tools retrieve semantic top-k chunks and struggle to perform aggregation and summation calculations across hundreds of documents simultaneously.

  2. The architecture utilizes a Claude Sonnet agent to extract 8 key fields and a Claude Haiku agent for independent verification.

  3. Amazon Textract serves as a computer-vision-based tiebreaker in cases of disagreement between agents regarding the presence of a signature.

  4. Data is stored in Amazon Aurora PostgreSQL, enabling hybrid querying via embedded dashboards and natural language chat in Amazon Quick.

  5. AI inference costs total approximately $0.014 per contract, with the bulk of monthly expenditure resulting from analytics tool licensing.

In a post published on the AWS blog, an architecture was presented for a contract intelligence platform based on AI agents, the Amazon Bedrock AgentCore service, and Amazon Quick analytics tools. The solution is designed to address the limitations of RAG-based chat tools when analyzing large contract portfolios, proposing a transition from chunk-based semantic retrieval to structured data extraction paired with database aggregation queries.

RAG Limitations in Portfolio-Wide Aggregation Questions

According to the post's authors, a contracting director is responsible for hundreds or thousands of vendor contracts containing critical information such as contract values, expiration dates, signature status, and key contacts. When this information is locked inside PDF files, teams are forced to manually extract data into spreadsheets to answer recurring questions from leadership, such as which contracts are about to expire or which vendor accounts for the highest spend.

The post explains that many enterprise chat tools rely on Retrieval Augmented Generation (RAG) technology. This method breaks long documents into chunks, indexes them, and retrieves only the most relevant chunks (top-k) during a semantic search. While this approach works well for targeted questions focused on a single document, it fails when aggregation across an entire contract portfolio is required—such as calculating total portfolio value or identifying the most expensive contract. Because the model receives only a small subset of the chunks, it performs calculations solely on the retrieved chunks and returns an incorrect answer.

The key insight presented is that the solution for cross-document questions lies in structured extraction of key fields into a dedicated database, using artificial intelligence to convert unstructured information into a defined structure, and using the database to perform mathematical operations and aggregations. Simultaneously, original documents are maintained in a knowledge base to handle specific, single-document questions.

Pipeline Architecture: Dual Agents and Data Verification

The described solution is a React-based web application on AWS, consisting of several steps:

  1. Contract PDF documents are uploaded to an Amazon Simple Storage Service (Amazon S3) bucket, which triggers an automated processing pipeline.
  2. An AI-based extraction agent (powered by the Claude Sonnet series of models) reads the PDF and extracts eight key fields, assigning a confidence score to each field.
  3. A separate verification agent (powered by the lighter Claude Haiku model) independently reads the same document and verifies the extracted information.
  4. If a disagreement occurs between the two agents regarding signature detection, Amazon Textract serves as a deterministic tiebreaker using computer vision analysis.
  5. Verified data is saved to an Amazon Aurora PostgreSQL database.
  6. Users receive real-time status updates via WebSocket communication and can query the data through embedded dashboards and a natural language chat agent.

The article's authors note that the pipeline can process a contract in seconds under typical conditions, and the serverless architecture is designed to enable parallel scaling for processing numerous contracts. The agents were built using the Strands Agent SDK and run in the Amazon Bedrock AgentCore environment, which provides serverless hosting, automatic scaling, and session isolation. In addition, the policy mechanism in Bedrock AgentCore allows defining Cedar-based security controls to ensure users and agents access only authorized contracts.

Model Selection and Signature Detection Tiebreaking

The architecture combines two different models: Claude Sonnet for extraction, due to its ability to read PDF files directly without prior OCR preprocessing and return structured JSON, and Claude Haiku for fast, cost-effective verification providing an independent perspective that catches errors.

During testing, the developers discovered a failure mode in which the verification model sometimes flagged a contract as signed with 95%–100% confidence even though no signature was present, while the extraction agent correctly identified that the contract was unsigned. The model misinterpreted the text of an empty signature block ("Signature: __________") as proof of a signature. Rather than relying on complex prompt instructions, Amazon Textract was added as an evidentiary tiebreaker that runs only when there is disagreement on the is_signed field. Textract visually analyzes the page to identify actual handwritten or digital signatures, thereby preventing false positives at minimal cost.

In an experiment conducted on a sample of 20 contracts with 8 hand-labeled fields (160 values total), extraction was found to be the higher-impact step on accuracy. Using a more capable extraction model held accuracy up even when paired with a light verifier model, while a lighter extraction model brought accuracy down regardless of the verifier model.

Querying and Analytics with Amazon Quick

To enable data access, the system connects to Amazon Quick, which combines structured dashboards and a natural language conversational agent:

  • Aggregation questions (such as total portfolio value or the number of expired contracts) are routed to queries against the PostgreSQL database and defined Topics.
  • Document-specific questions (such as payment terms in a specific vendor's contract) are retrieved directly from the knowledge base of source files.

Amazon Quick Sight dashboards are embedded directly into the React application using the dedicated SDK, querying data directly from the database to display updated information immediately upon contract processing completion. The views include key performance indicators (KPIs), a full extraction table, confidence scores from both agents, and a cost breakdown.

Operating Costs and Key Insights

According to the published cost analysis, the bulk of the monthly cost stems from analytics tool licensing rather than running the language models:

  • Amazon Quick licensing for an Enterprise user and infrastructure: approximately $290.
  • Amazon Aurora Serverless v2 database: approximately $44.
  • Model execution in Amazon Bedrock (extraction and verification): approximately $12 per month for 1,000 contracts.
  • Amazon Textract service (signature tiebreaker): approximately $2 per month.
  • Additional infrastructure services (AWS Lambda, API Gateway, S3, CloudFront): less than $1.
  • Total monthly cost estimated by the team stands at approximately $349 for processing 1,000 contracts per month.

AI model inference costs total approximately $0.014 per contract. The authors concluded that for aggregation use cases across many documents, it is recommended to extract key fields into a structured database before querying, use two independent models for verification to catch errors in high-stakes data, and rely on purpose-built deterministic services when language models are prone to hallucinations. In cases where two models disagree in ways a deterministic service cannot settle, the next step is to route the contract to a human reviewer instead of auto-resolving.

Was this useful for your business?

Questions & Answers

FAQ

This article was produced by our AI-assisted system through translation, summarization, and automated quality controls based on original reporting by AWS Machine Learning. Read about our editorial process. Link to the original source.

Get useful AI updates by email

A concise digest from our news desk.

More from AWS Machine Learning

All articles from AWS Machine Learning
כיצד HEMA בנתה שכבת ידע ארגונית עם Bedrock ו-MCP
ניתוח
4 דקות
מ־AWS Machine Learning

כיצד HEMA בנתה שכבת ידע ארגונית עם Bedrock ו-MCP

רשת הקמעונאות ההולנדית HEMA בנתה שכבת ידע פנימית המבוססת על Amazon Bedrock AgentCore ו-Model Context Protocol (MCP) במטרה לאחד מידע מבוזר ולמנוע מעבר ידני בין פורטלים ומערכות ויקי שונות. העוזר הפנימי HAL, שפותח תחילה ככלי עצמאי מבוסס Next.js ו-Strands, הורחב לשימוש ישיר מתוך כלי העבודה של המהנדסים (כגון Kiro ו-Claude) באמצעות שער Entra MCP ייעודי ופרוקסי אימות. המערכת משרתת כיום מפתחים, מנהלי מוצר ומנתחי מערכות, כאשר השלב הבא מתוכנן להרחיב את יכולות העוזר ממענה לשאלות לביצוע פעולות תפעוליות ישירות מתוך ממשקי השיחה.

קרא עוד
אוסף מיומנויות סוכן פתוח מבית AWS לשיפור הסקת מסקנות בבריאות
מחקר
5 דקות
מ־AWS Machine Learning

אוסף מיומנויות סוכן פתוח מבית AWS לשיפור הסקת מסקנות בבריאות

בפוסט שפורסם ב-AWS הוצג אוסף של 38 מיומנויות סוכן (Agent Skills) בקוד פתוח ב-11 תחומי בריאות ומדעי החיים (HCLS) תחת רישיון MIT-0. המיומנויות בנויות כקובצי Markdown מובנים ומסווגות למיומנויות הסקה ולמיומנויות צינור, הניתנות להרצה על יותר מ-20 שירותים, כולל Amazon Bedrock AgentCore, AWS Strands SDK ו-Kiro CLI. הערכה השוואתית שבוצעה על 410 פרומפטים הראתה כי סוכנים המצוידים במיומנויות השיגו שיעור ניצחון של 69.5% עד 85.9% מול סוכני בסיס ללא מיומנויות, כאשר השיפור המשמעותי ביותר נמדד בממד החשיבה הביקורתית (שיעור ניצחון של 78% עד 85.1%). בנוסף, המיומנויות הפחיתו את שונות הציונים בעד 61.9%.

קרא עוד
אופטימיזציית עלויות וזמני תגובה עם Prompt Caching ב-Bedrock
מדריך
3 דקות
מ־AWS Machine Learning

אופטימיזציית עלויות וזמני תגובה עם Prompt Caching ב-Bedrock

בפוסט של ארכיטקט הפתרונות דניאל אביב מ-AWS, מוסבר כיצד מנגנון ה-Prompt Caching ב-Amazon Bedrock מפחית עד 90% מעלויות טוקני הקלט על פגיעות במטמון ומקצר את זמן התגובה לטוקן הראשון (TTFT). המאמר סוקר שישה תרחישי יישום באמצעות ה-Converse API: שמירת מסמכים, שמירת פרומפט מערכת, שמירת הגדרות כלים לסוכנים, שילוב זמני חיים שונים (Mixed TTL), בידוד דיירים במערכות מרובות משתמשים באמצעות תחילית SHA-256, ואינטגרציה עם ספריית LangChain. מודלי Anthropic Claude Sonnet 4.5 ו-4.6 דורשים סף מינימלי של 1,024 טוקנים להפעלת המטמון.

קרא עוד
Amazon Quick זמין כעת באופן כללי למחשב השולחני
מוצר חדש
4 דקות
מ־AWS Machine Learning

Amazon Quick זמין כעת באופן כללי למחשב השולחני

אפליקציית הדסקטופ של Amazon Quick זמינה כעת באופן כללי למשתמשי macOS ו-Windows, ובמקביל נוסף פיד פעילות למובייל ב-iOS וב-Android. המערכת מרכזת נתונים מדואר אלקטרוני, מיומן פגישות, ממערכות CRM ומהודעות לתצוגה מתועדפת אחת, כאשר סוכני AI מטפלים במשימות שגרתיות ברקע. Quick פועל על גבי תשתיות AWS ושומר על נתוני הארגון בסביבתו המקומית, כולל תמיכה במעקב ביקורת דרך CloudWatch ו-CloudTrail והסמכות תאימות דוגמת HIPAA, FedRAMP, SOC 2 ו-ISO 27001. לקוחות בארגונים כמו Southwest Airlines, LabCorp ו-PGA TOUR משתמשים בכלי להשלמת משימות, סינתזת מידע ופיתוח אבות-טיפוס.

קרא עוד

More articles you might like

All articles
כיצד HEMA בנתה שכבת ידע ארגונית עם Bedrock ו-MCP
ניתוח
4 דקות
מ־AWS Machine Learning

כיצד HEMA בנתה שכבת ידע ארגונית עם Bedrock ו-MCP

רשת הקמעונאות ההולנדית HEMA בנתה שכבת ידע פנימית המבוססת על Amazon Bedrock AgentCore ו-Model Context Protocol (MCP) במטרה לאחד מידע מבוזר ולמנוע מעבר ידני בין פורטלים ומערכות ויקי שונות. העוזר הפנימי HAL, שפותח תחילה ככלי עצמאי מבוסס Next.js ו-Strands, הורחב לשימוש ישיר מתוך כלי העבודה של המהנדסים (כגון Kiro ו-Claude) באמצעות שער Entra MCP ייעודי ופרוקסי אימות. המערכת משרתת כיום מפתחים, מנהלי מוצר ומנתחי מערכות, כאשר השלב הבא מתוכנן להרחיב את יכולות העוזר ממענה לשאלות לביצוע פעולות תפעוליות ישירות מתוך ממשקי השיחה.

קרא עוד
משילות ותזמור סוכני AI: תובנות מכנס AGNTCon Europe 2026
ניתוח
4 דקות
מ־SiliconANGLE AI

משילות ותזמור סוכני AI: תובנות מכנס AGNTCon Europe 2026

בטור דעה שפורסם ב-SiliconANGLE סוקר ג'ייסון בלומברג מחברת הייעוץ Intellyx את כנס AGNTCon + MCPCon Europe 2026 באמסטרדם. בלומברג מציין כי בעוד ששוק סוכני הבינה המלאכותית (Agentic AI) נמצא בראשית דרכו, הדגש בקרב חברות הסטארט-אפ עבר מיישומי חזית לפתרונות עסקיים מעשיים. הטור מציג שבע חברות המדגימות מענה לאתגרי משילות, תזמור סוכנים, תוספי מודלי שפה ומשמעת ארכיטקטונית בפיתוח קוד. בין החברות שנסקרו: Traefik Labs, Bluerock Security, Orkes, Grape Up, Manufact, Alpic ו-Reboot. לפי הניתוח, הדרישה העסקית לערך יישומי היא שמניעה את הפיתוחים לבקרת סיכונים ולשליטה בפעילות הסוכנים.

קרא עוד
עקרונות לעיצוב בינה מלאכותית קולית ומסגרת איכות השיחה
ניתוח
4 דקות
מ־Salesforce Blog

עקרונות לעיצוב בינה מלאכותית קולית ומסגרת איכות השיחה

מאמר מקצועי מציג את עקרונות העיצוב של בינה מלאכותית קולית (Voice AI), המבוססים על דינמיקות שיחה בזמן אמת. המאמר סוקר את מסגרת איכות הקול (Voice Quality Framework) הכוללת שלושה רבדי כשל ו-15 היוריסטיקות להערכת חוויית המשתמש, ומפרט את יישום העיצוב ב-Agentforce באמצעות שילוב של הנחיות פרומפט, לוגיקה דטרמיניסטית והגדרות ערוץ קולי.

קרא עוד
תזמור תהליכים: מודלי ביצוע, אתגרי ייצור ותזמור מול כוריאוגרפיה
ניתוח
4 דקות
מ־n8n

תזמור תהליכים: מודלי ביצוע, אתגרי ייצור ותזמור מול כוריאוגרפיה

בפוסט שפורסם בבלוג של n8n, נסקרים מודלי הביצוע המרכזיים בתזמור תהליכים (Process Orchestration): דטרמיניסטי, דינמי וסוכני (Agentic). המאמר מנתח את הפשרות בין יכולת ניבוי, הסתגלות ואוטונומיה, מציג את המאפיינים של תהליכים המתאימים לתזמור מרכזי, וסוקר אתגרי ייצור נפוצים כגון צווארי בקבוק, השחתת מצב, נדידת סכמות וניפוי שגיאות במערכות מבוזרות. כמו כן, מוסברים ההבדלים בין תזמור לכוריאוגרפיה ואוטומציית משימות בודדות.

קרא עוד