Negotiation Protocol

2026-08-30 浏览 (1)

Negotiation Protocol

比较查询和跨领域问题的处理协议

When to Enable Negotiation

For complex queries requiring structured agent responses, enable negotiation mode.

Query PatternEnable NegotiationReason
Single error code lookupNoDirect answer
Single crate versionNoDirect lookup
"Compare X and Y"YesMulti-faceted
Domain + errorYesCross-layer context
"Best practices for..."YesRequires synthesis
Ambiguous scopeYesNeeds clarification
Multi-crate questionYesMultiple sources

Negotiation Decision Flow

Query Received
     │
     ▼
┌─────────────────────────────┐
│ Is query single-lookup?     │
│ (version, error code, def)  │
└─────────────────────────────┘
     │
     ├── Yes → Direct dispatch (no negotiation)
     │
     ▼ No
┌─────────────────────────────┐
│ Does query require:         │
│ - Comparison?               │
│ - Cross-domain context?     │
│ - Synthesis/aggregation?    │
│ - Multiple sources?         │
└─────────────────────────────┘
     │
     ├── Yes → Dispatch with negotiation: true
     │
     ▼ No
┌─────────────────────────────┐
│ Is scope ambiguous?         │
└─────────────────────────────┘
     │
     ├── Yes → Dispatch with negotiation: true
     │
     ▼ No
     └── Direct dispatch (no negotiation)

Negotiation Dispatch

When dispatching with negotiation:

1. Set `negotiation: true`
2. Include original query context
3. Expect structured response:
   - Findings
   - Confidence (HIGH/MEDIUM/LOW/UNCERTAIN)
   - Gaps identified
   - Context questions (if any)
4. Evaluate response against original intent

Orchestrator Evaluation

After receiving negotiation response:

ConfidenceIntent CoverageAction
HIGHCompleteSynthesize answer
HIGHPartialMay need supplementary query
MEDIUMCompleteAccept with disclosed gaps
MEDIUMPartialRefine with context
LOWAnyRefine or try alternative
UNCERTAINAnyTry alternative or escalate

Refinement Loop

If response insufficient:

Round 1: Initial query
  │
  ▼ (LOW confidence or gaps block intent)
Round 2: Refined query with:
  - Answers to agent's context questions
  - Narrowed scope
  │
  ▼ (still insufficient)
Round 3: Final attempt with:
  - Alternative agent/source
  - Maximum context provided
  │
  ▼ (still insufficient)
Synthesize best-effort answer with disclosed gaps

Integration with 3-Strike Rule

Negotiation follows the 3-Strike escalation:

Strike 1: Initial query returns LOW confidence
  → Refine with more context

Strike 2: Refined query still LOW
  → Try alternative agent/source

Strike 3: Still insufficient
  → Synthesize best-effort answer
  → Report gaps to user explicitly

See _meta/error-protocol.md for full escalation rules.

Negotiation Routing Examples

Example 1: No Negotiation Needed

Query: "What is tokio's latest version?"
Analysis: Single lookup
Action: Direct dispatch to crate-researcher

Example 2: Negotiation Required

Query: "Compare tokio and async-std for a web server"
Analysis: Comparative + domain context
Action: Dispatch with negotiation: true
Expected: Structured responses from both runtime lookups
Evaluation: Check if web-server specific data found

Example 3: Cross-Domain Negotiation

Query: "E0382 in my trading system"
Analysis: Error code + domain context
Action:
  - Dispatch m01-ownership (standard - error is defined)
  - Dispatch domain-fintech (negotiation: true - domain context)
Synthesis: Combine error explanation with domain-appropriate fix

Related Documents

  • _meta/negotiation-protocol.md - Full protocol specification
  • _meta/negotiation-templates.md - Response templates
  • _meta/error-protocol.md - 3-Strike escalation
  • agents/_negotiation/response-format.md - Agent response format

你可能感兴趣的文章

Agent Cache System

Rust Skills Tests

Agent Integration Test Scenarios

Domain Skills Test Scenarios

Rust-Router Test Scenarios

Ownership (m01) Test Scenarios

Unsafe-Checker Test Scenarios

Layer 2 Skills Test Scenarios

Pressure Scenario: When to Use unwrap()

Pressure Scenario: Send/Sync Trait Bounds

  • 所属分类: AI
  • 本文标签: rust
  • 版权声明: 本文链接 https://seaxiang.com/blog/mDyQpiz6