Skip to main content
. 2025 Aug 27;14(17):3004. doi: 10.3390/foods14173004
Algorithm 6 LLM-Mediated Agent Negotiation Protocol
  •   1:

    Input: Agents A1, A2; initial offers O1, O2; LLM model L; negotiation limit T

  •   2:

    Output: Final agreement A or failure

  •   3:

    Initialize history buffer H

  •   4:

    fort=1 to T do

  •   5:

        A1 generates offer O1t based on local state and preferences

  •   6:

        A2 generates counter-offer O2t based on prior offer and utility evaluation

  •   7:

        Append (O1t,O2t) to H

  •   8:

        StL(H)

▹ LLM summarizes intents and preferences
  •   9:

        Compute utility scores U1,U2 from St

  • 10:

          if U1τ1 and U2τ2 then

  • 11:

              return Agreement A(O1t,O2t,St)

  • 12:

          else

  • 13:

              Agents update proposal strategy based on feedback or regret

  • 14:

          end if

  • 15:

    end for

  • 16:

    return Negotiation failed