@ema.co/mcp-toolkit 2026.1.24 → 2026.1.26-3

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.

Potentially problematic release.


This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.

Files changed (81) hide show
  1. package/README.md +10 -2
  2. package/dist/mcp/handlers/action/index.js +3 -18
  3. package/dist/mcp/handlers/data/index.js +385 -41
  4. package/dist/mcp/handlers/data/templates.js +107 -0
  5. package/dist/mcp/handlers/deprecation.js +50 -0
  6. package/dist/mcp/handlers/env/index.js +8 -4
  7. package/dist/mcp/handlers/knowledge/index.js +44 -237
  8. package/dist/mcp/handlers/persona/create.js +5 -11
  9. package/dist/mcp/handlers/persona/index.js +5 -1
  10. package/dist/mcp/handlers/persona/version.js +234 -0
  11. package/dist/mcp/handlers/reference/index.js +101 -1
  12. package/dist/mcp/handlers/sync/index.js +3 -18
  13. package/dist/mcp/handlers/template/index.js +75 -10
  14. package/dist/mcp/handlers/workflow/analyze.js +171 -0
  15. package/dist/mcp/handlers/workflow/compare.js +70 -0
  16. package/dist/mcp/handlers/workflow/compile.js +39 -0
  17. package/dist/mcp/handlers/workflow/deploy.js +73 -0
  18. package/dist/mcp/handlers/workflow/generate.js +350 -0
  19. package/dist/mcp/handlers/workflow/index.js +136 -0
  20. package/dist/mcp/handlers/workflow/modify.js +456 -0
  21. package/dist/mcp/handlers/workflow/optimize.js +136 -0
  22. package/dist/mcp/handlers/workflow/types.js +4 -0
  23. package/dist/mcp/handlers/workflow/utils.js +132 -0
  24. package/dist/mcp/handlers-consolidated.js +62 -2691
  25. package/dist/mcp/prompts.js +13 -14
  26. package/dist/mcp/resources.js +55 -54
  27. package/dist/mcp/server.js +93 -124
  28. package/dist/mcp/{tools-v2.js → tools.js} +1 -1
  29. package/dist/mcp/workflow-operations.js +2 -2
  30. package/dist/sdk/client-adapter.js +267 -32
  31. package/dist/sdk/client.js +31 -15
  32. package/dist/sdk/ema-client.js +183 -0
  33. package/dist/sdk/generated/template-fallbacks.js +123 -0
  34. package/dist/sdk/guidance.js +65 -11
  35. package/dist/sdk/index.js +3 -1
  36. package/dist/sdk/knowledge.js +16 -86
  37. package/dist/sdk/workflow-intent.js +27 -0
  38. package/dist/sdk/workflow-transformer.js +0 -342
  39. package/docs/DEBUG-ANALYSIS-unused-category-type-mismatch.md +481 -0
  40. package/docs/TODO-fix-analyzer-and-modify.md +182 -0
  41. package/package.json +9 -4
  42. package/dist/mcp/tools-consolidated.js +0 -866
  43. package/dist/mcp/tools-legacy.js +0 -736
  44. package/docs/CODEBASE-ANALYSIS-2026-01-23.md +0 -936
  45. package/docs/CODEBASE-ANALYSIS-PRIORITIZED.md +0 -774
  46. package/docs/api-contracts.md +0 -216
  47. package/docs/auto-builder-analysis.md +0 -271
  48. package/docs/blog/mcp-tool-design-lessons.md +0 -309
  49. package/docs/data-architecture.md +0 -166
  50. package/docs/ema-auto-builder-guide.html +0 -394
  51. package/docs/lessons-learned.md +0 -209
  52. package/docs/llm-native-workflow-design.md +0 -252
  53. package/docs/local-generation.md +0 -508
  54. package/docs/mcp-flow-diagram.md +0 -135
  55. package/docs/migration/action-composition-migration.md +0 -270
  56. package/docs/naming-conventions.md +0 -278
  57. package/docs/proposals/HANDOFF-tool-restructure.md +0 -526
  58. package/docs/proposals/action-composition.md +0 -490
  59. package/docs/proposals/explicit-method-restructure.md +0 -328
  60. package/docs/proposals/mcp-tool-restructure-2026-01.md +0 -366
  61. package/docs/proposals/self-contained-guidance.md +0 -427
  62. package/docs/proto-sdk-generation.md +0 -242
  63. package/docs/release-impact.md +0 -102
  64. package/docs/release-process.md +0 -157
  65. package/docs/staging.RULE.md +0 -142
  66. package/docs/test-persona-creation.md +0 -196
  67. package/docs/tool-consolidation-v2.md +0 -225
  68. package/docs/tool-response-standards.md +0 -256
  69. package/resources/docs/getting-started.md +0 -97
  70. package/resources/templates/auto-builder-rules.md +0 -224
  71. package/resources/templates/chat-ai/README.md +0 -119
  72. package/resources/templates/chat-ai/persona-config.json +0 -111
  73. package/resources/templates/dashboard-ai/README.md +0 -156
  74. package/resources/templates/dashboard-ai/persona-config.json +0 -180
  75. package/resources/templates/demo-scenarios/README.md +0 -63
  76. package/resources/templates/demo-scenarios/test-published-package.md +0 -116
  77. package/resources/templates/document-gen-ai/README.md +0 -132
  78. package/resources/templates/document-gen-ai/persona-config.json +0 -316
  79. package/resources/templates/voice-ai/README.md +0 -123
  80. package/resources/templates/voice-ai/persona-config.json +0 -74
  81. package/resources/templates/voice-ai/workflow-prompt.md +0 -121
@@ -1,224 +0,0 @@
1
- # Auto-Builder Workflow Rules
2
-
3
- > These rules are used by the LLM when generating workflow graphs for Ema AI Employees.
4
-
5
- ## Action-Specific Instructions
6
-
7
- ### Chat Categorizer (Intent Classifier)
8
- - Classifies user intent into predefined categories for routing
9
- - **CRITICAL**: ALWAYS include a `Fallback` category - workflow validation fails without it
10
- - **MUST** create a handler node for EACH category defined
11
- - Downstream nodes use `runIf` conditions to check `category` output against `enumValue`
12
- - **Output**: `category` (enum value) - use `runIf` with `enumValue: "<CategoryName>"` to route
13
- - **DO NOT** use `category_<Name>` format - use `output: "category"` compared to `enumValue`
14
- - Example categories: `[Password_Reset, Software_Issue, Account_Access, Fallback]`
15
-
16
- #### Graphing Instructions
17
- - Connect `chat_conversation` to the categorizer's `conversation` input (NOT `user_query`)
18
- - Each category needs a downstream node with `runIf` comparing `category` to `enumValue`
19
- - Example runIf structure:
20
- ```json
21
- {
22
- "runIf": {
23
- "lhs": {"actionOutput": {"actionName": "chat_categorizer0", "output": "category"}},
24
- "operator": 1,
25
- "rhs": {"inline": {"enumValue": "Password_Reset"}}
26
- }
27
- }
28
- ```
29
-
30
- ### Type Compatibility
31
- - **CHAT_CONVERSATION**: Only compatible with `chat_categorizer.conversation` input
32
- - **TEXT_WITH_SOURCES**: Used by most other agents (search, respond, call_llm)
33
- - **SEARCH_RESULT**: Only compatible with `respond_with_sources.search_results` or `named_inputs`
34
-
35
- #### Common Type Conversions
36
- - ✅ `trigger.user_query → search.query` (TEXT_WITH_SOURCES → TEXT_WITH_SOURCES)
37
- - ❌ `trigger.chat_conversation → search.query` (CHAT_CONVERSATION ≠ TEXT_WITH_SOURCES)
38
- - ✅ `search.search_results → respond_with_sources.search_results` (compatible)
39
- - ✅ `search.search_results → call_llm.named_inputs_*` (ANY accepts everything)
40
- - **Use `conversation_to_search_query`** to convert CHAT_CONVERSATION → TEXT_WITH_SOURCES
41
-
42
- ### Conversation Summarizer (conversation_to_search_query)
43
- - Converts conversation history to a condensed search query
44
- - **When to use**:
45
- - Before search nodes when you have `chat_conversation` but need `TEXT_WITH_SOURCES`
46
- - For managing long conversation context windows (LLM token limits)
47
- - **When NOT to use**: When `trigger.user_query` is sufficient for simple queries
48
-
49
- ### Combine Search Results
50
- - Combines and weights search results from multiple sources into a unified list
51
- - Handles both segment-level and chunk-level results while preserving document relationships
52
- - **IMPORTANT**: Avoid using this agent unless necessary. Use alternatives:
53
- - **Rerank Search Results** (`combine_and_rerank_search_results`): Intelligently combines with relevance ranking and max limit
54
- - **Respond** (`call_llm`): Allows adding any number of search results via named_inputs with prompt-based ranking control
55
-
56
- ### Named Inputs (for call_llm, general_hitl)
57
- - When connecting to `named_inputs`, use the suffix pattern: `named_inputs_<descriptive_name>`
58
- - Replace spaces with underscores in the name
59
- - Examples:
60
- - `named_inputs_External_Tool_Results` for external action results
61
- - `named_inputs_Web_Search_Data` for web search results
62
- - `named_inputs_Financial_Analysis` for market research data
63
- - Each named input will be labeled with the descriptive name in the workflow UI
64
- - The planner should specify descriptive names like: "Connect to named_inputs as 'External Tool Results'"
65
- - The grapher will convert this to: `target_input: "named_inputs_External_Tool_Results"`
66
- - **Accepts ANY type**: Use named_inputs when you need to pass SEARCH_RESULT or other types to call_llm
67
-
68
- ### Human Collaboration (general_hitl)
69
-
70
- #### Planning Instructions
71
- - Human Collaboration is a special type of categorizer with two fixed categories: "HITL Success" and "HITL Failure" with no fallback categories
72
- - Use it to pause workflow execution for human input, verification, or decision-making
73
- - Always plan for both success and failure paths after Human Collaboration
74
- - **Success criteria**: Define what makes HITL succeed (e.g., "The user approves the output", "The user is happy with the result")
75
- - **Failure criteria**: Define what makes HITL fail (e.g., "The user wants to restart the workflow", "The user rejects the data")
76
- - **CRITICAL**: Use HITL for ANY action with external side effects (create ticket, send email, update records)
77
-
78
- #### Graphing Instructions
79
- - Human Collaboration (general_hitl) outputs follow a special pattern:
80
- - Success path: `hitl_status_HITL Success`
81
- - Failure path: `hitl_status_HITL Failure`
82
- - Connect these outputs to the `trigger_when` input of subsequent actions
83
- - **IMPORTANT**: Use exact output names with underscores replaced by spaces in the suffix:
84
- - `source_output: "hitl_status_HITL Success"` (with space between HITL and Success)
85
- - `source_output: "hitl_status_HITL Failure"` (with space between HITL and Failure)
86
- - Each Human Collaboration node MUST have at least one outgoing edge
87
- - **Both paths must lead to valid response nodes and terminate at WORKFLOW_OUTPUT**
88
- - Example connection:
89
- ```json
90
- {
91
- "source_node_id": "general_hitl0r146c",
92
- "source_output": "hitl_status_HITL Success",
93
- "target_input": "trigger_when"
94
- }
95
- ```
96
-
97
- ### External Tool Caller (external_action_caller)
98
- - Calls external APIs/tools (ServiceNow, Salesforce, Workday, etc.)
99
- - **CRITICAL**: Check `chat_conversation` for existing records before creating new ones to avoid duplicates on follow-up messages
100
- - **Always use HITL before** actions with external side effects (create, update, delete, send)
101
- - Accepts both `query` (TEXT_WITH_SOURCES) and optional `conversation` (CHAT_CONVERSATION) inputs
102
-
103
- ### Respond with Sources (respond_with_sources)
104
- - Generates response grounded in search results with citations
105
- - **Enable `use_citation_based_filtering`** for trust and verifiability
106
- - **Implement confidence thresholds** for quality control - abstain when uncertain
107
- - Accepts `query` (TEXT_WITH_SOURCES) and `search_results` (SEARCH_RESULT)
108
-
109
- ### WORKFLOW_OUTPUT Mapping
110
- - **ALL paths must terminate at WORKFLOW_OUTPUT**
111
- - Every response node (call_llm, respond_with_sources, fixed_response, etc.) needs an edge to WORKFLOW_OUTPUT
112
- - Missing WORKFLOW_OUTPUT mapping = responses don't reach the user
113
- - Example: `respond_market.response_with_sources → WORKFLOW_OUTPUT`
114
-
115
- ### Common Mistakes to Avoid
116
- 1. **Missing Fallback category**: Workflow validation fails, unhandled intents crash
117
- 2. **Missing HITL on sensitive actions**: Unintended actions with external side effects
118
- 3. **Creating duplicate records**: Always check chat_conversation before creating new records
119
- 4. **Type mismatches**: Use conversation_to_search_query when needed
120
- 5. **Vague agent instructions**: Be specific about tone, format, and boundaries
121
- 6. **Not mapping to WORKFLOW_OUTPUT**: Responses won't reach the user
122
- 7. **Not citing sources**: Enable use_citation_based_filtering for trust
123
- 8. **Ignoring confidence scores**: Abstain when uncertain rather than guessing
124
-
125
- ---
126
-
127
- ## General Instructions
128
-
129
- ### Validator System Overview
130
- Your generated workflows will be processed by a validator system that includes:
131
- - TypeValidator: Strictly enforces type compatibility between connected nodes
132
- - WorkflowGenerator: Converts valid graphs to workflow definitions
133
- - InputProcessor: Handles complex input processing and multibinding logic
134
- - Categorizer validation: Ensures categorizers have proper outgoing edges
135
-
136
- ### Workflow Construction Rules
137
-
138
- #### 1. Structure Analysis
139
- - Extract the workflow structure from the natural language description
140
- - Identify the type of interface: dashboard (document_trigger) or chatbot (chat_trigger)
141
-
142
- #### 2. Node Mapping
143
- - Map each workflow step to appropriate nodes from the available_nodes list
144
- - You can use multiple instances of the same node if needed
145
- - Always include at least 3 nodes in total
146
- - Assign each node a unique ID, with node name as prefix (except trigger nodes)
147
-
148
- #### 3. Edge Creation and Type Validation
149
- - INPUT AND OUTPUT `wellKnownType` MUST MATCH when creating edges - validator will reject mismatches
150
- - List Level Validation: The source output's `listLevel` MUST be less than or equal to the target input's `listLevel`
151
- - If source listLevel equals target listLevel: only ONE edge can be created to that input
152
- - If source listLevel is less than target listLevel: multiple edges can be created from different sources
153
-
154
- #### 4. Categorizer Validation Rules
155
- - **CRITICAL**: If a node has output `category` (such as chat_categorizer, text_categorizer, document_categorizer), it MUST have handler nodes with runIf conditions
156
- - The runIf format MUST BE: `output: "category"` compared to `enumValue: "<CategoryName>"`
157
- - Example: `runIf: { lhs: { actionOutput: { output: "category" } }, operator: 1, rhs: { inline: { enumValue: "Support" } } }`
158
- - **DO NOT use `category_<Name>` format** - the output is always just `"category"`, compared against the enum value
159
- - Always add a Fallback category handler
160
- - **You MUST create a handler with runIf for each category or routing will fail**
161
-
162
- #### 5. WELL_KNOWN_TYPE_ANY Rules
163
- - Inputs with `wellKnownType: "WELL_KNOWN_TYPE_ANY"` accept ANY output type
164
- - Common in `named_inputs` fields (call_llm, general_hitl actions)
165
- - Type validation is bypassed for WELL_KNOWN_TYPE_ANY inputs - any source can connect
166
- - For named_inputs specifically:
167
- - Use suffix pattern: `"target_input": "named_inputs_<descriptive_name>"`
168
- - Replace spaces with underscores in the name
169
- - Example: `"named_inputs_External_Tool_Results"`, `"named_inputs_Web_Search_Data"`
170
- - The validator extracts the name and creates namedBinding structures
171
-
172
- #### 6. Document Trigger Specific Rules
173
- - When the initial node is "document_trigger", only use document_metasearch or file_search if additional sources are needed
174
- - When the initial node is "document_trigger", each output is shown as a column to the user, so make sure to think about what columns user likely wants to see and create nodes and output edges separately
175
- - The number of columns are equal to the number of outputs
176
-
177
- #### 7. Chat Trigger Specific Rules
178
- - When the initial node is "chat_trigger", the output is a chat conversation returned to the user
179
- - Every incoming edge to WORKFLOW_OUTPUT node is being shown to the user
180
- - Make sure to create an edge for each output that the user should see
181
-
182
- #### 8. Special Requirements
183
- - Always start with either document_trigger or chat_trigger node
184
- - Always end with WORKFLOW_OUTPUT node - all user-visible outputs must connect here
185
- - Include `is_document` property based on the starting trigger type
186
-
187
- #### 9. Critical Validation Rules
188
- - Follow the exact workflow structure described in the plan
189
- - Use only nodes from the available_nodes list
190
- - Ensure perfect input/output type compatibility for all edges
191
- - Generate valid, parseable output (JSON for grapher, markdown for planner)
192
-
193
- ### JSON Graph Structure
194
- The final graph must follow this structure:
195
- ```json
196
- {
197
- "user_query": "description of the workflow",
198
- "is_document": true/false,
199
- "graph": {
200
- "node_id": {
201
- "action_name": "action_name_from_available_nodes",
202
- "display_name": "Human readable display name",
203
- "incoming_edges": [
204
- {
205
- "source_node_id": "source_node_id",
206
- "source_output": "output_name_from_source_node",
207
- "target_input": "input_name_for_this_node"
208
- }
209
- ]
210
- },
211
- "WORKFLOW_OUTPUT": {
212
- "action_name": "WorkflowOutputSink",
213
- "display_name": "Workflow Output",
214
- "incoming_edges": [
215
- {
216
- "source_node_id": "node_id",
217
- "source_output": "output_name",
218
- "target_input": "node_id.output_name"
219
- }
220
- ]
221
- }
222
- }
223
- }
224
- ```
@@ -1,119 +0,0 @@
1
- # {Persona Name}
2
-
3
- **Type**: Chat AI
4
- **Created**: {Date}
5
- **Version**: 1.0
6
-
7
- ## Overview
8
-
9
- {Brief description of what this Chat 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 **Chat 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 Chat Settings
25
-
26
- 1. Navigate to "Chat Settings" section
27
- 2. Apply settings from `persona-config.json`:
28
-
29
- | Field | Source |
30
- |-------|--------|
31
- | Name | `chatbotSdkConfig.name` |
32
- | Theme Color | `chatbotSdkConfig.theme.primaryColor` |
33
- | Logo | `chatbotSdkConfig.logo` |
34
- | Allowed Domains | `chatbotSdkConfig.allowedDomains` |
35
-
36
- ### Step 3: Configure Knowledge Base
37
-
38
- 1. Navigate to "Knowledge Base" section
39
- 2. Upload documents from `docs/` folder
40
- 3. Configure tags from `persona-config.json`:
41
- - Tag Types: `fileTagging.tagTypes`
42
- 4. Enable chunking: `fileUpload.useChunking`
43
-
44
- ### Step 4: Configure Feedback
45
-
46
- 1. Navigate to "Feedback" section
47
- 2. Apply settings:
48
- - Question: `feedbackMessage.message.question`
49
- - Frequency: `feedbackMessage.feedbackFrequency`
50
-
51
- ### Step 5: Deploy Widget
52
-
53
- 1. Get embed code from "Deploy" section
54
- 2. Add to your website:
55
-
56
- ```html
57
- <script src="https://widget.ema.co/chat/{persona-id}.js"></script>
58
- ```
59
-
60
- ### Step 6: Test
61
-
62
- 1. **Preview Mode**: Use the built-in chat preview
63
- 2. **Test Scenarios**:
64
- - Test knowledge base queries
65
- - Test each category branch
66
- - Test fallback handling
67
- - Test source citations
68
- 3. **Edge Cases**:
69
- - Test with off-topic queries
70
- - Test with multi-turn conversations
71
- - Test with complex questions
72
-
73
- ## Files
74
-
75
- | File | Description |
76
- |------|-------------|
77
- | `workflow-prompt.md` | Auto Builder prompt with safeguards |
78
- | `persona-config.json` | Chat AI configuration |
79
- | `proto-config.json` | Full API-deployable config |
80
- | `docs/` | Knowledge base documents |
81
-
82
- ## Testing Checklist
83
-
84
- - [ ] Workflow generates without validation errors
85
- - [ ] Knowledge search returns relevant results
86
- - [ ] Source citations appear correctly
87
- - [ ] All category paths work
88
- - [ ] Fallback provides helpful response
89
- - [ ] Widget loads on allowed domains
90
- - [ ] Feedback collection works
91
-
92
- ## Maintenance
93
-
94
- | Change Type | Action |
95
- |-------------|--------|
96
- | Workflow logic | Update `workflow-prompt.md`, re-generate |
97
- | Chat settings | Update `persona-config.json`, apply in UI |
98
- | Knowledge content | Update docs in `docs/`, re-upload |
99
- | Allowed domains | Update `chatbotSdkConfig.allowedDomains` |
100
-
101
- ## Troubleshooting
102
-
103
- ### Widget doesn't load
104
-
105
- - Check `allowedDomains` includes your domain
106
- - Verify embed code is correct
107
- - Check browser console for errors
108
-
109
- ### Poor search results
110
-
111
- - Review document chunking settings
112
- - Add more specific tags
113
- - Improve document structure
114
-
115
- ### Missing source citations
116
-
117
- - Ensure `disableSources: false`
118
- - Verify documents have clear headings
119
- - Check that search is returning results
@@ -1,111 +0,0 @@
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
- }
@@ -1,156 +0,0 @@
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