Agent 서버 구축: 멀티테넌트 협상 PoC (UCB Q-Table 학습 + /chat + 14 API + 학습검증 하네스), config 단일화(local.toml) + 빌드 경량화

This commit is contained in:
HyeongBaeYang committed 2026-06-17 11:10:03 +09:00
1 parent 212725e5f9
commit 951d6eab84
140 files changed
+6689 -214

No files matched your search

@@ -0,0 +1,19 @@
{
"_comment": "내부 step → 클라이언트 표시 step 그룹 매핑(기능적 매핑, 브랜드 무관).",
"시작": "서비스안내",
"서비스안내": "서비스안내",
"담당자확인": "담당자확인",
"담당자확인_아니오": "담당자확인",
"정보변경_완료": "담당자확인",
"협상품목안내": "협상품목안내",
"기존가격제시": "가격협상",
"가격협상": "가격협상",
"가격협상_입력": "가격협상",
"가격협상_확인": "가격협상",
"가격협상_재입력": "가격협상",
"가격협상_확인_버짓": "가격협상",
"가격협상_와일드": "가격협상",
"협상완료": "협상종료",
"협상실패": "협상종료",
"협상종료": "협상종료"
}
@@ -0,0 +1,138 @@
{
"_comment": "재협상(renegotiation) 대화 스크립트. Chat_server 구조를 참고하되 브랜드/표현은 중립 재작성(CLEANROOM.md). {company_name}/{service_name} 및 변수는 ScriptRepository 가 치환.",
"시작": {
"script": "",
"editor_script_id": "시작",
"next_input_mode": "null",
"input_options": [],
"next_step": { "default": "서비스안내" },
"type": "null",
"chat_end": false
},
"서비스안내": {
"script": "안녕하세요. {company_name} {service_name}입니다. 본 서비스는 {company_name}와 협력사 간 물품 공급 가격 협상을 위한 것으로, 귀사가 공급 중인 품목의 새로운 가격 협상을 진행합니다. 안내 사항을 확인하신 뒤, 다음 단계로 넘어가려면 [확인]을 눌러 주세요.",
"editor_script_id": "서비스안내",
"next_input_mode": "confirm",
"input_options": ["확인"],
"next_step": { "default": "담당자확인" },
"type": "text",
"chat_end": false
},
"담당자확인": {
"script": "본 안내는 협력사 포털에 등록된 담당자에게 발송되었습니다. 구매 협상 담당자가 맞는지 다시 한 번 확인 부탁드립니다. 담당자가 맞다면 [예], 맞지 않다면 [아니오]를 선택해 주세요.",
"editor_script_id": "담당자확인",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "예": "협상품목안내", "아니오": "담당자확인_아니오" },
"type": "text",
"chat_end": false
},
"담당자확인_아니오": {
"script": "[아니오]를 선택하셨습니다. 담당자가 변경되어 정보를 수정하시려면 [정보변경]을, 실수로 선택하신 경우 다시 진행하려면 [돌아가기]를 선택해 주세요.",
"editor_script_id": "담당자확인_아니오",
"next_input_mode": "yes_no",
"input_options": ["돌아가기", "정보변경"],
"next_step": { "돌아가기": "담당자확인", "정보변경": "정보변경_완료" },
"type": "text",
"chat_end": false
},
"정보변경_완료": {
"script": "[정보변경]을 선택하셨습니다. 협력사 관리 시스템에서 담당자 정보를 변경하신 뒤, 고객센터로 새 견적 생성을 요청해 주세요. 24시간 이내에 갱신되지 않으면 참여 의사가 없는 것으로 간주되어 해당 견적 건이 미참여로 처리될 수 있습니다.",
"editor_script_id": "정보변경_완료",
"next_input_mode": "null",
"input_options": [],
"next_step": null,
"type": "text",
"chat_end": true
},
"협상품목안내": {
"script": "{company_name}는 귀사의 협력에 진심으로 감사드립니다. 이번 가격 협상 품목과 기본 정보를 안내드립니다. 좌측의 상품 정보를 확인해 주세요. 협상이 원만히 마무리되면 더 많은 협력 기회가 마련될 수 있습니다.",
"editor_script_id": "협상품목안내",
"next_input_mode": "confirm",
"input_options": ["확인"],
"next_step": { "확인": "기존가격제시" },
"type": "text",
"chat_end": false
},
"기존가격제시": {
"script": "현재 기준 가격 정보를 바탕으로 협상을 시작하겠습니다. 제안하실 가격을 입력해 주세요.",
"editor_script_id": "기존가격제시",
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인" },
"type": "text",
"chat_end": false
},
"가격협상_재입력": {
"script": "다시 제안하실 가격을 입력해 주세요.",
"editor_script_id": "가격협상_재입력",
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인" },
"type": "text",
"chat_end": false
},
"가격협상_확인": {
"script": "{input_price}원으로 제안하시겠습니까?",
"editor_script_id": "가격협상_확인",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": {
"예": [
{ "condition": "check_wildcard_entry", "next": "가격협상_와일드" },
{ "condition": "check_is_supplier_type_c", "next": "협상완료" },
{ "condition": "check_price_match", "next": "협상완료" },
{ "condition": "check_iteration_limit", "next": "협상실패" },
{ "condition": "default", "next": "가격협상" }
],
"아니오": "가격협상_재입력"
},
"type": "text",
"chat_end": false
},
"가격협상_확인_버짓": {
"script": "{target}원으로 제안하시겠습니까?",
"editor_script_id": "가격협상_확인_버짓",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "예": "협상완료", "아니오": "가격협상_재입력" },
"type": "text",
"chat_end": false
},
"가격협상": {
"script": "제안 감사합니다. 내부 검토 결과 추가 조정이 필요합니다. 다시 제안하실 가격을 입력해 주세요.",
"editor_script_id": "가격협상",
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인" },
"type": "text",
"chat_end": false
},
"협상완료": {
"script": "협조해 주신 덕분에 원만히 협상이 완료되었습니다. 협상 결과를 확인하신 뒤 동의해 주세요. 거래 약정에 따라 일부 조건이 조정될 수 있는 점 참고 부탁드립니다. 성실히 응해 주셔서 감사합니다.",
"editor_script_id": "협상완료",
"next_input_mode": "confirm",
"input_options": ["협상 내용을 확인했으며, 이의가 없음에 동의합니다."],
"next_step": { "default": "협상종료" },
"type": "text",
"chat_end": false
},
"협상실패": {
"script": "이번 협상은 합의에 이르지 못했습니다. 시간 내어 참여해 주셔서 감사합니다.",
"editor_script_id": "협상실패",
"next_input_mode": "null",
"input_options": [],
"next_step": { "default": "협상종료" },
"type": "text",
"chat_end": false
},
"협상종료": {
"script": "지금까지 {company_name} {service_name}를 통해 협상에 참여해 주셔서 감사합니다. 협상이 종료되었습니다.",
"editor_script_id": "협상종료",
"next_input_mode": "null",
"input_options": [],
"next_step": null,
"type": "text",
"chat_end": true
}
}
@@ -0,0 +1,147 @@
{
"_comment": "재견적(requote) 대화 스크립트. 신규 공급사 선정 흐름. 구조 보존 + 브랜드/표현 중립 재작성(CLEANROOM.md).",
"시작": {
"script": "",
"editor_script_id": "시작",
"next_input_mode": "null",
"input_options": [],
"next_step": { "default": "서비스안내" },
"type": "null",
"chat_end": false
},
"서비스안내": {
"script": "안녕하세요. {company_name} {service_name}입니다. 본 서비스는 {company_name}와 협력사 간 신규 물품 공급 협상을 위한 것으로, 귀사에 새로운 공급 기회를 제공하고자 합니다. 이용 방법 안내를 확인하신 뒤 [확인]을 눌러 주세요.",
"editor_script_id": "서비스안내",
"next_input_mode": "confirm",
"input_options": ["확인"],
"next_step": { "default": "담당자확인" },
"type": "text",
"chat_end": false
},
"담당자확인": {
"script": "본 안내는 협력사 포털에 등록된 담당자에게 발송되었습니다. 구매 협상 담당자가 맞는지 확인 부탁드립니다. 담당자가 맞다면 [예], 맞지 않다면 [아니오]를 선택해 주세요.",
"editor_script_id": "담당자확인",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "예": "협상품목안내", "아니오": "담당자확인_아니오" },
"type": "text",
"chat_end": false
},
"담당자확인_아니오": {
"script": "[아니오]를 선택하셨습니다. 담당자 정보를 변경하시려면 [정보변경]을, 다시 진행하려면 [돌아가기]를 선택해 주세요.",
"editor_script_id": "담당자확인_아니오",
"next_input_mode": "yes_no",
"input_options": ["돌아가기", "정보변경"],
"next_step": { "돌아가기": "담당자확인", "정보변경": "정보변경_완료" },
"type": "text",
"chat_end": false
},
"정보변경_완료": {
"script": "[정보변경]을 선택하셨습니다. 협력사 관리 시스템에서 담당자 정보를 변경하신 뒤 고객센터로 새 견적 생성을 요청해 주세요. 24시간 이내 갱신되지 않으면 미참여로 처리될 수 있습니다.",
"editor_script_id": "정보변경_완료",
"next_input_mode": "null",
"input_options": [],
"next_step": null,
"type": "text",
"chat_end": true
},
"협상품목안내": {
"script": "{company_name}는 아래 상품에 대해 신규 공급사를 선정하고 있으며, 귀사를 초대하여 견적을 요청드립니다. 제출하신 견적은 복수 업체와의 비교 평가를 통해 공급사 선정에 반영됩니다. 상품 정보를 확인해 주세요.",
"editor_script_id": "협상품목안내",
"next_input_mode": "confirm",
"input_options": ["네, 알겠습니다."],
"next_step": { "default": "가격제안" },
"type": "text",
"chat_end": false
},
"가격제안": {
"script": "제안 가격에 동의해 주시면 동의한 업체에 한하여 가격 경쟁을 진행합니다. 진행하시겠습니까?",
"editor_script_id": "가격제안",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "예": "배송형태선택", "아니오": "협상실패" },
"type": "text",
"chat_end": false
},
"협상실패": {
"script": "참여해 주셔서 감사합니다. 협상이 종료되었습니다.",
"editor_script_id": "협상실패",
"next_input_mode": "null",
"input_options": [],
"next_step": { "default": "협상종료" },
"type": "text",
"chat_end": false
},
"배송형태선택": {
"script": "배송 형태를 선택해 주세요.",
"editor_script_id": "배송형태선택",
"next_input_mode": "delivery_type",
"input_options": ["협력사배송", "지정택배배송", "픽업배송"],
"next_step": { "default": "가격협상_입력" },
"type": "text",
"chat_end": false
},
"가격협상_입력": {
"script": "제안하실 가격을 입력해 주세요.",
"editor_script_id": "가격협상_입력",
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인" },
"type": "text",
"chat_end": false
},
"가격협상_확인": {
"script": "{input_price}원으로 제안하시겠습니까?",
"editor_script_id": "가격협상_확인",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "예": "추가할인요청", "아니오": "가격재입력" },
"type": "text",
"chat_end": false
},
"가격재입력": {
"script": "다시 제안하실 가격을 입력해 주세요.",
"editor_script_id": "가격재입력",
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인" },
"type": "text",
"chat_end": false
},
"추가할인요청": {
"script": "추가 할인 여지가 있으신가요? 가능하시면 더 경쟁력 있는 제안을 부탁드립니다.",
"editor_script_id": "추가할인요청",
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "default": "결과안내" },
"type": "text",
"chat_end": false
},
"결과안내": {
"script": "협상 결과를 확인해 주세요. 투찰을 확정하시려면 [투찰확정], 정보를 수정하시려면 [정보수정]을 선택해 주세요.",
"editor_script_id": "결과안내",
"next_input_mode": "yes_no",
"input_options": ["투찰확정", "정보수정"],
"next_step": { "투찰확정": "결과제출", "정보수정": "가격제안" },
"type": "text",
"chat_end": false
},
"결과제출": {
"script": "협상 내용을 확인하신 뒤 동의해 주세요.",
"editor_script_id": "결과제출",
"next_input_mode": "confirm",
"input_options": ["협상 내용을 확인했으며, 이의가 없음에 동의합니다."],
"next_step": { "default": "협상종료" },
"type": "text",
"chat_end": false
},
"협상종료": {
"script": "지금까지 {company_name} {service_name}를 통해 협상에 참여해 주셔서 감사합니다. 협상이 종료되었습니다.",
"editor_script_id": "협상종료",
"next_input_mode": "null",
"input_options": [],
"next_step": null,
"type": "text",
"chat_end": true
}
}
@@ -0,0 +1,21 @@
{
"_comment": "와일드카드 분기 스크립트(1%인하 / 재원부족). 가격협상_확인의 check_wildcard_entry 조건에서 진입. 중립 재작성(CLEANROOM.md).",
"wild_card_1pct": {
"script": "제안해 주신 가격에 감사드립니다. 적극적으로 협조해 주신 덕분에 긍정적으로 검토되고 있습니다. 다만 내부 승인을 위해 조금 더 명분이 필요한 상황입니다. 약 1% 미만 추가 인하하여 {offer_1pct}원에 가능하실까요? 수락해 주신다면 즉시 우선협상 대상으로 검토하겠습니다.",
"type": "text",
"chat_end": false,
"next_input_mode": "yes_no",
"input_options": ["예", "아니오"],
"next_step": { "default": "협상완료" },
"editor_script_id": "wild_card_1pct"
},
"wild_card_budget": {
"script": "솔직히 말씀드리면 현재 내부 예산(재원) 사정상 제안을 그대로 수용하기 어렵습니다. 목표 매입가는 {target}원입니다. 이 가격에 맞춰 주신다면 즉시 계약을 진행하고자 합니다. 마지막으로 한 번 더 제안 부탁드립니다.",
"type": "text",
"chat_end": false,
"next_input_mode": "price",
"input_options": [],
"next_step": { "default": "가격협상_확인_버짓" },
"editor_script_id": "wild_card_budget"
}
}
@@ -0,0 +1,15 @@
{
"_comment": "표시 라벨 → 내부 변수 키 매핑(협상 feature 명, 기능적). 테넌트가 자사 라벨로 override 가능.",
"인터넷 최저가": "internet_min_price",
"앵커링 적용가": "anchoring_price",
"경쟁사 가격반영": "competitor_price_diff",
"거래기간": "trading_period",
"누적 거래 금액": "cumulative_amount",
"최근 1년간 총 거래 금액": "item_amount",
"1년간 거래액 비율": "item_ratio",
"고객 불만 발생 건수": "voc_count",
"협상 참여 응답 비율": "response_rate",
"상품 판매 기간": "product_sales_period",
"공급사 순위": "supplier_ranking",
"대금 지급 조건": "payment_terms"
}
+65
View File
@@ -0,0 +1,65 @@
# 공유 베이스 정책 (계획서 D). 신규 테넌트 cold-start 의 기준값.
# 모든 값은 우리 플랫폼의 중립 기본값이다(CLEANROOM.md). 특정 고객 운영값 복제 아님.
# 실제 운영값은 각 테넌트 YAML/DB 에서 주입한다. 차원 개수만 기능적 설계, 값/라벨은 우리 선택.
tenant_id: _base
inherits_base: false # 베이스는 자기 자신을 상속하지 않음
name: "Shared Base Policy"
state:
revenue:
thresholds: [10000000, 50000000] # 플랫폼 중립 기본 구간
weights: [0.3, 0.6, 1.0]
descriptions: ["low", "mid", "high"]
distribution:
code_map: {A: 0, B: 1, C: 2} # 중립 예시 코드(테넌트가 자사 코드로 오버라이드)
weights: [0.3, 0.6, 1.0]
descriptions: ["channel_a", "channel_b", "channel_c"]
partner:
weights: [0.5, 1.0, 0.3] # single, multiple, none
descriptions: ["single", "multiple", "none"]
acceptance:
thresholds: [0.03, 0.09]
weights: [0.3, 0.6, 1.0]
descriptions: ["low", "mid", "high"]
price_zone:
weights: [1.0, 0.5] # at_or_below_anchor(우선협상), above_anchor(협상지속)
descriptions: ["at_or_below_anchor", "above_anchor"]
# state_space_size 는 차원 곱으로 자동 산출: 3×3×3×3×2 = 162
reward:
beta: 0.2
success_reward: 1.0
ongoing_reward: 0.0
failure_penalty: -0.5
penalty_lambda: 0.02
w1: 0.2
w2: 0.2
w3: 0.2
w4: 0.2
w5: 0.2
min_weight: 0.2
max_weight: 0.8
policy:
type: ucb
learning_rate: 0.1 # 표준 기본값
gamma: 0.95
params:
exploration_constant: 1.4142135623730951 # sqrt(2) — 표준 UCB 상수
epsilon: 1.0e-6
action_mapping:
type: file
action_to_card: {} # 베이스는 카드 매핑 없음 — 테넌트가 자사 카탈로그로 supply
cards:
source_type: file
sync_interval_seconds: 300
connection: {}
llm:
enabled: false
resources:
language: ko
scripts_dir: resources