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.
The reference Negotiator Agent can be deployed directly or extended with custom logic. Most deployments start with the reference implementation and customize as needed.
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:
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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.txtConfiguration
Customize agent behavior with a configuration file:
yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# negotiator-config.yamlname: premium-sales-bottype: negotiatorversion: "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 - If asked about competitors, focus on our value, not their flaws pricing: policy_file: ./pricing-policy.yaml max_discount_percent: 25 approval_threshold: 100 # Tier discounts tier_discounts: platinum: 0.15 gold: 0.10 silver: 0.05 # Negotiation behavior negotiation: accept_threshold: 0.95 # Accept at 95% of target counter_increment: 0.05 # Counter 5% lower each round max_rounds: 4 bundle_suggest_threshold: 0.8 # Suggest bundles when margin < 80% capabilities: - negotiate - bundle - recommend integrations: catalog: default payments: stripe crm: salesforce resources: memory: 512Mi cpu: "1" max_instances: 20 min_instances: 2Negotiation Flow
How the Negotiator Agent handles a typical negotiation:
NEGOTIATION FLOW
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Buyer Agent Negotiator Agent
│ │
│ 1. Search "running shoes" │
│───────────────────────────────▶│
│ │ [semantic search]
│ 8 products found │
│◀───────────────────────────────│
│ │
│ 2. Quote prod_aero_x2 @ $120 │
│───────────────────────────────▶│
│ │ [load context]
│ │ [calculate dynamic price]
│ │ [evaluate offer]
│ │
│ Counter: $162 │
│◀───────────────────────────────│
│ │
│ 3. Accept $162 │
│───────────────────────────────▶│
│ │
│ Ready for checkout │
│◀───────────────────────────────│
│ │
│ 4. Checkout + SPT │
│───────────────────────────────▶│
│ │ [validate SPT]
│ │ [process payment]
│ │ [create order]
│ │
│ Order #HF-12345 │
│◀───────────────────────────────│Agent Reasoning
View the agent's decision-making process:
text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 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 Product cost: $72 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%) - Beat competitor by $3: -$0.00 (already below) 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 [THOUGHT] The buyer offered $120, which is above my floor of $82.80, so it's technically acceptable. However, my target is $162 based on their Gold status. I'll counter at $162 with a compelling reason. [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:
typescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Extend the reference negotiatorimport { NegotiatorAgent, OnACPEvent } from '@hyperfold/actions-sdk'; @HyperfoldAgent({ name: 'custom-negotiator', type: 'negotiator', extends: 'reference-negotiator',})export class CustomNegotiator extends NegotiatorAgent { // Override quote handling @OnACPEvent('quote') async handleQuote(productId: string, offer: number, context: BuyerContext) { // Add custom logic before standard handling const isVIP = await this.checkVIPStatus(context.customer_id); if (isVIP) { // VIPs get special treatment return this.handleVIPQuote(productId, offer, context); } // Fall back to standard negotiation return super.handleQuote(productId, offer, context); } // Add custom VIP logic async handleVIPQuote(productId: string, offer: number, context: BuyerContext) { const product = await getProduct(productId); const vipPrice = product.pricing.list_price * 0.80; // 20% VIP discount if (offer >= vipPrice) { return { status: 'accept', price: offer }; } return { status: 'counter_offer', price: vipPrice, reasoning: 'As a VIP customer, enjoy our exclusive 20% discount.', }; } // Add new capability @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), }; }}See Fulfillment Agent for post-purchase automation.