1.2 The Tech Stack

The Tech Stack

The "Invisible" Engine.

We aren't burning cash on expensive engineering teams or bloated server costs. Our entire infrastructure is built on a Low-Code / No-Code stack that is robust, scalable, and costs less than $100/mo to maintain.

Because we operate "Headless" (no customer-facing website), our product is defined by how well these five tools talk to each other.


1. The Ears & Mouth: AgentMail.to

Role: Communication Infrastructure & Data Parsing

We don't manage mail servers (Postfix/Exim), and we don't use standard Gmail APIs (which are rate-limited and hard to automate). We use AgentMail, an API-first email infrastructure designed specifically for AI agents.

Why it’s critical:

  • JSON Parsing: Real emails are messy (HTML, MIME types, headers). AgentMail ingests raw emails and converts them into clean, structured JSON payloads. It automatically separates the body text from the attachments and metadata.

  • Webhooks: instead of our code "checking" for email every minute, AgentMail pushes data to us instantly via webhook the second an email arrives.

  • Identity: It provides infinite unique inboxes (e.g., deal_123@dealtrail.com) so every transaction can have its own "listener."


2. The Brain: n8n (Self-Hosted)

Role: Orchestration, Logic & AI Routing

n8n is our central nervous system. It is a workflow automation tool (like Zapier, but more powerful and self-hostable) that executes our business logic.

How it works:

  • The Listener: It sits waiting for the webhook from AgentMail.

  • The Decision Maker: When data arrives, n8n runs the logic: "Is this a new deal? Is this an inspection report? Who sent this?"

  • The AI Node: We use n8n’s native AI Agent nodes to connect to OpenAI (GPT-4o). We pass the email body to the LLM and ask it to extract structured data (Price, Dates, Names) which we then use to update our database.


3. The Hands: DocuSign Rooms for Real Estate

Role: Compliance, Forms Library & Execution

This is our competitive moat. We do not "scrape" PDF forms. We utilize the DocuSign Rooms API, which gives us legitimate, licensed access to the C.A.R. (California Association of Realtors) Forms Library.

The Power of the API:

  • Forms Access: We can programmatically search for official forms (e.g., "Residential Purchase Agreement") and add them to a transaction "Room."

  • Data Mapping: We don't drag-and-drop text boxes. We push a JSON object to the API that maps data to specific form fields (e.g., { "text_buyer_name": "John Doe" }), instantly pre-filling complex legal documents.

  • Envelopes: We use the API to create "Envelopes" (signing packets), route them to the correct signers in order, and track their status via webhooks.


4. The Memory: Supabase & Airtable

Role: Database & Ops Dashboard

We use a "Split-Brain" data strategy to optimize for both machine speed and human usability.

  • Supabase (PostgreSQL): This is the "System of Record." It stores the relational data: Users, Deals, Document IDs, and Chat Logs. It is fast, secure, and what n8n talks to.

  • Airtable (The Human Interface): Since we don't have a frontend app, Airtable is our "Admin Panel." We sync Supabase data to Airtable so our Licensed Human TCs can view active deals, click "Approve" on drafts, and spot-check the AI's work in a friendly, spreadsheet-like view.


5. The Wallet: Stripe

Role: Billing & Revenue Automation

We automate cash flow so we never have to chase invoices.

  • Subscription: Auto-charges the monthly "Access Fee" to keep the agent active.

  • Per-Deal: n8n generates a unique Stripe Payment Link for the ~$300 "Success Fee" and emails it to the agent or escrow officer automatically upon closing.


The Integrated Workflow: How it Connects

Here is the step-by-step lifecycle of a DealTrail action, showing how data flows through the stack.

Scenario: An agent forwards a signed Purchase Agreement PDF to start a new deal.

  1. Ingest (AgentMail): AgentMail receives the email. It strips away the HTML signature, extracts the PDF attachment, and converts the email into a JSON Payload. It fires a webhook to n8n.

  2. Analyze (n8n + AI): n8n receives the JSON. It passes the text to OpenAI with the prompt: "Extract the Property Address, Price, and Closing Date."

  3. Record (Supabase): n8n creates a new row in the Deals table in Supabase with status: "Active".

  4. Execute (DocuSign API): n8n calls the DocuSign API to create a new "Room" for the property and uploads the PDF into it for safekeeping.

  5. Notify (AgentMail): n8n drafts a response email: "Deal Started for 123 Maple. Closing Date set for Nov 25." and sends it back to the agent via AgentMail.

Result: In under 30 seconds, a chaotic email was converted into a database record, a compliant file, and a confirmation response—without a human touching a keyboard.

Visual Breakdown:

Gemini_Generated_Image_olmat6olmat6olma.png


Was this article helpful?
© 2025 DealTrail 3.0