> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lumberflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Features for Lumber Procurement

> How the LumberFlow AI agent reads supplier emails, extracts pricing, generates market intelligence, and drafts communications — so you make better decisions faster

<Card title="See the AI in action" icon="play" href="https://lumberflow.com/solutions/lumber-ai">
  Explore how LumberFlow's AI agent handles your lumber procurement workflow end-to-end.
</Card>

## Intelligent Email Processing

LumberFlow's AI agent monitors your connected Gmail inbox in real time, processes every supplier email automatically, and extracts structured data — but you always have the final say before anything enters your pipeline.

## Real-Time Gmail Integration

<AccordionGroup>
  <Accordion icon="bolt" title="Instant Quote Detection (Gmail Push Webhooks)">
    LumberFlow uses Gmail push notifications (webhooks) rather than polling, which means:

    * **Zero lag**: Supplier emails are detected and processed the moment they arrive
    * **No manual forwarding**: Your connected Gmail inbox is monitored automatically
    * **Background processing**: Quote extraction happens while you're doing other things
    * **Fallback safety**: A scheduled cron job provides backup processing every 15 minutes if the webhook isn't triggered

    To enable real-time processing, connect your Gmail account under **Settings → Integrations**.
  </Accordion>

  <Accordion icon="envelope-open" title="Multi-Format Quote Extraction">
    The AI handles every format suppliers use:

    * **Email body text**: Price lists formatted as tables, bullet points, or free-form paragraphs
    * **PDF attachments**: Structured quote sheets and price lists
    * **Excel/spreadsheet attachments**: Column-based pricing tables
    * **HTML emails**: Formatted supplier quote templates

    For each format, the AI extracts: dimensions, species, grade, quantities by length, unit price (\$/MBF), total price, lead time, payment terms, and validity date.
  </Accordion>

  <Accordion icon="brain" title="Lumber Industry Intelligence">
    The AI is trained on lumber industry terminology:

    * Standard abbreviations: SPF, SYP, DF, HF, KD, S4S, S1S2E
    * Grade designations: Construction, Standard, Utility, Stud, Select Structural, No.1\&Btr, Clear
    * Dimension and length formats: 2x4, 2x6, 2x8, 2x10, 2x12 × 8ft/10ft/12ft/16ft/20ft
    * Pricing formats: per piece, per MBF (thousand board feet), per pack — all normalized to \$/MBF
    * Delivery terms: FOB mill, FOB destination, freight included/excluded
  </Accordion>
</AccordionGroup>

## Human-in-the-Loop Validation

Every AI extraction goes through a human validation step before entering your pipeline. This is not optional — it's a core design principle.

<Steps>
  <Step title="AI Extraction">
    System processes the supplier email or attachment and extracts all structured data
  </Step>

  <Step title="Validation Interface">
    A two-panel interface appears: the original supplier document on the left, the AI-extracted data on the right
  </Step>

  <Step title="Human Review">
    You compare the extraction against the source document and correct any errors
  </Step>

  <Step title="Approval & Integration">
    Approved data is saved to the quote, the sourcing card updates, and the pipeline advances
  </Step>
</Steps>

### Validation Best Practices

<Tip>
  **Product Specifications**: Always verify that AI correctly identified dimensions, species, and grades — these determine whether a quote is actually for the right product
</Tip>

<Tip>
  **Pricing Accuracy**: Confirm unit prices are in $/MBF, not $/pack or $/piece. LumberFlow always stores prices in $/MBF for consistent comparison.
</Tip>

<Tip>
  **Delivery Terms**: Review extracted lead times and FOB terms carefully — these affect total landed cost and should factor into your purchase decision
</Tip>

<Warning>
  **Never skip validation**: Even when AI accuracy is high, the cost of an error in a lumber purchase order is significant. Validate every quote before committing.
</Warning>

## AI-Generated Communications

### RFQ Email Generation

When you send an RFQ from the Kanban board, the AI generates professional, supplier-specific emails from your procurement plan specifications:

<CardGroup cols={2}>
  <Card title="Supplier-Specific Drafts" icon="user">
    Each email is drafted for the specific supplier, referencing your relationship history and their specialty areas
  </Card>

  <Card title="Complete Specifications" icon="list-check">
    Full product requirements (dimension, species, grade, lengths, quantities) and your target pricing
  </Card>

  <Card title="Professional Tone" icon="briefcase">
    Industry-appropriate language that maintains your professional image with every supplier
  </Card>

  <Card title="Review Before Send" icon="eye">
    All AI-generated emails are shown for review before sending — you can edit any draft
  </Card>
</CardGroup>

<Note>
  RFQ generation uses parallel AI processing (up to 5 concurrent drafts) with per-user rate limiting and deduplication. If you accidentally click "Send" twice, the system prevents duplicate emails to suppliers.
</Note>

### Counter-Offer Drafting

<AccordionGroup>
  <Accordion icon="message-square" title="Thread-Aware Counter-Offers">
    When you draft a counter-offer, the AI:

    * **Reads the full email thread**: Summarizes prior communications between you and the supplier
    * **References previous offers**: The counter-offer acknowledges the supplier's last quote without you having to write the context
    * **Maintains reply threading**: Sends as a proper email reply (with RFC Message-ID threading), so it appears in the right email thread in the supplier's inbox
    * **Adapts tone**: Adjusts formality based on your relationship with the supplier
  </Accordion>

  <Accordion icon="edit" title="Customization Options">
    You control the negotiation strategy before the AI drafts:

    * **Target price**: Set your desired price and acceptable range
    * **Custom instructions**: Add specific requirements, volume commitments, or timing constraints
    * **Tone selection**: Professional, friendly, or direct communication styles
    * **Full edit capability**: Review and edit the complete draft before sending
  </Accordion>
</AccordionGroup>

### Negotiation Templates

<CardGroup cols={3}>
  <Card title="Initial Counter-Offer" icon="handshake">
    First-time price negotiations
  </Card>

  <Card title="Follow-Up Negotiation" icon="refresh">
    Ongoing discussion rounds with thread context
  </Card>

  <Card title="Volume Discounts" icon="percent">
    Quantity-based pricing requests
  </Card>

  <Card title="Delivery Terms" icon="truck">
    Shipping and timeline negotiations
  </Card>

  <Card title="Payment Terms" icon="credit-card">
    Extended payment discussions
  </Card>

  <Card title="Final Acceptance" icon="check-circle">
    Agreement confirmation language
  </Card>
</CardGroup>

## Market Sentiment Intelligence

The Market Sentiment Nudge surfaces species-level market intelligence directly on your Kanban cards and in your pre-purchase-order flow — so every sourcing decision is informed by current market conditions.

<AccordionGroup>
  <Accordion icon="chart-line" title="How Sentiment Works">
    For each species you're sourcing, the AI analyzes:

    * **Lumber news and trade publications**: Mill openings/closures, supply chain events, trade policy changes
    * **Mill capacity signals**: Production disruptions, capacity additions, inventory levels
    * **Demand indicators**: Housing starts, building permits, construction activity
    * **Price trend data**: Recent price movements and momentum

    This produces a species-level sentiment score (Bullish / Neutral / Bearish) with a confidence level and a daily summary of the signals driving the assessment.
  </Accordion>

  <Accordion icon="badge" title="Sentiment on Kanban Cards">
    Every sourcing card displays a sentiment badge for its species:

    * **Bullish** 🟢: Market conditions favor suppliers — consider buying sooner, before prices rise
    * **Neutral** ⚪: No strong directional signal — standard procurement timing applies
    * **Bearish** 🔴: Market conditions favor buyers — you may have pricing leverage, or conditions may improve

    Click **See why** on any badge to read the AI's supporting analysis and the news events driving the signal.
  </Accordion>

  <Accordion icon="thumbs-up" title="Sentiment Feedback">
    Disagree with the AI's sentiment assessment? Submit feedback directly from the card. Your feedback helps calibrate the model over time.
  </Accordion>
</AccordionGroup>

<Card title="Learn more about lumber market analysis" icon="chart-bar" href="https://lumberflow.com/solutions/lumber-market-analysis">
  See how LumberFlow delivers daily market intelligence for lumber buyers.
</Card>

## Team Insights: Your Internal Price Benchmark

Team Insights uses your organization's own historical quote data as pricing benchmarks — normalized to \$/MBF for consistent comparison across SKUs.

<AccordionGroup>
  <Accordion icon="users" title="What Team Insights Shows">
    In the sourcing request drawer and on the Team Insights dashboard:

    * **Median price** your team has paid for a given SKU (dimension-species-grade group) in the last 90 days
    * **In-flight median**: What open (not-yet-fulfilled) quotes are currently priced at — useful for understanding where active negotiations are landing
    * **Grade filters**: Compare benchmarks across different grade levels for the same species and dimension
    * **Supplier breakdown**: Which suppliers are typically competitive for a given SKU
  </Accordion>

  <Accordion icon="calculator" title="How Benchmarks Are Calculated">
    * All prices are normalized to **\$/MBF** using the `getMBFPerPack()` utility — so a 2x4 and a 2x6 quote are always comparable on a per-board-foot basis
    * **Business-day windows**: Benchmarks use a 2-business-day rolling window to avoid stale data
    * **SKU group normalization**: Dimension-species-grade combinations are normalized so "2x4 SPF Stud" and "2x4 SPF Std\&Btr" are tracked separately
    * **Organization-scoped**: You only see your organization's data — never other customers' data
  </Accordion>

  <Accordion icon="refresh" title="When Benchmarks Update">
    Team Insights benchmarks are recomputed every 30 minutes via a background batch job. New quotes you validate and approve are reflected in the next benchmark cycle.
  </Accordion>
</AccordionGroup>

## Email Thread Intelligence

<AccordionGroup>
  <Accordion icon="link" title="Thread Tracking">
    LumberFlow uses RFC Message-ID threading to maintain proper email continuity:

    * Every RFQ email is sent with a unique `Message-ID` header
    * Counter-offers are sent as replies with proper `In-Reply-To` and `References` headers
    * Supplier responses are matched back to the original RFQ thread automatically
    * The full thread history is preserved for counter-offer context generation
  </Accordion>

  <Accordion icon="users" title="Multi-Supplier Coordination">
    When you send bulk RFQs or counter-offers:

    * Each supplier receives their own independent email thread
    * Bulk operations never cross-contaminate threads — SPF Mill A never sees SPF Mill B's pricing
    * Counter-offer context is generated separately per supplier, using that supplier's conversation history
    * Response rates and timing are tracked per supplier for performance analytics
  </Accordion>
</AccordionGroup>

## Quality Assurance

<CardGroup cols={2}>
  <Card title="95%+ Accuracy" icon="check-circle">
    Pricing and specification extraction accuracy across standard supplier email formats
  </Card>

  <Card title="100% Validation" icon="shield">
    All AI-extracted data requires human approval before entering your pipeline
  </Card>

  <Card title="Rate Limited" icon="shield-check">
    Per-user AI rate limiting prevents runaway costs (10 RFQ generations/min, 20 quote processings/min)
  </Card>

  <Card title="Idempotent Operations" icon="refresh">
    Duplicate-prevention at every AI step — no double-sent RFQs, no double-processed quotes
  </Card>
</CardGroup>

## Troubleshooting AI Features

<AccordionGroup>
  <Accordion icon="exclamation-triangle" title="Extraction Accuracy Issues">
    **Problem**: AI misreads pricing or specifications

    **Solutions**:

    * Use the validation interface to correct errors before approving
    * If a supplier's format is consistently misread, contact support — we can tune extraction for specific formats
    * Ask suppliers to use consistent formatting (e.g., always specify prices as \$/MBF explicitly)
  </Accordion>

  <Accordion icon="envelope" title="Email Processing Delays">
    **Problem**: Supplier emails not appearing in the board quickly

    **Solutions**:

    * Verify Gmail is connected under **Settings → Integrations**
    * Check that the supplier's reply is sent from an email address registered in your supplier contact list
    * The fallback cron job runs every 15 minutes — if the webhook missed a message, it will be caught in the next cycle
    * Contact support if emails are still missing after 30 minutes
  </Accordion>

  <Accordion icon="message-circle" title="Counter-Offer Draft Quality">
    **Problem**: Generated counter-offer emails need significant editing

    **Solutions**:

    * Add specific instructions in the custom instructions field (e.g., "Reference our Q1 volume commitment of 500 packs")
    * Update your organization profile with your preferred communication style
    * For recurring scenarios, save effective counter-offer language and paste it into the custom instructions field
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Dashboard Overview" icon="table-layout" href="/user-guide/dashboard-overview">
    See how AI insights — sentiment, benchmarks, and KPIs — appear on your Kanban board
  </Card>

  <Card title="Advanced Workflows" icon="workflow" href="/user-guide/advanced-workflows">
    Master quote validation, counter-offer negotiation, and purchase order creation
  </Card>

  <Card title="Best Practices" icon="star" href="/user-guide/best-practices">
    Optimize your AI-assisted procurement workflow for maximum efficiency
  </Card>

  <Card title="Troubleshooting" icon="life-ring" href="/user-guide/troubleshooting">
    Resolve common AI processing issues
  </Card>
</CardGroup>
