ema-mcp-toolkit 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +338 -0
- package/config.example.yaml +32 -0
- package/dist/cli/index.js +333 -0
- package/dist/config.js +136 -0
- package/dist/emaClient.js +398 -0
- package/dist/index.js +109 -0
- package/dist/mcp/handlers-consolidated.js +851 -0
- package/dist/mcp/index.js +15 -0
- package/dist/mcp/prompts.js +1753 -0
- package/dist/mcp/resources.js +624 -0
- package/dist/mcp/server.js +4585 -0
- package/dist/mcp/tools-consolidated.js +590 -0
- package/dist/mcp/tools-legacy.js +736 -0
- package/dist/models.js +8 -0
- package/dist/scheduler.js +21 -0
- package/dist/sdk/client.js +788 -0
- package/dist/sdk/config.js +136 -0
- package/dist/sdk/contracts.js +429 -0
- package/dist/sdk/generation-schema.js +189 -0
- package/dist/sdk/index.js +39 -0
- package/dist/sdk/knowledge.js +2780 -0
- package/dist/sdk/models.js +8 -0
- package/dist/sdk/state.js +88 -0
- package/dist/sdk/sync-options.js +216 -0
- package/dist/sdk/sync.js +220 -0
- package/dist/sdk/validation-rules.js +355 -0
- package/dist/sdk/workflow-generator.js +291 -0
- package/dist/sdk/workflow-intent.js +1585 -0
- package/dist/state.js +88 -0
- package/dist/sync.js +416 -0
- package/dist/syncOptions.js +216 -0
- package/dist/ui.js +334 -0
- package/docs/advisor-comms-assistant-fixes.md +175 -0
- package/docs/api-contracts.md +216 -0
- package/docs/auto-builder-analysis.md +271 -0
- package/docs/data-architecture.md +166 -0
- package/docs/ema-auto-builder-guide.html +394 -0
- package/docs/ema-user-guide.md +1121 -0
- package/docs/mcp-tools-guide.md +149 -0
- package/docs/naming-conventions.md +218 -0
- package/docs/tool-consolidation-proposal.md +427 -0
- package/package.json +95 -0
- package/resources/templates/chat-ai/README.md +119 -0
- package/resources/templates/chat-ai/persona-config.json +111 -0
- package/resources/templates/dashboard-ai/README.md +156 -0
- package/resources/templates/dashboard-ai/persona-config.json +180 -0
- package/resources/templates/voice-ai/README.md +123 -0
- package/resources/templates/voice-ai/persona-config.json +74 -0
- package/resources/templates/voice-ai/workflow-prompt.md +120 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ema.co/schemas/persona-config-chat.json",
|
|
3
|
+
"$comment": "Chat AI Persona Configuration - Fill in all {placeholder} values",
|
|
4
|
+
|
|
5
|
+
"personaType": "chat",
|
|
6
|
+
"projectType": 4,
|
|
7
|
+
"name": "{Persona Name}",
|
|
8
|
+
"description": "{Brief description of what this Chat AI does}",
|
|
9
|
+
|
|
10
|
+
"chatbotSdkConfig": {
|
|
11
|
+
"name": "{Display name shown in chat widget}",
|
|
12
|
+
"theme": {
|
|
13
|
+
"primaryColor": "#1f8844",
|
|
14
|
+
"$comment": "Hex color for chat widget theme"
|
|
15
|
+
},
|
|
16
|
+
"logo": "",
|
|
17
|
+
"$comment_logo": "URL to logo image (optional)",
|
|
18
|
+
"allowedDomains": ["*"],
|
|
19
|
+
"$comment_allowedDomains": "Domains where widget can be embedded. Use ['*'] for all, or specific domains",
|
|
20
|
+
"disableSources": false,
|
|
21
|
+
"$comment_disableSources": "Set true to hide source citations"
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"fileTagging": {
|
|
25
|
+
"tagTypes": [
|
|
26
|
+
{
|
|
27
|
+
"name": "Department",
|
|
28
|
+
"tags": [
|
|
29
|
+
{ "tagValue": "Department:HR" },
|
|
30
|
+
{ "tagValue": "Department:IT" },
|
|
31
|
+
{ "tagValue": "Department:Finance" }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "DocType",
|
|
36
|
+
"tags": [
|
|
37
|
+
{ "tagValue": "DocType:Policy" },
|
|
38
|
+
{ "tagValue": "DocType:Procedure" },
|
|
39
|
+
{ "tagValue": "DocType:FAQ" }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"$comment": "Define tag categories and values for knowledge base filtering"
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
"fileUpload": {
|
|
47
|
+
"localFiles": [],
|
|
48
|
+
"mergeFiles": [],
|
|
49
|
+
"tags": ["{default-tag}"],
|
|
50
|
+
"$comment_tags": "Default tags applied to all uploads",
|
|
51
|
+
"transforms": [],
|
|
52
|
+
"useChunking": true,
|
|
53
|
+
"$comment_useChunking": "Enable for better search on long documents",
|
|
54
|
+
"fileTagMappings": [],
|
|
55
|
+
"acceptedMimeTypes": [
|
|
56
|
+
"application/pdf",
|
|
57
|
+
"text/plain",
|
|
58
|
+
"text/markdown",
|
|
59
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
60
|
+
"text/csv"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
"feedbackMessage": {
|
|
65
|
+
"message": {
|
|
66
|
+
"question": "Was this answer helpful?",
|
|
67
|
+
"positiveLabel": "Yes, helpful",
|
|
68
|
+
"negativeLabel": "No, not helpful"
|
|
69
|
+
},
|
|
70
|
+
"feedbackFrequency": 1,
|
|
71
|
+
"$comment_feedbackFrequency": "1 = every response, 3 = every 3rd response"
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
"dataProtection": {
|
|
75
|
+
"protectedClasses": [
|
|
76
|
+
"ssn",
|
|
77
|
+
"credit_card"
|
|
78
|
+
],
|
|
79
|
+
"$comment": "PII classes to redact from responses"
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
"fusionModel": {
|
|
83
|
+
"allModels": true,
|
|
84
|
+
"selectedModels": []
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
"knowledgeBaseSettings": {
|
|
88
|
+
"$comment": "These settings guide how the knowledge base should be configured",
|
|
89
|
+
"sources": [
|
|
90
|
+
{
|
|
91
|
+
"name": "{Source 1 Name}",
|
|
92
|
+
"type": "documents",
|
|
93
|
+
"folder": "docs/{folder1}",
|
|
94
|
+
"tags": ["{tag1}", "{tag2}"],
|
|
95
|
+
"priority": "primary"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "{Source 2 Name}",
|
|
99
|
+
"type": "documents",
|
|
100
|
+
"folder": "docs/{folder2}",
|
|
101
|
+
"tags": ["{tag3}"],
|
|
102
|
+
"priority": "secondary"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"searchSettings": {
|
|
106
|
+
"useSemanticSearch": true,
|
|
107
|
+
"useKeywordSearch": true,
|
|
108
|
+
"maxResults": 5
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# {Persona Name}
|
|
2
|
+
|
|
3
|
+
**Type**: Dashboard AI
|
|
4
|
+
**Created**: {Date}
|
|
5
|
+
**Version**: 1.0
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
{Brief description of what this Dashboard AI Employee does}
|
|
10
|
+
|
|
11
|
+
## Deployment Steps
|
|
12
|
+
|
|
13
|
+
### Step 1: Create Workflow in Auto Builder
|
|
14
|
+
|
|
15
|
+
1. Go to [Ema Auto Builder](https://builder.ema.co/)
|
|
16
|
+
2. Create new AI Employee → Select **Dashboard AI**
|
|
17
|
+
3. Copy contents of `workflow-prompt.md` into the prompt field
|
|
18
|
+
4. Click "Generate Workflow"
|
|
19
|
+
5. Review generated nodes and verify:
|
|
20
|
+
- Document trigger configured correctly
|
|
21
|
+
- Entity extraction columns defined
|
|
22
|
+
- Rule validation rules specified
|
|
23
|
+
- All processing paths complete
|
|
24
|
+
|
|
25
|
+
### Step 2: Configure Input Schema
|
|
26
|
+
|
|
27
|
+
1. Navigate to "Input Configuration" section
|
|
28
|
+
2. Define input fields from `persona-config.json`:
|
|
29
|
+
|
|
30
|
+
| Field | Type | Required |
|
|
31
|
+
|-------|------|----------|
|
|
32
|
+
| {field1} | {type} | {yes/no} |
|
|
33
|
+
| {field2} | {type} | {yes/no} |
|
|
34
|
+
|
|
35
|
+
### Step 3: Configure Processing Settings
|
|
36
|
+
|
|
37
|
+
1. Navigate to "Processing" section
|
|
38
|
+
2. Apply settings:
|
|
39
|
+
- Batch Size: `dashboardSettings.batchSettings.batchSize`
|
|
40
|
+
- Timeout: `dashboardSettings.batchSettings.timeout`
|
|
41
|
+
- Parallel: `dashboardSettings.batchSettings.parallelExecution`
|
|
42
|
+
|
|
43
|
+
### Step 4: Upload Reference Documents (if applicable)
|
|
44
|
+
|
|
45
|
+
1. Navigate to "Knowledge Base" section
|
|
46
|
+
2. Upload documents from `docs/` folder
|
|
47
|
+
3. Configure entity extraction mappings
|
|
48
|
+
|
|
49
|
+
### Step 5: Configure Approvals (if applicable)
|
|
50
|
+
|
|
51
|
+
1. Navigate to "Approval Routing" section
|
|
52
|
+
2. Define approval rules:
|
|
53
|
+
- Thresholds for auto-approval
|
|
54
|
+
- Routing rules for human review
|
|
55
|
+
- Escalation paths
|
|
56
|
+
|
|
57
|
+
### Step 6: Test
|
|
58
|
+
|
|
59
|
+
1. **Single Item Test**: Process one document
|
|
60
|
+
2. **Batch Test**: Process small batch (5-10 items)
|
|
61
|
+
3. **Edge Cases**:
|
|
62
|
+
- Missing required fields
|
|
63
|
+
- Invalid data formats
|
|
64
|
+
- Processing failures
|
|
65
|
+
|
|
66
|
+
## Files
|
|
67
|
+
|
|
68
|
+
| File | Description |
|
|
69
|
+
|------|-------------|
|
|
70
|
+
| `workflow-prompt.md` | Auto Builder prompt with safeguards |
|
|
71
|
+
| `persona-config.json` | Dashboard AI configuration |
|
|
72
|
+
| `proto-config.json` | Full API-deployable config |
|
|
73
|
+
| `docs/` | Reference documents |
|
|
74
|
+
|
|
75
|
+
## Testing Checklist
|
|
76
|
+
|
|
77
|
+
- [ ] Workflow generates without validation errors
|
|
78
|
+
- [ ] Document upload works
|
|
79
|
+
- [ ] Entity extraction accurate
|
|
80
|
+
- [ ] Rule validation correct
|
|
81
|
+
- [ ] Approval routing works
|
|
82
|
+
- [ ] Batch processing completes
|
|
83
|
+
- [ ] Error handling works
|
|
84
|
+
|
|
85
|
+
## Input Schema
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"fields": [
|
|
90
|
+
{
|
|
91
|
+
"name": "{field1}",
|
|
92
|
+
"type": "{string|number|date|file}",
|
|
93
|
+
"required": true,
|
|
94
|
+
"description": "{Field description}"
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Processing Flow
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
Input Document
|
|
104
|
+
│
|
|
105
|
+
▼
|
|
106
|
+
┌─────────────┐
|
|
107
|
+
│ Parse/OCR │
|
|
108
|
+
└─────────────┘
|
|
109
|
+
│
|
|
110
|
+
▼
|
|
111
|
+
┌─────────────┐
|
|
112
|
+
│ Extract │──→ {Field 1}
|
|
113
|
+
│ Entities │──→ {Field 2}
|
|
114
|
+
└─────────────┘──→ {Field N}
|
|
115
|
+
│
|
|
116
|
+
▼
|
|
117
|
+
┌─────────────┐
|
|
118
|
+
│ Validate │──→ Errors?
|
|
119
|
+
│ Rules │
|
|
120
|
+
└─────────────┘
|
|
121
|
+
│
|
|
122
|
+
▼
|
|
123
|
+
┌─────────────┐
|
|
124
|
+
│ Route for │──→ Auto-approve
|
|
125
|
+
│ Approval │──→ Human review
|
|
126
|
+
└─────────────┘──→ Reject
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Maintenance
|
|
130
|
+
|
|
131
|
+
| Change Type | Action |
|
|
132
|
+
|-------------|--------|
|
|
133
|
+
| Workflow logic | Update `workflow-prompt.md`, re-generate |
|
|
134
|
+
| Processing settings | Update `persona-config.json`, apply in UI |
|
|
135
|
+
| Extraction rules | Update entity extraction columns |
|
|
136
|
+
| Validation rules | Update rule validation configuration |
|
|
137
|
+
|
|
138
|
+
## Troubleshooting
|
|
139
|
+
|
|
140
|
+
### Processing fails
|
|
141
|
+
|
|
142
|
+
- Check document format is supported
|
|
143
|
+
- Verify required fields are present
|
|
144
|
+
- Review extraction column mappings
|
|
145
|
+
|
|
146
|
+
### Entity extraction inaccurate
|
|
147
|
+
|
|
148
|
+
- Add more training examples
|
|
149
|
+
- Refine extraction column definitions
|
|
150
|
+
- Check document quality
|
|
151
|
+
|
|
152
|
+
### Batch processing slow
|
|
153
|
+
|
|
154
|
+
- Reduce batch size
|
|
155
|
+
- Increase timeout
|
|
156
|
+
- Enable parallel execution
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ema.co/schemas/persona-config-dashboard.json",
|
|
3
|
+
"$comment": "Dashboard AI Persona Configuration - Fill in all {placeholder} values",
|
|
4
|
+
|
|
5
|
+
"personaType": "dashboard",
|
|
6
|
+
"projectType": 2,
|
|
7
|
+
"name": "{Persona Name}",
|
|
8
|
+
"description": "{Brief description of what this Dashboard AI does}",
|
|
9
|
+
|
|
10
|
+
"dashboardSettings": {
|
|
11
|
+
"name": "{Display name}",
|
|
12
|
+
"description": "{What this dashboard processes}",
|
|
13
|
+
|
|
14
|
+
"inputSchema": {
|
|
15
|
+
"fields": [
|
|
16
|
+
{
|
|
17
|
+
"name": "{field1}",
|
|
18
|
+
"type": "file",
|
|
19
|
+
"required": true,
|
|
20
|
+
"description": "{Primary document to process}",
|
|
21
|
+
"acceptedTypes": ["application/pdf", "image/*"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "{field2}",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": false,
|
|
27
|
+
"description": "{Optional text field}"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "{field3}",
|
|
31
|
+
"type": "select",
|
|
32
|
+
"required": true,
|
|
33
|
+
"options": ["{option1}", "{option2}", "{option3}"],
|
|
34
|
+
"description": "{Category selection}"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
"batchSettings": {
|
|
40
|
+
"batchSize": 50,
|
|
41
|
+
"$comment_batchSize": "Number of items per batch (1-100)",
|
|
42
|
+
"timeout": 60,
|
|
43
|
+
"$comment_timeout": "Seconds per item before timeout",
|
|
44
|
+
"parallelExecution": true,
|
|
45
|
+
"$comment_parallelExecution": "Process items in parallel"
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"outputSchema": {
|
|
49
|
+
"fields": [
|
|
50
|
+
{
|
|
51
|
+
"name": "status",
|
|
52
|
+
"type": "enum",
|
|
53
|
+
"values": ["approved", "pending_review", "rejected"]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "extracted_data",
|
|
57
|
+
"type": "object",
|
|
58
|
+
"description": "Extracted entity values"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "validation_errors",
|
|
62
|
+
"type": "array",
|
|
63
|
+
"description": "List of validation failures"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "confidence_score",
|
|
67
|
+
"type": "number",
|
|
68
|
+
"description": "0-1 confidence in extraction"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
"entityExtraction": {
|
|
75
|
+
"columns": [
|
|
76
|
+
{
|
|
77
|
+
"name": "{Entity 1}",
|
|
78
|
+
"type": "string",
|
|
79
|
+
"description": "{What to extract}",
|
|
80
|
+
"examples": ["{example1}", "{example2}"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "{Entity 2}",
|
|
84
|
+
"type": "number",
|
|
85
|
+
"description": "{Numeric value to extract}",
|
|
86
|
+
"examples": ["{example1}", "{example2}"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "{Entity 3}",
|
|
90
|
+
"type": "date",
|
|
91
|
+
"description": "{Date to extract}",
|
|
92
|
+
"format": "YYYY-MM-DD"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"$comment": "Define columns for entity_extraction_with_documents action"
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
"ruleValidation": {
|
|
99
|
+
"rules": [
|
|
100
|
+
{
|
|
101
|
+
"name": "{Rule 1}",
|
|
102
|
+
"description": "{What this rule checks}",
|
|
103
|
+
"condition": "{Entity 1} is not empty",
|
|
104
|
+
"severity": "error"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "{Rule 2}",
|
|
108
|
+
"description": "{What this rule checks}",
|
|
109
|
+
"condition": "{Entity 2} > 0",
|
|
110
|
+
"severity": "warning"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"$comment": "Define rules for rule_validation_with_documents action"
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
"approvalRouting": {
|
|
117
|
+
"rules": [
|
|
118
|
+
{
|
|
119
|
+
"name": "Auto-approve",
|
|
120
|
+
"condition": "confidence_score >= 0.95 AND validation_errors.length == 0",
|
|
121
|
+
"action": "auto_approve"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "Manager Review",
|
|
125
|
+
"condition": "{amount} > 10000",
|
|
126
|
+
"action": "route_to_manager",
|
|
127
|
+
"assignee": "{manager_email}"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "Reject",
|
|
131
|
+
"condition": "validation_errors contains 'critical'",
|
|
132
|
+
"action": "reject"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"sla": {
|
|
136
|
+
"standard": "24h",
|
|
137
|
+
"urgent": "4h",
|
|
138
|
+
"reminderAt": "50%",
|
|
139
|
+
"escalateAt": "100%"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
"fileUpload": {
|
|
144
|
+
"localFiles": [],
|
|
145
|
+
"tags": ["{default-tag}"],
|
|
146
|
+
"useChunking": true,
|
|
147
|
+
"acceptedMimeTypes": [
|
|
148
|
+
"application/pdf",
|
|
149
|
+
"image/png",
|
|
150
|
+
"image/jpeg",
|
|
151
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
"dataProtection": {
|
|
156
|
+
"protectedClasses": [
|
|
157
|
+
"ssn",
|
|
158
|
+
"credit_card",
|
|
159
|
+
"account_number"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
"fusionModel": {
|
|
164
|
+
"allModels": true,
|
|
165
|
+
"selectedModels": []
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
"notifications": {
|
|
169
|
+
"onSuccess": {
|
|
170
|
+
"enabled": true,
|
|
171
|
+
"recipients": ["{email}"],
|
|
172
|
+
"template": "Processing complete: {count} items processed"
|
|
173
|
+
},
|
|
174
|
+
"onFailure": {
|
|
175
|
+
"enabled": true,
|
|
176
|
+
"recipients": ["{email}"],
|
|
177
|
+
"template": "Processing failed: {error}"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# {Persona Name}
|
|
2
|
+
|
|
3
|
+
**Type**: Voice AI
|
|
4
|
+
**Created**: {Date}
|
|
5
|
+
**Version**: 1.0
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
{Brief description of what this Voice AI Employee does}
|
|
10
|
+
|
|
11
|
+
## Deployment Steps
|
|
12
|
+
|
|
13
|
+
### Step 1: Create Workflow in Auto Builder
|
|
14
|
+
|
|
15
|
+
1. Go to [Ema Auto Builder](https://builder.ema.co/)
|
|
16
|
+
2. Create new AI Employee → Select **Voice AI**
|
|
17
|
+
3. Copy contents of `workflow-prompt.md` into the prompt field
|
|
18
|
+
4. Click "Generate Workflow"
|
|
19
|
+
5. Review generated nodes and verify:
|
|
20
|
+
- All categorizers have edges for every category
|
|
21
|
+
- Search nodes connect to respond nodes correctly
|
|
22
|
+
- Fallback paths are present
|
|
23
|
+
|
|
24
|
+
### Step 2: Configure Conversational Behavior
|
|
25
|
+
|
|
26
|
+
1. Navigate to "Conversational Behavior" section
|
|
27
|
+
2. Apply settings from `persona-config.json`:
|
|
28
|
+
|
|
29
|
+
| Field | Source |
|
|
30
|
+
|-------|--------|
|
|
31
|
+
| Welcome Message | `conversationSettings.welcomeMessage` |
|
|
32
|
+
| Identity & Purpose | `conversationSettings.identityAndPurpose` |
|
|
33
|
+
| Take Action Instructions | `conversationSettings.takeActionInstructions` |
|
|
34
|
+
| Hangup Instructions | `conversationSettings.hangupInstructions` |
|
|
35
|
+
| Transfer Call Instructions | `conversationSettings.transferCallInstructions` |
|
|
36
|
+
| Speech Characteristics | `conversationSettings.speechCharacteristics` |
|
|
37
|
+
| System Prompt | `conversationSettings.systemPrompt` |
|
|
38
|
+
| Wait Message | `conversationSettings.waitMessage` |
|
|
39
|
+
|
|
40
|
+
### Step 3: Configure Voice Settings
|
|
41
|
+
|
|
42
|
+
1. Navigate to "Voice Settings" section
|
|
43
|
+
2. Apply settings:
|
|
44
|
+
- Language: From `voiceSettings.languageHints`
|
|
45
|
+
- Voice Model: From `voiceSettings.voiceModel`
|
|
46
|
+
|
|
47
|
+
### Step 4: Configure VAD & Data Storage
|
|
48
|
+
|
|
49
|
+
1. **VAD Settings** (Voice Activity Detection):
|
|
50
|
+
- Turn Timeout: `vadSettings.turnTimeout` seconds
|
|
51
|
+
- Silence End Call: `vadSettings.silenceEndCallTimeout` seconds
|
|
52
|
+
- Max Duration: `vadSettings.maxConversationDuration` seconds
|
|
53
|
+
|
|
54
|
+
2. **Data Storage**:
|
|
55
|
+
- Store Audio: `dataStorageSettings.storeAudioRecording`
|
|
56
|
+
- Store Transcripts: `dataStorageSettings.storeTranscripts`
|
|
57
|
+
|
|
58
|
+
### Step 5: Upload Knowledge Base (if applicable)
|
|
59
|
+
|
|
60
|
+
1. Navigate to "Knowledge Base" section
|
|
61
|
+
2. Upload documents from `docs/` folder
|
|
62
|
+
3. Apply tags as specified in `docs/_metadata.json`
|
|
63
|
+
|
|
64
|
+
### Step 6: Test
|
|
65
|
+
|
|
66
|
+
1. **Simulator Test**: Use the built-in call simulator
|
|
67
|
+
2. **Test Calls**:
|
|
68
|
+
- Test happy path (main use case)
|
|
69
|
+
- Test each category branch
|
|
70
|
+
- Test fallback handling
|
|
71
|
+
- Test verification flows (if applicable)
|
|
72
|
+
3. **Edge Cases**:
|
|
73
|
+
- Test with unexpected inputs
|
|
74
|
+
- Test silence handling
|
|
75
|
+
- Test interruption handling
|
|
76
|
+
|
|
77
|
+
## Files
|
|
78
|
+
|
|
79
|
+
| File | Description |
|
|
80
|
+
|------|-------------|
|
|
81
|
+
| `workflow-prompt.md` | Auto Builder prompt with safeguards |
|
|
82
|
+
| `persona-config.json` | Voice AI configuration |
|
|
83
|
+
| `proto-config.json` | Full API-deployable config |
|
|
84
|
+
| `docs/` | Knowledge base documents |
|
|
85
|
+
|
|
86
|
+
## Testing Checklist
|
|
87
|
+
|
|
88
|
+
- [ ] Workflow generates without validation errors
|
|
89
|
+
- [ ] All category paths work correctly
|
|
90
|
+
- [ ] Fallback provides helpful response
|
|
91
|
+
- [ ] Voice sounds natural and appropriate
|
|
92
|
+
- [ ] Actions/tools execute correctly
|
|
93
|
+
- [ ] Handoff to human works (if applicable)
|
|
94
|
+
- [ ] Call ends appropriately
|
|
95
|
+
|
|
96
|
+
## Maintenance
|
|
97
|
+
|
|
98
|
+
| Change Type | Action |
|
|
99
|
+
|-------------|--------|
|
|
100
|
+
| Workflow logic | Update `workflow-prompt.md`, re-generate |
|
|
101
|
+
| Persona behavior | Update `persona-config.json`, apply in UI |
|
|
102
|
+
| Knowledge content | Update docs in `docs/`, re-upload |
|
|
103
|
+
| Voice settings | Update `persona-config.json`, apply in UI |
|
|
104
|
+
|
|
105
|
+
## Troubleshooting
|
|
106
|
+
|
|
107
|
+
### "Validation failed" in Auto Builder
|
|
108
|
+
|
|
109
|
+
- Check that all categorizers have Fallback category
|
|
110
|
+
- Verify edge format: `category_<Name>` not `category::<Name>`
|
|
111
|
+
- Ensure all nodes have required inputs
|
|
112
|
+
|
|
113
|
+
### Voice sounds unnatural
|
|
114
|
+
|
|
115
|
+
- Review `speechCharacteristics` for TTS rules
|
|
116
|
+
- Add pronunciation guides for technical terms
|
|
117
|
+
- Adjust pauses and pacing instructions
|
|
118
|
+
|
|
119
|
+
### Actions not triggering
|
|
120
|
+
|
|
121
|
+
- Check `takeActionInstructions` uses correct `</Case N>` format
|
|
122
|
+
- Verify tool names match exactly
|
|
123
|
+
- Review `systemPrompt` for tool calling rules
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ema.co/schemas/persona-config-voice.json",
|
|
3
|
+
"$comment": "Voice AI Persona Configuration - Fill in all {placeholder} values",
|
|
4
|
+
|
|
5
|
+
"personaType": "voice",
|
|
6
|
+
"projectType": 5,
|
|
7
|
+
"name": "{Persona Name}",
|
|
8
|
+
"description": "{Brief description of what this Voice AI does}",
|
|
9
|
+
|
|
10
|
+
"conversationSettings": {
|
|
11
|
+
"name": "{AI Name - e.g., 'Sofia', 'Alex', 'Service Agent'}",
|
|
12
|
+
|
|
13
|
+
"welcomeMessage": "{Opening greeting when call connects}\n\nExample:\nHello, thank you for calling {Company}. This is {AI Name}. How can I help you today?",
|
|
14
|
+
|
|
15
|
+
"identityAndPurpose": "You are {AI Name}, a Voice AI assistant for {Company}.\n\nPrimary responsibility: {Main purpose}\n\nYour responsibilities:\n1. {Responsibility 1}\n2. {Responsibility 2}\n3. {Responsibility 3}\n\nRules:\n- {Rule 1}\n- {Rule 2}",
|
|
16
|
+
|
|
17
|
+
"takeActionInstructions": "</Case 1>\n{Action 1 Name}\n\nTrigger When:\n{Condition that triggers this action}\n\nIntent for tool call: \"{Tool Intent Name}\"\n\nRequired parameters:\n{ \"{param1}\": \"\", \"{param2}\": \"\" }\n</Case 1>\n\n</Case 2>\n{Action 2 Name}\n\nTrigger When:\n{Condition that triggers this action}\n\nIntent for tool call: \"{Tool Intent Name}\"\n\nRequired parameters:\n{ \"{param1}\": \"\" }\n</Case 2>",
|
|
18
|
+
|
|
19
|
+
"hangupInstructions": "End the call when:\n- The caller explicitly says goodbye or asks to hang up\n- The caller confirms they have no more questions\n- {Additional hangup conditions}\n\nBefore ending:\n- Confirm all issues are resolved\n- Offer any follow-up information\n- Thank the caller",
|
|
20
|
+
|
|
21
|
+
"transferCallInstructions": "Transfer the call when:\n- The caller explicitly requests a human agent\n- {Condition requiring human}\n- {Complex scenario}\n\nBefore transferring:\n- Inform the caller you're transferring them\n- Provide brief context to the human agent\n- {Additional transfer instructions}",
|
|
22
|
+
|
|
23
|
+
"speechCharacteristics": "**Conversational Style:**\n- Keep responses brief (2-3 sentences per turn)\n- Use warm, professional tone\n- Speak clearly at moderate pace\n\n**Natural Speech:**\n- Use brief pauses between sentences\n- Acknowledge with 'I understand', 'Of course', 'Certainly'\n- Avoid robotic language\n\n**TTS Pronunciation Rules:**\n- Spell out IDs: 'A-B-C-1-2-3'\n- Pause between numbers: 'Your code is... 1... 2... 3... 4'\n- {Domain-specific pronunciation rules}",
|
|
24
|
+
|
|
25
|
+
"systemPrompt": "Tool Calling Instructions:\n\n1. Always collect required parameters before calling tools\n2. Confirm parameter values with the caller\n3. Handle tool errors gracefully\n4. {Additional tool calling rules}\n\nParameter Collection:\n- {Param 1}: {How to collect}\n- {Param 2}: {How to collect}",
|
|
26
|
+
|
|
27
|
+
"formFillingInstructions": "{Instructions for collecting form data, if applicable}\n\nExample:\nWhen collecting booking information:\n1. Ask for name first\n2. Then ask for date preference\n3. Confirm all details before proceeding",
|
|
28
|
+
|
|
29
|
+
"waitMessage": "One moment while I look that up for you..."
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"voiceSettings": {
|
|
33
|
+
"languageHints": ["en-US"],
|
|
34
|
+
"voiceModel": "default",
|
|
35
|
+
"$comment_voiceModel": "Options: default, professional-male, professional-female, casual"
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
"vadSettings": {
|
|
39
|
+
"turnTimeout": 3,
|
|
40
|
+
"$comment_turnTimeout": "Seconds to wait for caller to finish speaking",
|
|
41
|
+
"silenceEndCallTimeout": 30,
|
|
42
|
+
"$comment_silenceEndCallTimeout": "Seconds of silence before ending call",
|
|
43
|
+
"maxConversationDuration": 600,
|
|
44
|
+
"$comment_maxConversationDuration": "Maximum call length in seconds (600 = 10 minutes)"
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
"dataStorageSettings": {
|
|
48
|
+
"storeAudioRecording": true,
|
|
49
|
+
"storeTranscripts": true,
|
|
50
|
+
"storeAgentTranscript": true
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"callSettings": {
|
|
54
|
+
"enableCallForwarding": false,
|
|
55
|
+
"callForwardingNumber": "",
|
|
56
|
+
"enableSpamCallPrevention": true,
|
|
57
|
+
"enableDisconnectCall": false
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
"dataProtection": {
|
|
61
|
+
"protectedClasses": [
|
|
62
|
+
"ssn",
|
|
63
|
+
"credit_card",
|
|
64
|
+
"phone_number"
|
|
65
|
+
],
|
|
66
|
+
"$comment_protectedClasses": "PII classes to redact. Options: ssn, credit_card, phone_number, email, address, dob, account_number"
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
"fusionModel": {
|
|
70
|
+
"allModels": true,
|
|
71
|
+
"selectedModels": [],
|
|
72
|
+
"$comment": "Leave allModels: true for best results, or specify models: ['gpt-4', 'claude-3']"
|
|
73
|
+
}
|
|
74
|
+
}
|