Virtual Agent logo

Virtual Agent

Organization
serac-labs
virtual-agent

Build ServiceNow Virtual Agent — sys_cs_topic conversations, topic blocks (text/prompt/script/decision/handoff), NLU utterances and custom entities, quick replies, and KB/incident integration scripts.

Overview

Publisherserac-labs
Repositoryserac
Skill namevirtual-agent
Stars
77
Forks
28
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by serac-labs on GitHub. Read the source before you install it.

Installation

Install the Virtual Agent AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/serac-labs/serac/tree/main/packages/skills/virtual-agent
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/serac-labs/serac.git /tmp/serac
mkdir -p .claude/skills
cp -r /tmp/serac/packages/skills/virtual-agent .claude/skills/virtual-agent
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Virtual Agent in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Virtual Agent on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Virtual Agent is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Virtual Agent for ServiceNow

Virtual Agent (VA) provides conversational AI capabilities for self-service through chat interfaces.

Virtual Agent Architecture

Topic Structure

Topic: Password Reset
├── NLU Model
│   ├── Utterances: "reset my password", "forgot password"
│   └── Entities: application_name
├── Topic Blocks (Flow)
│   ├── Greeting
│   ├── Ask for Application
│   ├── Verify User
│   ├── Process Reset
│   └── Confirmation
└── Variables
    ├── user_email
    └── application

Key Tables

TablePurpose
sys_cs_topicTopic definitions
sys_cs_topic_blockConversation flow blocks
sys_cs_intentNLU intents
sys_cs_utteranceTraining phrases
sys_cs_entityCustom entities

Topics

Creating a Topic (ES5)

javascript
// Create Password Reset topic
var topic = new GlideRecord("sys_cs_topic")
topic.initialize()
topic.setValue("name", "Password Reset")
topic.setValue("description", "Help users reset their passwords")
topic.setValue("active", true)

// NLU configuration
topic.setValue("goal", "I want to reset my password")
topic.setValue("nlu_enabled", true)

// Category
topic.setValue("category", "IT Support")

var topicSysId = topic.insert()

Topic Variables

javascript
// Add variable to topic
var variable = new GlideRecord("sys_cs_topic_variable")
variable.initialize()
variable.setValue("topic", topicSysId)
variable.setValue("name", "user_email")
variable.setValue("label", "Email Address")
variable.setValue("type", "string")
variable.setValue("mandatory", true)
variable.insert()

Topic Blocks

Block Types

TypePurposeExample
TextDisplay message"I can help with that!"
PromptAsk question"What's your email?"
ScriptRun server codeLookup user, create ticket
DecisionBranching logicIf VIP then...
LinkExternal linkOpen portal page
HandoffAgent transferConnect to live agent

Text Block

javascript
// Greeting block
var block = new GlideRecord("sys_cs_topic_block")
block.initialize()
block.setValue("topic", topicSysId)
block.setValue("name", "greeting")
block.setValue("type", "text")
block.setValue("order", 100)
block.setValue("message", "Hello! I can help you reset your password. Let me gather some information.")
block.insert()

Prompt Block

javascript
// Ask for email
var promptBlock = new GlideRecord("sys_cs_topic_block")
promptBlock.initialize()
promptBlock.setValue("topic", topicSysId)
promptBlock.setValue("name", "ask_email")
promptBlock.setValue("type", "prompt")
promptBlock.setValue("order", 200)
promptBlock.setValue("message", "What is your email address?")
promptBlock.setValue("variable_name", "user_email")
promptBlock.setValue("validation_type", "email")
promptBlock.insert()

Script Block (ES5)

javascript
// Script block to verify user
var scriptBlock = new GlideRecord("sys_cs_topic_block")
scriptBlock.initialize()
scriptBlock.setValue("topic", topicSysId)
scriptBlock.setValue("name", "verify_user")
scriptBlock.setValue("type", "script")
scriptBlock.setValue("order", 300)

// Server-side script (ES5 only!)
scriptBlock.setValue(
  "script",
  "(function execute(inputs, outputs) {\n" +
    "    var email = inputs.user_email;\n" +
    '    var user = new GlideRecord("sys_user");\n' +
    '    user.addQuery("email", email);\n' +
    "    user.query();\n" +
    "    \n" +
    "    if (user.next()) {\n" +
    "        outputs.user_found = true;\n" +
    '        outputs.user_name = user.getValue("name");\n' +
    "        outputs.user_sys_id = user.getUniqueValue();\n" +
    "    } else {\n" +
    "        outputs.user_found = false;\n" +
    "    }\n" +
    "})(inputs, outputs);",
)
scriptBlock.insert()

Decision Block

javascript
// Decision based on user found
var decisionBlock = new GlideRecord("sys_cs_topic_block")
decisionBlock.initialize()
decisionBlock.setValue("topic", topicSysId)
decisionBlock.setValue("name", "check_user")
decisionBlock.setValue("type", "decision")
decisionBlock.setValue("order", 400)

// Decision branches configured separately
decisionBlock.insert()

// Add decision branches
var branch1 = new GlideRecord("sys_cs_topic_block_branch")
branch1.initialize()
branch1.setValue("block", decisionBlock.getUniqueValue())
branch1.setValue("condition", "user_found == true")
branch1.setValue("next_block", processResetBlockSysId)
branch1.insert()

var branch2 = new GlideRecord("sys_cs_topic_block_branch")
branch2.initialize()
branch2.setValue("block", decisionBlock.getUniqueValue())
branch2.setValue("condition", "user_found == false")
branch2.setValue("next_block", userNotFoundBlockSysId)
branch2.insert()

Handoff Block

javascript
// Transfer to live agent
var handoffBlock = new GlideRecord("sys_cs_topic_block")
handoffBlock.initialize()
handoffBlock.setValue("topic", topicSysId)
handoffBlock.setValue("name", "transfer_agent")
handoffBlock.setValue("type", "handoff")
handoffBlock.setValue("order", 900)
handoffBlock.setValue("message", "Let me connect you with a live agent who can help further.")
handoffBlock.setValue("queue", liveSupportQueueSysId)
handoffBlock.insert()

NLU Training

Adding Utterances

javascript
// Add training utterances for intent
function addUtterance(topicId, text) {
  var utt = new GlideRecord("sys_cs_utterance")
  utt.initialize()
  utt.setValue("topic", topicId)
  utt.setValue("utterance", text)
  utt.insert()
}

// Training phrases for password reset
addUtterance(topicSysId, "reset my password")
addUtterance(topicSysId, "I forgot my password")
addUtterance(topicSysId, "change my password")
addUtterance(topicSysId, "password not working")
addUtterance(topicSysId, "can't log in")
addUtterance(topicSysId, "locked out of my account")
addUtterance(topicSysId, "need to reset password for @application")

Custom Entities

javascript
// Create custom entity for applications
var entity = new GlideRecord("sys_cs_entity")
entity.initialize()
entity.setValue("name", "application_name")
entity.setValue("description", "Enterprise application names")
entity.setValue("type", "list")
entity.insert()

// Add entity values
var values = ["SAP", "Salesforce", "Workday", "ServiceNow", "Email"]
for (var i = 0; i < values.length; i++) {
  var val = new GlideRecord("sys_cs_entity_value")
  val.initialize()
  val.setValue("entity", entity.getUniqueValue())
  val.setValue("value", values[i])
  val.setValue("synonyms", "") // comma-separated synonyms
  val.insert()
}

Quick Replies

Configuring Quick Replies

javascript
// Add quick reply options to prompt
var promptWithReplies = new GlideRecord("sys_cs_topic_block")
promptWithReplies.initialize()
promptWithReplies.setValue("topic", topicSysId)
promptWithReplies.setValue("name", "select_application")
promptWithReplies.setValue("type", "prompt")
promptWithReplies.setValue("order", 150)
promptWithReplies.setValue("message", "Which application do you need to reset?")
promptWithReplies.setValue("variable_name", "application")
promptWithReplies.setValue(
  "quick_replies",
  JSON.stringify([
    { label: "Email", value: "email" },
    { label: "SAP", value: "sap" },
    { label: "ServiceNow", value: "servicenow" },
    { label: "Other", value: "other" },
  ]),
)
promptWithReplies.insert()

Integration Actions

Create Incident from VA (ES5)

javascript
// Script block to create incident
var createIncidentScript =
  "(function execute(inputs, outputs) {\n" +
  '    var inc = new GlideRecord("incident");\n' +
  "    inc.initialize();\n" +
  '    inc.setValue("caller_id", inputs.user_sys_id);\n' +
  '    inc.setValue("short_description", "Password Reset Request: " + inputs.application);\n' +
  '    inc.setValue("description", "User requested password reset via Virtual Agent.");\n' +
  '    inc.setValue("category", "software");\n' +
  '    inc.setValue("subcategory", "password reset");\n' +
  '    inc.setValue("priority", 3);\n' +
  "    \n" +
  "    var sysId = inc.insert();\n" +
  "    \n" +
  '    outputs.incident_number = inc.getValue("number");\n' +
  "    outputs.incident_sys_id = sysId;\n" +
  "})(inputs, outputs);"

Lookup Records (ES5)

javascript
// Script to lookup knowledge articles
var lookupKBScript =
  "(function execute(inputs, outputs) {\n" +
  "    var query = inputs.user_question;\n" +
  "    var articles = [];\n" +
  "    \n" +
  '    var kb = new GlideRecord("kb_knowledge");\n' +
  '    kb.addQuery("workflow_state", "published");\n' +
  '    kb.addQuery("short_description", "CONTAINS", query);\n' +
  "    kb.setLimit(3);\n" +
  "    kb.query();\n" +
  "    \n" +
  "    while (kb.next()) {\n" +
  "        articles.push({\n" +
  '            number: kb.getValue("number"),\n' +
  '            title: kb.getValue("short_description"),\n' +
  "            sys_id: kb.getUniqueValue()\n" +
  "        });\n" +
  "    }\n" +
  "    \n" +
  "    outputs.articles = JSON.stringify(articles);\n" +
  "    outputs.article_count = articles.length;\n" +
  "})(inputs, outputs);"

MCP Tool Integration

Available VA Tools

ToolPurpose
snow_create_va_topicCreate topic
snow_create_va_topic_blockAdd conversation block
snow_discover_va_topicsFind topics
snow_send_va_messageTest conversation
snow_get_va_conversationGet conversation history
snow_handoff_to_agentTransfer to agent

Example Workflow

javascript
// 1. Create topic
var topicId = await snow_create_va_topic({
  name: "IT Equipment Request",
  description: "Help users request new equipment",
  category: "IT Support",
})

// 2. Add greeting block
await snow_create_va_topic_block({
  topic: topicId,
  name: "greeting",
  type: "text",
  order: 100,
  message: "I can help you request new IT equipment!",
})

// 3. Add prompt block
await snow_create_va_topic_block({
  topic: topicId,
  name: "equipment_type",
  type: "prompt",
  order: 200,
  message: "What type of equipment do you need?",
  quick_replies: ["Laptop", "Monitor", "Keyboard", "Mouse"],
})

// 4. Test conversation
await snow_send_va_message({
  topic: topicId,
  message: "I need a new laptop",
})

Best Practices

  1. Clear Intents - One purpose per topic
  2. Rich Training - Many varied utterances
  3. Graceful Fallback - Handle unknown inputs
  4. Quick Replies - Reduce typing
  5. Confirmation - Verify before actions
  6. Handoff Path - Always allow agent transfer
  7. Test Thoroughly - Many conversation paths
  8. Persona - Consistent friendly tone

Frequently asked questions

What does the Virtual Agent AI skill do?

Build ServiceNow Virtual Agent — sys_cs_topic conversations, topic blocks (text/prompt/script/decision/handoff), NLU utterances and custom entities, quick replies, and KB/incident integration scripts.

Why use Virtual Agent on TypingMind?

Because you install it once and use it with any model. Virtual Agent is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Virtual Agent in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/serac-labs/serac/tree/main/packages/skills/virtual-agent. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Virtual Agent?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Virtual Agent?

As many as you like. As long as a model supports skills, you can use Virtual Agent with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Virtual Agent AI skill free?

Yes. It is published on GitHub by serac-labs under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇