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
ניהול עלויות מקצה לקצה ב-Amazon Bedrock: מדריך לצוותי FinOps
מדריך
5 דקות
מ־AWS Machine Learning

ניהול עלויות מקצה לקצה ב-Amazon Bedrock: מדריך לצוותי FinOps

בפוסט של מומחי AWS מוצג מודל תפעולי בן חמישה שלבים לניהול עלויות ב-Amazon Bedrock, המיועד לצוותי FinOps והנדסת פלטפורמה. המודל מתמקד בעומסי עבודה של סוכני בינה מלאכותית (agentic workloads), שבהם צריכת הטוקנים מושפעת מרמת האוטונומיה וגודל ההקשר. חמשת השלבים כוללים: שיוך עלויות לכל ישות וצוות באמצעות תגי IAM ודוחות CUR 2.0; יצירת יכולת תצפית ובקרה באמצעות רישום יומני הסקה ב-CloudWatch וב-S3 לצד מטא-דאטה מובנית; אכיפת תקציבים בשלוש רמות (התראות, שלילת הרשאות ב-IAM או חסימה סינכרונית בשער); מיטוב ברירות מחדל באמצעות שמירה במטמון (prompt caching) וניתוב מודלים חכם; והפעלת סקירת ביצועים משותפת מבוססת מדדים ברורים.

קרא עוד
אימון סוכנים ב-Multi-Turn Reinforcement Learning ב-SageMaker AI
מדריך
5 דקות
מ־AWS Machine Learning

אימון סוכנים ב-Multi-Turn Reinforcement Learning ב-SageMaker AI

מדריך טכני של מהנדסי AWS מציג את השימוש ב-Multi-Turn Reinforcement Learning (MTRL) על גבי Amazon SageMaker AI לאימון סוכני בינה מלאכותית על רצפי פעולות מרובי שלבים. באמצעות הדגמה על משחק Wordle, המאמר מפרט כיצד אימון מודל GPT-OSS-20B בעזרת סביבת Amazon Bedrock AgentCore ואלגוריתם GRPO העלה את שיעור הפתרון מ-61% ל-84% בהגדרות הגשה, בעלות של כ-339 דולר בטוקנים. המדריך כולל פירוט על ארכיטקטורת המערכת, הכנת מערך הנתונים ללא תוויות, נוסחת פונקציית התגמול המפרידה בין תוצאה לעיצוב התנהגות, והתמודדות עם תקלות תשתית ואימות במהלך האימון.

קרא עוד
תשלום לפי קריאה עבור סוכני AI: שילוב AgentCore payments ב-AWS
מוצר חדש
4 דקות
מ־AWS Machine Learning

תשלום לפי קריאה עבור סוכני AI: שילוב AgentCore payments ב-AWS

בפוסט שפרסמו מהנדסי AWS הוצגה היכולת המנוהלת AgentCore payments ב-Amazon Bedrock, המאפשרת לסוכני בינה מלאכותית לשלם לפי דרישה עבור שירותים דוגמת הסקת מודלים. השירות מנהל ארנקים, מטפל בפרוטוקול התשלום x402 ואוכף מגבלות הוצאה ברמת התשתית במקום ברמת המודל. הפוסט מפרט כיצד חברת Incarna שילבה את המערכת כדי לאפשר לסוכנים לשלם לנתב ההסקה BlockRun עבור כל קריאה בנפרד ברשת Base ב-USDC. האינטגרציה הושלמה בשלושה ימים ובכ-200 שורות קוד, ובשלב הבטא עובדו מעל 1,000 תשלומים בסכומים של 0.001 עד 0.05 דולר לקריאה. היכולת זמינה כעת באופן כללי.

קרא עוד
Claude Haiku 5.5 זמין כעת ב-Amazon Bedrock וב-AWS
מוצר חדש
4 דקות
מ־AWS Machine Learning

Claude Haiku 5.5 זמין כעת ב-Amazon Bedrock וב-AWS

חברת AWS הודיעה על זמינות המודל Claude Haiku 5.5 ב-Amazon Bedrock וב-Claude Platform on AWS. לפי Anthropic, המודל הוא המהיר והיעיל ביותר במשפחת Claude 5.5, נבנה עבור תתי-סוכנים ומשימות בנפח גבוה, ועולה כ-75 אחוז פחות מ-Claude Haiku 4.5 במרבית המשימות. השירות ב-Bedrock שומר על תושבות נתונים אזורית ומשתלב עם מנגנוני IAM, CloudTrail, CloudWatch ו-Guardrails. המודל כולל בקרות מאמץ לכוונון עלות מול תבונה, ומיועד להשתלב לצד Claude Opus 5.5 שמבצע את התכנון והשיפוט המורכב. המודל זמין בפרופילי הסקה גלובליים ואזוריים וב-AWS GovCloud.

קרא עוד

More articles you might like

All articles
מדריך תמחור Make: כיצד עובד מודל הקרדיטים ומה ההבדל מול Zapier
ניתוח
5 דקות
מ־Zapier

מדריך תמחור Make: כיצד עובד מודל הקרדיטים ומה ההבדל מול Zapier

מדריך שפורסם באתר Zapier מנתח את מודל התמחור של פלטפורמת האוטומציה Make (לשעבר Integromat), המבוסס על צריכת קרדיטים חודשית. במודל זה, מרבית המודולים בתרחיש – כולל טריגרים, חיפושים ואיטרטורים – גורעים קרדיט אחד בעת ביצועם, גם אם לא נמצא מידע חדש. חריגים לכך הם נתבים ומודולים לטיפול בשגיאות שאינם צורכים קרדיטים, לצד מודולים יקרים יותר כגון הרצת קוד (2 קרדיטים לשנייה) ופעולות בינה מלאכותית מסוימות. המדריך מפרט את תוכניות החיוב, החל מתוכנית חינם המציעה 1,000 קרדיטים ושני תרחישים פעילים, דרך תוכנית Core ב-12 דולר לחודש עם 10,000 קרדיטים, ועד מסלולי Pro, Teams ו-Enterprise. לצד זאת, המדריך משווה בין Make לבין Zapier: בעוד ש-Make מחייבת על כל שלב וטריגר ומציעה מעל 3,500 אפליקציות, Zapier גובה תשלום רק על משימות שהושלמו וכוללת מעל 9,000 אפליקציות. בנוסף מצוין כי Make דורשת עקומת למידה משמעותית, כאשר התמיכה של הפלטפורמה המליצה על כ-19 שעות לימוד ב-Make Academy לפני בניית תהליכים לייצור.

קרא עוד
מעבר לייצור קוד: מדריך לפיתוח תוכנה מבוסס סוכנים ב-GitHub
ניתוח
4 דקות
מ־GitHub AI and ML

מעבר לייצור קוד: מדריך לפיתוח תוכנה מבוסס סוכנים ב-GitHub

בפוסט שפורסם בבלוג של GitHub, מוצגת מסגרת עבודה לשילוב סוכני בינה מלאכותית בארבעה שלבי פיתוח: תכנון, בנייה, אימות ותצפית. הדבר מגיע על רקע נתוני אוקטובר שהצביעו על יותר מ-1.2 מיליארד קומיטים בשבוע אחד, לצד ממצאי מחקר של Faros AI שלפיהם בקשות משיכה ממתינות 441% יותר זמן בסקירה כאשר צוותים מגבירים את אימוץ הבינה המלאכותית. המדריך סוקר כלים כגון מצב תכנון, ארגזי חול בענן, סקירות קוד אוטומטיות, וחיבור למערכות תצפית כדי לייעל את התהליך כולו.

קרא עוד
כיצד צריכה בינה מלאכותית לבקש אישור: לקחי Zapier מפיתוח Sidekick
ניתוח
4 דקות
מ־Zapier

כיצד צריכה בינה מלאכותית לבקש אישור: לקחי Zapier מפיתוח Sidekick

בפוסט שפרסמה חברת Zapier, מפרטת החברה את הלקחים מפיתוח מנגנון ההרשאות בסביבת העבודה Sidekick. המערכת עברה מספר איטרציות: החל מבקשת אישור על כל כלי בנפרד, דרך הצמדת כללים למשאבים מוגנים (כמו קבצים או חשבונות), ועד להעברת בקשות האישור מחוץ לזרם הצ'אט לפאנל ייעודי ותיבת דואר נכנס. בנוסף, Zapier בחנה מצב Auto שבו בודק בינה מלאכותית מקבל החלטות על בסיס כללים בשפה חופשית, ומצב YOLO שבוטל לאחר שהתברר כי דילוג גורף על אישורים אינו מתאים לסביבת העבודה. כעת מפתחת החברה מצב חדש המבוסס על הפיכות הפעולה וההקשר שלה.

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

חיבור ידע מוצר לסוכני בינה מלאכותית: ארבעה לקחים מסיילספורס

במאמר מאת Salesforce מפורטים ארבעה לקחים מניסיונה כמשתמשת הראשונה במוצריה (Customer Zero), ובפרט בחיבור ידע מוצר לסוכני בינה מלאכותית באמצעות Data 360 ו-Agentforce. החברה מתארת כיצד תשובות סוכן RAG תלויות באיכות התוכן הנשלף, וממליצה להעריך את מאגר הידע לפי התאמה, פער והתנגשות לפני בניית אינדקס. בנוסף מומלץ לפתח תצורות על בסיס השערות שנבדקות כמותית ואיכותית ולא לפי מפרט קשיח, להגדיר מראש מאגר נתוני ייחוס לבדיקות, ולשלב בדיקות אנושיות לצד מדדים אלגוריתמיים כדי למנוע דחיות שווא לפני עלייה לייצור.

קרא עוד