Negotiator Agent

The core agent for price negotiation and sales interactions.

Overview

The Negotiator Agent is Hyperfold's flagship agent for handling buyer interactions. It implements the full ACP protocol, performs dynamic pricing, and manages multi-turn negotiations while protecting your margins.

Capabilities

NEGOTIATOR AGENT CAPABILITIES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ACP ENDPOINTS:
  POST /acp/search         Semantic product discovery
  POST /acp/quote          Price quotes and negotiation
  POST /acp/checkout/init  Initialize checkout
  POST /acp/checkout/finalize  Process payment

FEATURES:
  ✓ Dynamic pricing        Context-aware price calculation
  ✓ Multi-turn negotiation Accept, counter, reject logic
  ✓ Bundle suggestions     Cross-sell during negotiation
  ✓ Competitor awareness   Price matching capabilities
  ✓ Loyalty recognition    Tier-based discounts
  ✓ Margin protection      Never goes below floor price

INTEGRATIONS:
  • Firestore (product catalog, session state)
  • Redis (competitor prices, cache)
  • Cloud Spanner (real-time inventory)
  • Stripe (payment processing via SPT)

Deployment

Deploy a Negotiator Agent with a single command:

# Deploy reference negotiator agent
$ hyperfold agent deploy --type=negotiator --name="sales-bot-01"

> [Build] Using reference implementation...
> [Config] Loading default pricing policy...
> [Deploy] Creating Cloud Run service...
> [ACP] Registering endpoints...

 Negotiator agent deployed!

  Name:         sales-bot-01
  URL:          https://sales-bot-01-xyz.run.app
  ACP Manifest: https://sales-bot-01-xyz.run.app/.well-known/acp/manifest.json

# Deploy with custom configuration
$ hyperfold agent deploy --type=negotiator \
  --name="premium-sales" \
  --config=./agents/negotiator-config.yaml

# Deploy with custom prompt
$ hyperfold agent deploy --type=negotiator \
  --name="aggressive-sales" \
  --prompt-file=./prompts/aggressive.txt

Configuration

Customize agent behavior with a configuration file:

# negotiator-config.yaml
name: premium-sales-bot
type: negotiator
version: "1.0"

model:
  provider: openai
  model: gpt-4o
  temperature: 0.7

system_prompt: |
  You are a premium sales consultant for Acme Sports.
  Personality:
  - Professional and knowledgeable
  - Emphasize quality and value over discounts
  - Build relationships, not just transactions
  Goals:
  - Help customers find the perfect product
  - Protect margins while being fair
  - Suggest bundles that add genuine value
  Rules:
  - Never go below floor price
  - For Gold/Platinum members, lead with their tier discount
  - When inventory is low, create urgency honestly

pricing:
  policy_file: ./pricing-policy.yaml
  max_discount_percent: 25
  approval_threshold: 100
  tier_discounts:
    platinum: 0.15
    gold: 0.10
    silver: 0.05
  negotiation:
    accept_threshold: 0.95
    counter_increment: 0.05
    max_rounds: 4
    bundle_suggest_threshold: 0.8

capabilities:
  - negotiate
  - bundle
  - recommend

integrations:
  catalog: default
  payments: stripe
  crm: salesforce

resources:
  memory: 512Mi
  cpu: "1"
  max_instances: 20
  min_instances: 2

Negotiation Flow

How the Negotiator Agent handles a typical negotiation:

NEGOTIATION FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Buyer Agent                    Negotiator Agent
    │                                │
    │  1. Search "running shoes"     │
    │───────────────────────────────▶│
    │         8 products found       │
    │◀───────────────────────────────│
    │  2. Quote prod_aero_x2 @ $120  │
    │───────────────────────────────▶│
    │                                │ [load context]
    │                                │ [calculate dynamic price]
    │         Counter: $162          │
    │◀───────────────────────────────│
    │  3. Accept $162                │
    │───────────────────────────────▶│
    │         Ready for checkout     │
    │◀───────────────────────────────│
    │  4. Checkout + SPT             │
    │───────────────────────────────▶│
    │         Order #HF-12345         │
    │◀───────────────────────────────│

Agent Reasoning

View the agent's decision-making process:

# Agent reasoning during negotiation
[QUOTE] Product: AeroRun X2 (prod_aero_x2)
[QUOTE] Buyer offer: $120

[CONTEXT] Loading negotiation context...
  Customer: user_xyz (Gold tier)
  History: 12 orders, $2,450 lifetime value
  Product list price: $180
  Floor price: $82.80 (15% min margin)
  Competitor (Amazon): $165
  Inventory: 847 units (normal)

[CALC] Calculating dynamic price...
  Base price: $180.00
  Adjustments:
    - Gold tier discount: -$18.00 (-10%)
  Target price: $162.00
  Suggested counter: $162.00

[EVAL] Evaluating offer of $120...
  Offer vs floor: $120 > $82.80 ✓ Above floor
  Offer vs target: $120 < $162.00 ✗ Below target
  Decision: COUNTER_OFFER

[RESPONSE] counter_offer
  Price: $162.00
  Reasoning: "As a Gold member, you qualify for 10% off - that's $162,
             which also beats Amazon's price of $165."

Customization

Extend the reference agent with custom logic:

// Extend the reference negotiator
import { NegotiatorAgent, OnACPEvent } from '@hyperfold/actions-sdk';

@HyperfoldAgent({
  name: 'custom-negotiator',
  type: 'negotiator',
  extends: 'reference-negotiator',
})
export class CustomNegotiator extends NegotiatorAgent {

  @OnACPEvent('quote')
  async handleQuote(productId: string, offer: number, context: BuyerContext) {
    const isVIP = await this.checkVIPStatus(context.customer_id);

    if (isVIP) {
      return this.handleVIPQuote(productId, offer, context);
    }
    return super.handleQuote(productId, offer, context);
  }

  async handleVIPQuote(productId: string, offer: number, context: BuyerContext) {
    const product = await getProduct(productId);
    const vipPrice = product.pricing.list_price * 0.80;

    if (offer >= vipPrice) {
      return { status: 'accept', price: offer };
    }
    return {
      status: 'counter_offer',
      price: vipPrice,
      reasoning: 'As a VIP customer, enjoy our exclusive 20% discount.',
    };
  }

  @OnACPEvent('loyalty_check')
  async handleLoyaltyCheck(customerId: string) {
    const customer = await getCustomerProfile(customerId);
    return {
      tier: customer.loyalty.tier,
      points: customer.loyalty.points,
      next_tier: customer.loyalty.next_tier,
      benefits: this.getTierBenefits(customer.loyalty.tier),
    };
  }
}