Federated from workspace ·
PRD-001·Dental Clinic Revenue Operating System/docs/technical/CONVERSATION_BEHAVIOR_ENGINE.mdDo not edit canonical truth here — update the source repo, then re-runnpm run docs:sync.
Conversation Behavior Engine
Status: Implemented (2026-07-05)
Authority: App\Modules\AI\Application\Conversation
Purpose
Social and conversational turns are not capabilities. They must never enter PL-003 runtime (CapabilityMatcher → Planner → Tools).
Large-product pattern:
User message
↓
Conversation Behavior Engine ← greeting, thanks, small talk, etc.
↓ (response, stop)
Intent Understanding Engine ← operational / guidance intents only
↓
Capability Matcher → Planner → ExecutionBehaviors
| Behavior | Examples | Enters runtime? |
|---|---|---|
| Greeting | hello, hi | No |
| Social talk | how are you | No |
| Thanks | thank you | No |
| Goodbye | bye, see you | No |
| Acknowledgement | good, ok, okay | No |
| Small talk | nice, cool | No |
| Confirmation | yes, go ahead (short) | No |
| Clarification / Unknown | what?, asdfgh | No |
| Cancellation | cancel it | No |
| Continuation | explain more | Only if prior turn was operational — then passes resolved message to Intent Engine |
Components
| Component | Role |
|---|---|
ClinicConversationBehaviorEngine | Primary entry — evaluate message + context |
ClinicConversationBehaviorDetector | Classifies behavior (no capability keywords) |
ClinicConversationBehaviorResponseBuilder | Builds response without tools |
ClinicConversationBehaviorResult | DTO with exitsRuntime() gate |
Configuration
env
CLINIC_CONVERSATION_BEHAVIOR_ENABLED=trueTests
bash
php artisan test app/Modules/AI/Tests/Unit/ClinicConversationBehaviorEngineTest.php
php artisan test tests/Feature/ClinicAgentIntentAcceptanceTest.php