SK-Intellix Reactive and Proactive Operation
이 문서는 SK-Intellix의 reactive / proactive 동작 축을 정리한다.
기존 A2A 설명은 주로 “사용자가 말하면 Cloud가 판단하고 실행한다”는 reactive voice-turn 중심이었다. 하지만 실제 Cloud repo에는 proactive request branch, proactive feedback branch, proactive planner/runtime/assets/schema가 존재한다. 따라서 위키에도 reactive/proactive를 별도 운영 모드로 포함해야 한다.
1. 배경
SK-Intellix가 단순 음성 명령 시스템에서 context-aware 기기/로봇 brain으로 확장되려면 두 가지 입력 모드를 모두 다뤄야 한다.
| 모드 | 시작점 | 예시 |
|---|---|---|
| Reactive | 사용자의 명시 발화 | “거실 청정해줘”, “오늘 날씨 어때”, “안방으로 가” |
| Proactive | 센서/상태/정책/루틴 signal | 공기질 악화, 배터리 부족, 반복 루틴 감지, 장애물/위치 변화 |
즉 proactive는 reactive를 대체하는 것이 아니라, planner를 깨우는 입력 원천을 늘리는 것이다.
2. 왜 필요한가
| 문제 | Reactive만 있을 때 한계 | Proactive 확장 이점 |
|---|---|---|
| 사용자가 상태 변화를 모를 수 있음 | 사용자가 먼저 물어보거나 명령해야 한다. | 기기가 중요한 변화나 위험을 먼저 감지하고 제안할 수 있다. |
| 반복 루틴을 매번 말해야 함 | 매번 같은 명령을 반복한다. | 사용 패턴/정책 기반으로 추천, 확인, 예약, 자동 실행 후보를 만들 수 있다. |
| 환경 변화 대응이 늦음 | 공기질/장애물/배터리 같은 상태를 사용자가 모르면 대응이 늦다. | signal 기반으로 조기 대응하거나 사용자 확인을 요청할 수 있다. |
| 메모리 피드백이 약함 | 명령 결과만 저장된다. | proactive recommendation 수락/거절이 preference와 policy로 되돌아간다. |
3. 현재 Cloud 구현 근거
현재 Cloud Lambda는 아래 request kind를 분기한다.
| request kind | 의미 | 구현 근거 |
|---|---|---|
task_event |
Device task event 처리 및 필요 시 Cloud step resume/replan | lambda_function.py |
proactive_feedback |
proactive 추천/실행 결과를 feedback으로 받아 memory/policy에 반영 | lambda_function.py, src/objects.py |
proactive |
signal bundle 기반 proactive orchestration 실행 | lambda_function.py, src/objects.py |
| 일반 voice turn | reactive user utterance 처리 | lambda_function.py, CloudLLMRequest |
현재 작업 브랜치에서 확인된 source:
lambda_function.py
src/objects.py
gemini/a2a/runtime/__init__.py
주의:
현재 작업 브랜치(feature_a2a_task_orchestration_cloud)에는 proactive request/feedback 분기와 import fallback 흔적은 있다.
하지만 gemini/a2a/proactive, agents/proactive, runtime/proactive_* 원본 .py/schema 파일은 현재 브랜치에 없고 __pycache__만 남아 있다.
따라서 proactive 실제 구현 source는 proactive_planner 브랜치와 통합/복원 대조가 필요하다.
proactive_planner 브랜치에서 확인된 source:
gemini/a2a/agents/proactive/planner_api.py
gemini/a2a/proactive/candidate_builder.py
gemini/a2a/proactive/decision_validator.py
gemini/a2a/proactive/dispatch_composer.py
gemini/a2a/proactive/execution_arbiter.py
gemini/a2a/proactive/models.py
gemini/a2a/proactive/risk_policy.py
gemini/a2a/proactive/rollout_policy.py
gemini/a2a/proactive/trigger_gate.py
gemini/a2a/proactive/assets/mini_proactive_planner.system_prompt.txt
gemini/a2a/proactive/assets/mini_proactive_planner.response_schema.json
gemini/a2a/proactive/assets/proactive_lambda_request.schema.json
gemini/a2a/proactive/assets/proactive_lambda_response.schema.json
gemini/a2a/proactive/assets/proactive_feedback_request.schema.json
gemini/a2a/proactive/assets/proactive_feedback_response.schema.json
gemini/a2a/proactive/assets/dispatch/*.schema.json
gemini/a2a/proactive/assets/shared_context/*.schema.json
gemini/a2a/registry/proactive_capability_policy.json
gemini/a2a/runtime/proactive_orchestrator.py
gemini/a2a/runtime/proactive_feedback_handler.py
test/test_lambda_proactive_handler.py
test/test_proactive_candidate_builder.py
test/test_proactive_execution_arbiter.py
test/test_proactive_feedback_handler.py
test/test_proactive_orchestrator.py
test/test_proactive_planner_api.py
test/test_proactive_trigger_gate.py
4. Reactive 흐름
Reactive는 사용자가 먼저 말하는 흐름이다.
user speech
-> STT recognized_text
-> voice_context / device_context / memory_snapshot
-> A2A planner
-> Agent/Skill step
-> Cloud-only answer 또는 device_task_requests
-> On-device Bridge / DeviceAgent TaskManager
-> task_event / memory update
대표 특징:
- 현재 발화가 최상위 입력이다.
- STT_NULL guard가 먼저 동작한다.
- 필요한 경우 multi-turn follow-up을 묻는다.
- device 실행은 ODL/device step으로 내려간다.
5. Proactive 흐름
Proactive는 user speech 없이 signal bundle이 먼저 들어오는 흐름이다.
sensor / state / policy / routine signal
-> signal_bundle
-> trigger gate / candidate builder
-> mini proactive planner
-> decision validator / execution arbiter
-> dispatch composer
-> recommend / ask_confirmation / execute / create_schedule / suppress
-> proactive feedback
-> memory / preference policy update
5.1 Proactive 단계별 책임
proactive_planner 브랜치 기준 proactive는 아래 단계로 나뉜다.
| 단계 | 모듈 | 입력 | 출력 | 책임 |
|---|---|---|---|---|
| 1 | NormalizedSignalBundle |
raw signal_bundle |
normalized signal facts | sensor/state/policy signal 정규화 |
| 2 | candidate_builder |
normalized bundle | ProactiveCandidate |
어떤 proactive family 후보인지 결정 |
| 3 | trigger_gate |
candidate + context digest | allow, drop, recommendation_only |
confidence, cooldown, pending confirmation, quiet hours, rollout gate |
| 4 | ContextRetriever |
device_id, trigger_family | short/mid/profile/policy context | planner/arbiter가 쓸 context 로딩 |
| 5 | mini proactive planner | compact facts | suppress, recommend, ask_confirmation, execute, create_schedule |
후보 action 결정 |
| 6 | decision_validator |
planner decision | normalized valid decision | schema/decision safety 검증 |
| 7 | execution_arbiter |
manual decision, proactive decision, context | accept/replace/drop arbitration | reactive/manual 우선순위, 자동실행 허용 여부 판단 |
| 8 | dispatch_composer |
final decision | dispatch payload | on-device/channel payload 생성 |
| 9 | execution_dispatch_bridge |
dispatch payload | delivery result | dry-run 또는 HTTP downstream 전달 |
| 10 | proactive_feedback_handler |
feedback event | memory write plan | 수락/거절/성공 결과를 memory/policy로 환류 |
5.2 Candidate family 예시
candidate_builder는 event type을 proactive trigger family로 매핑한다.
| event type | trigger family | 의미 |
|---|---|---|
air_quality_degraded |
air_quality_response |
공기질 악화에 대한 청정/제안 후보 |
repeated_air_quality_night_degradation |
air_quality_routine |
반복되는 야간 공기질 악화 루틴 후보 |
person_absent_persistent |
privacy_response |
사람 부재/프라이버시 관련 대응 후보 |
privacy_sensitive_scene_detected |
privacy_response |
민감 장면 감지 대응 후보 |
privacy_guard_activated |
privacy_response |
프라이버시 가드 활성화 |
mute_enabled |
privacy_response |
음소거 상태에서 proactive 안내 제한 |
voice_recognition_disabled |
privacy_response |
음성 인식 비활성 상태 |
voice_volume_zero |
privacy_response |
음성 출력 불가 상태 |
5.3 Trigger Gate 기준
Trigger gate는 모든 signal을 action 후보로 보내지 않는다.
| gate 조건 | 처리 |
|---|---|
| signal 없음 | drop: empty_candidate |
| confidence < 0.7 | drop: low_confidence |
| 같은 family pending confirmation 존재 | drop |
| proactive confirmation이 이미 pending | drop |
| cooldown hit | drop |
| 최근 같은 family rejection 존재 | recommendation_only |
| rule performance가 negative feedback으로 나쁨 | recommendation_only |
| rollout mode가 recommendation only | recommendation_only |
| family policy가 recommendation only | recommendation_only |
| quiet hours이고 priority가 high가 아님 | recommendation_only |
이 기준 때문에 proactive는 기본적으로 보수적으로 동작한다.
5.4 Mini Proactive Planner 기준
Mini proactive planner prompt의 핵심 원칙:
Use only the compact input facts.
Do not invent missing sensor or user facts.
If uncertainty is high, prefer suppress or recommend.
If the action is privacy-sensitive or high-risk, prefer ask_confirmation.
즉 proactive planner는 “똑똑하게 먼저 실행하는 모델”이 아니라, 제한된 사실 안에서 안전한 decision을 고르는 좁은 planner다.
5.5 Execution Arbiter 기준
Execution arbiter는 proactive decision을 그대로 통과시키지 않는다.
| 상황 | 처리 |
|---|---|
| manual decision 존재 | proactive drop, manual planner 우선 |
| active manual workflow 존재 | proactive drop |
| interaction channel suppressed | recommend/confirmation은 drop 또는 silent execute 후보 |
| rollout recommendation only | execute/create_schedule을 recommendation으로 낮춤 |
| rollout confirmation first | execute/create_schedule을 confirmation으로 낮춤 |
| family policy confirmation required | confirmation으로 낮춤 |
| family가 auto execute 미허용 | recommendation으로 낮춤 |
| user profile이 auto execute block | recommendation으로 낮춤 |
| user profile이 confirm before execute | confirmation으로 낮춤 |
| silent execution 허용 family + interaction suppressed | execute로 올릴 수 있음 |
핵심은 proactive planner의 결정을 safety/profile/policy가 다시 중재한다는 점이다.
대표 decision:
| decision | 의미 |
|---|---|
recommend |
사용자에게 제안만 한다. |
ask_confirmation |
실행 전 확인을 요청한다. |
execute |
정책상 허용되는 경우 실행한다. |
create_schedule |
루틴/예약 후보를 만든다. |
suppress |
알림/실행하지 않는다. |
6. Reactive와 Proactive의 경계
| 구분 | Reactive | Proactive |
|---|---|---|
| trigger | 사용자 발화 | 센서/상태/정책/루틴 signal |
| primary input | recognized_text |
signal_bundle |
| user intent | 명시적 | 추론/후보 |
| 위험 | STT 오분류, context 오해 | false proactive, 과도한 알림, 원치 않는 자동 실행 |
| safety | STT_NULL, capability, device_context | trigger gate, risk policy, rollout policy, confirmation |
| output | answer, device task, follow-up | recommendation, confirmation, execution, schedule, suppress |
| feedback | 대화/작업 결과 | accept/reject/ignore/execute result |
핵심 원칙:
- proactive는 기본적으로 보수적으로 시작한다.
- 모든 proactive event가 action으로 가면 안 된다.
recommend또는ask_confirmation이 기본이며,execute는 policy/profile/safety가 허용할 때만 가능하다.- 사용자가 발화하면 reactive turn이 우선한다.
7. Proactive Request / Response 계약
7.1 Proactive request
Proactive request는 request_kind=proactive이거나 signal_bundle이 있으면 감지된다.
{
"request_kind": "proactive",
"device_id": "device_001",
"signal_bundle": {
"bundle_id": "bundle_001",
"device_id": "device_001",
"observed_at": "2026-04-06T12:00:00+09:00",
"signals": [
{
"event_type": "air_quality_degraded",
"event_family": "environment_change",
"severity": "medium",
"confidence": 0.94,
"duration_sec": 420,
"metrics": {
"value": 86,
"threshold": 60
},
"tags": ["persistent", "indoor"]
}
],
"device_state": {
"mode": "idle"
},
"user_context": {
"quiet_hours": false
},
"policy_context": {
"rollout_mode": "RECOMMENDATION_ONLY"
}
},
"manual_decision": {},
"request_meta": {
"source": "sensor_policy",
"rule_id": "air_quality_pm10_persistent"
}
}
7.2 Proactive response
{
"request_kind": "proactive",
"device_id": "device_001",
"proactive": {
"status": "ok",
"trace_id": "trace_xxx",
"candidate_id": "pc_xxx",
"gate_decision": "allow",
"gate_reason": "gate_passed",
"arbitration": {
"decision": "accept_proactive_only",
"winner": "proactive_planner",
"reason": "proactive_allowed"
},
"decision": "recommend",
"payload": {
"decision_type": "recommend",
"action_family": "air_quality_response",
"selected_capability_id": "air_cleaning.auto",
"utterance": "공기질이 나빠졌어요. 청정을 시작할까요?"
},
"delivery": {
"delivery_mode": "dry_run",
"status": "ok"
}
}
}
7.3 Dispatch channel
| decision | channel |
|---|---|
recommend |
ondevice.proactive.recommendation |
ask_confirmation |
ondevice.proactive.confirmation |
execute |
ondevice.proactive.execute |
create_schedule |
ondevice.proactive.schedule |
suppress |
none |
8. Proactive Feedback 계약
Proactive feedback은 recommendation/confirmation/execute 결과를 memory/policy로 되돌리는 경로다.
8.1 Feedback request
{
"request_kind": "proactive_feedback",
"device_id": "device_001",
"feedback_event": {
"event_type": "recommendation_accepted",
"device_id": "device_001",
"action_family": "air_quality_response",
"trace_id": "trace_abc",
"dispatch_type": "recommendation",
"decision_type": "recommend",
"selected_capability_id": "air_cleaning.auto",
"explicit_user_preference": true,
"signal_trace": {
"bundle_id": "bundle_001",
"event_type": "air_quality_degraded",
"rule_id": "air_quality_pm10_persistent"
}
}
}
8.2 Feedback 처리
proactive_feedback_handler는 feedback을 정규화하고 promotion gate를 통해 memory target을 결정한다.
| feedback | short-term | mid-term | long-term profile |
|---|---|---|---|
| 일회성 수락/거절 | 기록 | 조건부 | 보통 아님 |
| 반복 수락 | 기록 | 가능 | 명시 선호면 가능 |
| 반복 거절 | 기록 | 가능 | 자동 실행 차단 선호 후보 |
| silent execute 성공 반복 | 기록 | 가능 | silent execution 선호 후보 |
| explicit user preference | 기록 | 가능 | 가능 |
이 feedback loop가 있어야 proactive가 단순 rule engine이 아니라 사용자 반응을 학습하는 구조가 된다.
9. Context-aware와의 관계
Context-aware는 reactive와 proactive의 공통 기반이다.
| context | reactive에서의 역할 | proactive에서의 역할 |
|---|---|---|
| user context | 발화 의도와 선호 해석 | 알림/자동실행 허용 여부 판단 |
| device context | 실행 가능성 판단 | signal 해석과 action 가능성 판단 |
| task/workflow context | 이어지는 명령/slot 처리 | 진행 중 작업과 충돌 방지 |
| safety context | 위험 동작 차단 | proactive 자동 실행 veto |
| memory/profile | 반복 선호 반영 | recommendation/feedback 기반 policy 갱신 |
| policy context | capability/지원 범위 | rollout, risk, confirmation policy |
따라서 proactive를 하려면 단순 trigger rule만 있으면 안 된다. grounded_state, context provider, safety layer, preference policy가 함께 필요하다.
10. 구축 이점
| 이점 | 설명 |
|---|---|
| 사용자 부담 감소 | 반복 명령이나 상태 확인을 사용자가 매번 말하지 않아도 된다. |
| 환경 변화 대응 | 공기질, 배터리, 위치, 장애물 등 상태 변화에 빠르게 반응할 수 있다. |
| 개인화 강화 | proactive feedback이 memory/profile/policy로 되돌아가 장기 선호를 만든다. |
| 실행 안전성 | risk policy와 confirmation policy로 과도한 자동 실행을 막는다. |
| 운영 확장성 | reactive voice turn과 proactive signal turn을 같은 A2A/TaskManager 생태계에 얹을 수 있다. |
| 제품 경험 향상 | “시키면 하는 기기”에서 “상황을 이해하고 적절히 제안하는 기기”로 확장된다. |
11. 운영 리스크와 대응
| 리스크 | 설명 | 대응 |
|---|---|---|
| false proactive | 필요 없는 제안이 반복됨 | confidence gate, cooldown, recent rejection, suppress/recommend 기본값 |
| 과도한 자동 실행 | 사용자가 원치 않는 동작 실행 | recommendation/confirmation-first, family policy, auto execute allowlist |
| privacy 침해 | 민감 상황에서 음성/화면 알림 발생 | privacy mode, mute, voice recognition off, interaction suppressed gate |
| manual workflow 방해 | 사용자가 진행 중인 명령을 proactive가 끊음 | manual decision / active workflow 우선 |
| feedback 오염 | 일회성 반응이 long-term preference가 됨 | promotion gate, explicit preference, repeated evidence 기준 |
| source drift | proactive 브랜치 소스가 현재 브랜치와 어긋남 | Source/Evidence Catalog에 브랜치별 근거와 통합 필요 항목 기록 |
12. 검증 시나리오
| 검증 | 입력 | 기대 |
|---|---|---|
| low confidence signal | confidence 0.4 | drop: low_confidence |
| pending confirmation | 같은 family pending | drop |
| quiet hours medium priority | quiet_hours true, medium | recommendation_only |
| rollout recommendation only | execute 후보 | recommendation으로 낮춤 |
| manual decision 우선 | manual_decision 존재 | proactive drop |
| privacy mode | interaction suppressed | recommend/confirmation drop 또는 허용된 silent execute |
| recommendation accepted | feedback event | short-term 기록, 조건부 mid/long promotion |
| repeated rejection | 같은 family 반복 거절 | future gate에서 recommendation_only/drop 강화 |
13. 브랜치 통합 체크리스트
현재 위키 기준으로 proactive를 실제 제품 구조에 포함하려면 아래를 확인해야 한다.
| 체크 | 기준 |
|---|---|
| source 복원 | proactive_planner 브랜치의 gemini/a2a/proactive/*, agents/proactive/*, runtime/proactive_*가 현재 작업 브랜치에 통합되어야 한다. |
| schema 복원 | proactive request/response/feedback/dispatch/shared_context schema가 현재 브랜치에 있어야 한다. |
| Lambda 분기 정합성 | 현재 lambda_function.py의 proactive branch가 실제 runtime import와 맞아야 한다. |
| tests 복원 | test/test_proactive_*, test/test_lambda_proactive_handler.py, shared_context tests가 통합되어야 한다. |
| dispatch 계약 | On-device Bridge가 ondevice.proactive.* channel을 소비할 수 있어야 한다. |
| feedback writeback | shared_context writer 또는 DB/profile adapter와 연결되어야 한다. |
| policy 설정 | rollout/family policy/profile automation preference 기본값이 제품 정책과 맞아야 한다. |
14. 실제 시나리오
14.1 Reactive 복합제어
사용자 발화:
거실로 갔다가 안방으로 이동해서 청정해줘
처리 흐름:
| 단계 | 처리 |
|---|---|
| 1 | STT가 recognized_text를 만든다. |
| 2 | Cloud A2A planner가 device-only multi-step plan을 만든다. |
| 3 | ODL/device step이 device_task_requests로 변환된다. |
| 4 | On-device Bridge가 workflow를 순차 실행한다. |
| 5 | DeviceAgent TaskManager가 이동 task 완료 후 다음 task를 unlock한다. |
| 6 | COMPLETED, WORKFLOW_COMPLETED는 Cloud에 올라와도 기본적으로 LLM replan을 하지 않는다. |
| 7 | FAILED, BLOCKED, PAUSED, NEEDS_USER_INPUT이면 reason code 기반으로 Cloud replan 후보가 된다. |
이 시나리오는 reactive voice turn이다. 사용자가 직접 명령했고, planner는 발화 기반 plan을 만든다.
14.2 Proactive 공기질 제안
Signal:
air_quality_degraded, confidence=0.94, duration_sec=420
처리 흐름:
| 단계 | 처리 |
|---|---|
| 1 | Device/Policy layer가 signal bundle을 Cloud로 보낸다. |
| 2 | Candidate builder가 air_quality_response 후보를 만든다. |
| 3 | Trigger gate가 confidence, cooldown, quiet hours, pending confirmation을 검사한다. |
| 4 | Mini proactive planner가 recommend 또는 ask_confirmation을 선택한다. |
| 5 | Execution arbiter가 자동 실행 가능 여부를 다시 낮추거나 통과시킨다. |
| 6 | Dispatch composer가 ondevice.proactive.recommendation 또는 confirmation payload를 만든다. |
| 7 | 사용자가 수락/거절하면 feedback handler가 short/mid/long memory 후보로 기록한다. |
이 시나리오는 proactive signal turn이다. 사용자가 말하지 않았고, signal이 planner를 깨운다.
14.3 Reactive가 Proactive를 이기는 경우
상황:
공기질 악화 signal이 들어왔지만 사용자가 동시에 "안방으로 와"라고 발화한다.
처리 원칙:
| 조건 | 처리 |
|---|---|
| 사용자 발화가 active manual decision을 만든다. | reactive/manual workflow 우선 |
| proactive candidate가 있어도 manual workflow와 충돌한다. | proactive drop 또는 suppress |
| proactive 알림이 사용자 발화를 끊을 수 있다. | interaction channel suppressed로 처리 |
| proactive가 중요한 safety signal이다. | 정책에 따라 silent record 또는 후속 recommendation 후보로 유지 |
핵심은 proactive가 사용자 발화 흐름을 방해하지 않아야 한다는 점이다.
15. 제품화 체크포인트
Reactive/proactive를 제품화하려면 아래 경계가 닫혀야 한다.
| 체크포인트 | 질문 | 완료 증거 |
|---|---|---|
| 입력 감지 | request가 reactive인지 proactive인지 안정적으로 구분되는가 | request_kind, signal_bundle, CloudLLMRequest fixture |
| source 통합 | proactive source/schema/tests가 현재 제품 브랜치에 존재하는가 | proactive_planner 대조 diff와 test run |
| false positive 방지 | 의미 없는 signal이 recommendation으로 남발되지 않는가 | trigger gate low-confidence/cooldown/pending tests |
| 자동 실행 제한 | execute/create_schedule이 정책 없이 통과하지 않는가 | execution arbiter tests |
| feedback 환류 | 수락/거절/무시가 memory/policy로 들어가는가 | proactive feedback fixture와 store write evidence |
| device dispatch | On-device가 proactive channel을 구분해 소비하는가 | ondevice.proactive.* payload dry-run |
| manual 우선순위 | 사용자 발화/진행 중 workflow가 proactive보다 우선하는가 | active manual workflow arbitration test |
| 관측성 | 어떤 signal이 어떤 결정으로 이어졌는지 추적 가능한가 | trace_id, candidate_id, signal_trace log |
16. 위키 내 위치
Reactive/proactive는 아래 문서들과 연결된다.
| 연결 문서 | 관계 |
|---|---|
| Speech-LLM Context-Aware A2A Architecture | reactive voice turn과 proactive signal turn의 공통 context 기반 |
| Architecture Rationale and Benefits | proactive 도입 배경과 이점 |
| Memory Category | proactive feedback이 memory/policy로 되돌아가는 경로 |
| DeviceAgent / SoC Category | proactive execute가 실제 task/workflow로 내려가는 경로 |
| Validation Category | false proactive, confirmation, suppress, feedback 검증 |
17. 후속 작업
| 우선순위 | 작업 | 완료 증거 |
|---|---|---|
| P0 | proactive source map을 Evidence Catalog에 고정 | source path와 schema 목록 |
| P0 | proactive request/feedback fixture 추가 | request_kind=proactive, proactive_feedback sample result |
| P0 | false proactive 방지 기준 추가 | trigger gate/risk policy test |
| P1 | memory feedback writeback 검증 | accept/reject feedback이 profile/policy로 반영되는 evidence |
| P1 | On-device proactive dispatch 계약 연결 | recommendation/confirmation/execute/schedule channel payload |
| P2 | proactive benchmark | trigger precision, false positive, suppress rate |