Voice AI - Knowledge base agent

Written By William Bowen

Last updated 7 days ago

Intro

Use cases

Screenshots

Code

Example
{ "$schema": "https://web-api.clerk.chat/pipeline-schema", "name": "Voice AI - Knowledge base", "nodes": [ { "type": "tool_runner", "name": "End call", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "json", "staticId": 4, "nodeConfig": { "type": "voice_call", "config": {}, "enabledTools": [ "hangup" ], "tools": {} } }, { "type": "template", "name": "Summary over SMS", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "user_message", "staticId": 3, "nodeConfig": { "template": "Summary of call: \nQuestion: {{question}} \nAnswer: {{{answer}}} \nThank you!" } }, { "type": "tool_runner", "name": "Conclude", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "json", "staticId": 2, "nodeConfig": { "type": "voice_call", "config": {}, "enabledTools": [ "say" ], "tools": { "say": { "paramValues": { "text": { "type": "fixed", "value": "Thank you. Have a nice day. " }, "shouldLoop": { "type": "fixed", "value": true }, "allowInterruptions": { "type": "fixed", "value": true }, "disableRepeatOnSilence": { "type": "fixed", "value": true } } } } } }, { "type": "voice_bot", "name": "Satisfied with answer", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "json", "staticId": null, "nodeConfig": { "actionType": "prompt", "prompt": "Your job is to answer the customer's question using the data provided below. Do not make up any answers. So if you don't know the answer, be honest. \n\nYou should occasionally ask if you have answered the customer's question. \n\nData that will help: {{1.content}} \n\nYour output should be maximum 30 words.", "responseSchema": { "type": "object", "required": [ "answer", "satisfied?" ], "properties": { "answer": { "type": "string", "description": "answer to the customer's question" }, "satisfied?": { "type": "string", "description": "Is the customer satisfied with their answer? yes/no" } } }, "responseToolName": "satisfied-customer", "responseToolDescription": "Submits when we know if the customer is satisfied with the answer or not. ", "allowInterruptions": true, "disableRepeatOnSilence": false, "shouldLoop": true, "ivr": { "name": null, "description": null, "canNavigateToNode": false, "canNavigateFromNode": false } } }, { "type": "tool_runner", "name": "Search Knowledge base", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "json", "staticId": 1, "nodeConfig": { "type": "knowledge_base", "config": {}, "enabledTools": [ "search" ], "tools": { "search": { "paramValues": { "query": { "path": "question", "type": "pipeline-variable" }, "sourceIds": [ { "type": "fixed", "value": 2451 } ] } } } } }, { "type": "voice_bot", "name": "What's your question?", "triggeredBy": [ "unreadMessage.fromAny" ], "responseType": "json", "staticId": null, "nodeConfig": { "actionType": "prompt", "prompt": "Your job is to greet the customer and ask what their question is. \n\nYour output should be maximum 30 words", "responseSchema": { "type": "object", "required": [ "question" ], "properties": { "question": { "type": "string", "description": "The customer's question" } } }, "responseToolName": "question", "responseToolDescription": "Submits the customer's question. ", "allowInterruptions": true, "disableRepeatOnSilence": false, "shouldLoop": true, "ivr": { "name": null, "description": null, "canNavigateToNode": false, "canNavigateFromNode": false } } }, { "type": "trigger", "name": "Call Started", "triggeredBy": [ "callStarted" ], "responseType": "json", "staticId": null } ], "edges": [ { "name": null, "sourceNode": "Summary over SMS", "destinationNode": "End call", "sourceVariables": null, "filters": [] }, { "name": null, "sourceNode": "Satisfied with answer", "destinationNode": "What's your question?", "sourceVariables": null, "filters": [ { "type": "rule", "config": { "syntax": { "===": [ { "var": "message.satisfied?" }, "no" ] } } } ] }, { "name": null, "sourceNode": "Conclude", "destinationNode": "Summary over SMS", "sourceVariables": null, "filters": [] }, { "name": null, "sourceNode": "Satisfied with answer", "destinationNode": "Conclude", "sourceVariables": null, "filters": [ { "type": "rule", "config": { "syntax": { "===": [ { "var": "message.satisfied?" }, "yes" ] } } } ] }, { "name": null, "sourceNode": "Search Knowledge base", "destinationNode": "Satisfied with answer", "sourceVariables": null, "filters": [] }, { "name": null, "sourceNode": "What's your question?", "destinationNode": "Search Knowledge base", "sourceVariables": null, "filters": [] }, { "name": null, "sourceNode": "Call Started", "destinationNode": "What's your question?", "sourceVariables": null, "filters": [] } ] }