Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Dealact
Inspiration
Every year, enterprise and mid-market merchants generate hundreds of billions of dollars in high-value commercial sales quotes, custom installations (such as solar setups, HVAC, and bespoke B2B orders), and high-ticket checkouts. Yet over 68% of qualified quotes stall and are quietly abandoned.
The conventional industry response is fundamentally broken: spamming buyers with generic "Did you forget something?" email blasts and desperate 5% discount codes.
When a business buyer pauses on a €4,800 commercial installation quote, they didn't simply forget. They encountered a concrete structural friction:
- Cash-flow timing constraints (requiring split quarterly payments instead of lump-sum prepayment).
- Lead-time and schedule ambiguity impacting their operations.
- Unanswered technical or warranty questions that generic automated reminders cannot resolve.
We built Dealact: an autonomous, policy-governed transaction-resolution platform powered by AWS Communication Developer Services (AWS CDS) and Amazon Bedrock. Instead of chasing customers, Dealact diagnoses the structural obstacle behind stalled commercial transactions, applies company-approved deterministic business policies, and executes verified, binding resolutions directly through two-way messaging and focused micro-UIs.
What it does
Dealact sits between enterprise transactional backends (ERP, CRM, e-commerce engines) and the customer, transforming stalled quotes into completed transactions through four automated stages:
Ingestion & Obstacle Diagnosis: When a transaction stalls past its operational threshold, Dealact ingests the quote and customer context. Leveraging Amazon Bedrock (Anthropic Claude 3.5 Sonnet), it classifies customer friction into one of 12 Standard Obstacle Taxonomies: $$\mathcal{O} \in { \text{FINANCIAL_CONSTRAINTS}, \text{DELIVERY_TIMING}, \text{TECHNICAL_GLITCH}, \text{UNANSWERED_QUESTIONS}, \dots }$$ with an algorithmic confidence threshold $\mathcal{C}(\mathcal{O}) \ge \tau_{\text{threshold}}$.
Deterministic Policy Authorization (Rules R01–R45): Dealact enforces a strict Rule of Sovereignty: Generative AI diagnoses and drafts; the deterministic policy engine authorizes and executes. The AI cannot invent unauthorized discounts or negotiate terms on its own. The TypeScript Policy Engine verifies eligibility (e.g., quote value $\ge €1,000$, margin bounds, credit tier) before any proposal reaches the customer.
Two-Way Resolution Execution (AWS CDS):
- Amazon SES: Delivers transparent, personalized quote resolution summaries.
- AWS End User Messaging (EUM): Facilitates interactive two-way SMS, WhatsApp, and RCS customer resolution dialogues.
- Dealact Resolve Micro-UI: A distraction-free, mobile-first Web interface where customers inspect installment terms (e.g., €1,600 $\times$ 3 months at 0% APR) and execute with one click.
Irrevocable Settlement & Causal Measurement: Every workflow transitions deterministically into one of 8 Canonical Terminal States (
COMPLETED,CUSTOMER_DECLINED,EXPIRED,OPTED_OUT,HUMAN_HANDOFF,SUPERSEDED,UNRESOLVED,ERROR_PENDING) backed by an immutable DynamoDB audit ledger and a randomized holdout group measuring true causal revenue lift: $$\text{Incremental Lift} = \mathbb{E}\left[ Y^{(1)} \mid \text{Dealact} \right] - \mathbb{E}\left[ Y^{(0)} \mid \text{Control} \right]$$
How we built it
We built Dealact adhering to Hexagonal Architecture (Ports & Adapters), Domain-Driven Design (DDD), and a strict Anti-Corruption Layer (ACL):
- Pure Domain Core: Zero external dependencies (no AWS SDK, no database driver, no UI code in core). All entities (
Opportunity,TransactionQuote,ResolutionProposal) and policy rules (R01–R45) run as pure, testable functions. - Amazon Bedrock (Claude 3.5 Sonnet): Integrated via an outbound port using JSON-schema tool-use for structured obstacle extraction and tone-governed resolution drafting.
- AWS Communication Developer Services: AWS End User Messaging (EUM) for bidirectional SMS/WhatsApp conversations and Amazon SES v2 for transactional email notifications.
- Dual-Mode Persistence: Amazon DynamoDB single-table design with automatic fallback to an in-memory repository for zero-config local testing and CI/CD pipelines.
- Anti-Corruption Layer (ACL) & Micro-UI: Next.js 14 App Router and TypeScript frontend consuming design tokens based on the W3C Design Tokens Community Group (DTCG) specification. The frontend binds only to typed DTO adapters, guaranteeing zero frontend rewrites if the backend is transitioned to an enterprise Java (Spring Boot) architecture.
Mathematical Precision & Financial Guardrails
Zero-Fee Installment Amortization (Rule R04): For any qualified quote $A_{\text{total}} \ge €1,000$ split across $n \in {3, 6, 12}$ billing periods: $$P_t = \begin{cases} \left\lfloor \frac{A_{\text{total}}}{n} \right\rfloor & \text{for } t = 1, \dots, n-1 \ A_{\text{total}} - \sum_{k=1}^{n-1} P_k & \text{for } t = n \end{cases} \quad \text{such that} \quad \sum_{t=1}^{n} P_t \equiv A_{\text{total}}$$ This guarantees exact penny-precision matching with zero rounding leakages across merchant invoicing systems.
Causal Incremental Revenue Formula: $$\Delta \text{Revenue}{\text{incremental}} = \sum{i \in \mathcal{T}{\text{active}}} R_i - \left( \frac{|\mathcal{T}{\text{active}}|}{|\mathcal{T}{\text{holdout}}|} \sum{j \in \mathcal{T}_{\text{holdout}}} R_j \right)$$
Challenges we faced
- Eliminating LLM Hallucination in Financial Commitments: Large Language Models are probabilistic. Letting an LLM directly negotiate payment terms or discount codes poses severe legal and margin risks. We solved this with strict architectural segregation: Bedrock only diagnoses and drafts proposals, while our deterministic
PolicyEngineauthorizes the numbers. Any non-compliant proposal triggers an automated escalation toHUMAN_HANDOFF. - Dual-Mode Architecture (Offline Dev & Live AWS Cloud): To support offline development, CI testing, and live AWS evaluation without code branching, every port has dual adapters (
InMemoryTransactionRepositoryvsDynamoDbTransactionRepository,MockBedrockAdaptervsAwsBedrockObstacleClassifierAdapter). The platform dynamically binds adapters based on environment credentials. - Idempotency & Replay Protection: In high-ticket commerce, duplicate submissions or network retries can cause double-billing. We enforced deterministic UUIDv5 idempotency keys derived from the quote ID, resolution payload, and timestamp epoch, ensuring every settlement is executed exactly once.
Accomplishments that we're proud of
- Sub-Second Customer Resolution: The Dealact Resolve micro-UI loads in under $200\text{ms}$ with zero clutter, achieving high-contrast WCAG AAA compliance and instant cryptographic settlement receipts.
- Deterministic Hexagonal Isolation: The domain core contains zero framework imports, enabling unit test suites to execute in under $1.5\text{s}$ with 100% policy branch coverage.
- 95% Affirmation Verification Gate: Enforced an automated verification matrix ensuring every product claim, architectural pattern, and user story matched working code and E2E Playwright test assertions.
- Production-Grade Brand System: Designed a clean, flat iconographic brand mark (The Kinetic Clasp) and design token hierarchy without reliance on generic stock assets.
What we learned
- Generative AI Excels as a Diagnostician, Not a Governor: Pairing Amazon Bedrock's nuanced semantic classification with deterministic, hard-coded policy rules yields the ideal combination of natural customer interaction and rigorous commercial compliance.
- The Power of an Anti-Corruption Layer (ACL): Isolating UI view models from raw API schemas allowed us to iterate on AWS serverless handlers without breaking frontend contracts, while providing a clear path for future enterprise ERP integrations.
What's next for Dealact
- Enterprise Java / Spring Boot Adapter: Developing a drop-in starter kit for enterprise SAP, NetSuite, and Salesforce Revenue Cloud environments using our existing Ports & Adapters interfaces.
- In-Chat Native Apple Pay / Google Pay: Enabling customers to accept installment plans and authenticate initial payments directly within two-way WhatsApp and RCS conversations.
- Multi-Currency Dynamic FX Hedging: Extending the policy engine to calculate real-time foreign currency guarantees for cross-border B2B transactions.
Built With
- amazon-bedrock
- amazon-dynamodb
- amazon-ses
- aws-end-user-messaging
- aws-eventbridge
- aws-lambda
- aws-sdk
- claude-3.5-sonnet
- domain-driven-design
- ecommerce
- fintech
- generative-ai
- hexagonal-architecture
- next.js
- node.js
- playwright
- react
- rest-api
- serverless
- sms-api
- tailwindcss
- typescript
- vitest
- whatsapp-business-api
Log in or sign up for Devpost to join the conversation.