Skip to main content

Build Your First Conversational Agent

In this guide, you’ll build a conversational AI agent that collects customer feedback through natural dialogue. Instead of a boring form, users chat with an AI that guides them through providing information. What you’ll build: A feedback collector that asks about satisfaction, collects suggestions, and thanks the user — all through conversation. Time: 15-20 minutes

What You’ll Learn

  • How to create a skillset for conversational data collection
  • Setting up the Ask a Person node
  • Configuring communication channels
  • Testing your conversational agent

Prerequisites

  • A CogniAgent account
  • Basic understanding of workflows

The End Result

Here’s what the conversation will look like:
AI: Hi! Thanks for being a customer. I’d love to hear your feedback. On a scale of 1-10, how satisfied are you with our service? User: I’d say about 8 AI: Great to hear! An 8 is solid. What’s one thing we could do to make it a 10? User: Faster shipping would be nice AI: That’s helpful feedback — faster shipping is definitely something we’re working on. Anything else you’d like to share? User: Nope, that’s it AI: Perfect! Thanks for taking the time. Your feedback helps us improve. Have a great day!
Behind the scenes, your workflow captures:
  • Satisfaction score: 8
  • Improvement suggestion: “Faster shipping would be nice”
  • Additional comments: None

Step 1: Create Your Application

1

Go to Applications

From the CogniAgent dashboard, click Applications in the sidebar.
2

Create a new application

Click New Application and name it “Customer Feedback Bot”.
3

Create a workflow

Inside your application, click New Workflow and name it “Feedback Collector”.

Step 2: Add the Start Trigger

Every workflow needs a trigger. For testing, we’ll use a manual start.
1

Add a Start node

Drag a Start node onto the canvas. This lets you manually trigger the workflow while testing.
2

Configure test data

In the Start node settings, add some test input data:
{
  "customerName": "Alex",
  "customerEmail": "[email protected]"
}

Step 3: Add the Ask a Person Node

This is where the magic happens. The Ask a Person node manages the conversation.
1

Add Ask a Person node

Drag an Ask a Person node onto the canvas and connect it to the Start node.
2

Name it

Set the display name to “Feedback Conversation” and key to feedback_conv.

Step 4: Configure Your Skillset

The skillset defines what information your AI collects and how it converses.
1

Open skillset configuration

In the Ask a Person node settings, find the Skillset section.
2

Create the skillset

Add a new skillset with this configuration:
{
  "name": "Customer Feedback",
  "description": "Collect customer satisfaction feedback through friendly conversation",

  "persona": {
    "agentName": "Feedback Assistant",
    "tone": "Friendly, appreciative, and genuinely interested in feedback"
  },

  "fields": [
    {
      "id": "satisfaction_score",
      "name": "Satisfaction Score",
      "description": "Customer's satisfaction rating from 1-10",
      "type": "number",
      "required": true
    },
    {
      "id": "improvement_suggestion",
      "name": "Improvement Suggestion",
      "description": "What could we do better to improve their experience",
      "type": "text",
      "required": true
    },
    {
      "id": "additional_comments",
      "name": "Additional Comments",
      "description": "Any other feedback they want to share",
      "type": "text",
      "required": false
    }
  ],

  "greeting": "Hi {{customerName}}! Thanks for being a customer. I'd love to hear your feedback.",
  "confirmationMessage": "Perfect! Thanks for taking the time. Your feedback helps us improve. Have a great day!"
}

Understanding the Skillset

Let’s break down what each part does:
SectionPurpose
personaDefines the AI’s personality and tone
fieldsThe information to collect (like form fields, but conversational)
greetingThe opening message (uses {{customerName}} from workflow data)
confirmationMessageThe closing message after all data is collected

Understanding Fields

Each field has:
  • id — How you reference the data later ({{feedback_conv.satisfaction_score}})
  • name — Human-readable name for summaries
  • description — Tells the AI what to ask for (the AI uses this to phrase questions naturally)
  • type — Data type (text, number, selection, etc.)
  • required — Whether to skip if user can’t/won’t answer

Step 5: Configure the Channel

Choose how users will communicate with your agent.
1

Select a channel

For testing, select Web Widget as the channel. This gives you a chat interface to test with.
2

Optional: Add more channels

You can also enable Email or Slack if you have those integrations connected.

Step 6: Handle the Completion

When the conversation finishes, you’ll want to do something with the collected data.
1

Connect the event handle

The Ask a Person node has an Event Handle output. This triggers when the conversation completes.
2

Add an Update Variable node

Connect an Update Variable node to store the feedback:
{
  "variableName": "collected_feedback",
  "value": {
    "score": "{{feedback_conv.collectedData.satisfaction_score}}",
    "suggestion": "{{feedback_conv.collectedData.improvement_suggestion}}",
    "comments": "{{feedback_conv.collectedData.additional_comments}}",
    "collectedAt": "{{timestamp}}"
  }
}
3

Optional: Add notifications

Add an App Action node to send the feedback to Slack or add it to a Google Sheet.
Your workflow should now look like:

Step 7: Test Your Agent

1

Save the workflow

Click Save to save your workflow.
2

Run the workflow

Click Run to start the workflow. This will initiate the conversation.
3

Open the chat

A chat window will appear (or check the channel you configured). You’ll see the greeting message.
4

Have a conversation

Respond naturally! Try:
  • Giving a satisfaction score
  • Providing a suggestion
  • Saying you have nothing else to add
5

Check the results

After the conversation ends, check the Execution History to see the collected data.

What’s Happening Behind the Scenes

When your agent runs, here’s the flow:
  1. Workflow starts → Passes customer data to the skillset
  2. AI sends greeting → Uses the persona and greeting template
  3. User responds → AI analyzes the response
  4. AI decides what to do → Accept answer? Ask for clarification? Move on?
  5. Repeat → Until all required fields are collected
  6. AI confirms and closes → Sends confirmation message
  7. Workflow continues → Event handle triggers with collected data
The AI makes intelligent decisions at each step. If the user says “probably like a 7 or 8”, it picks up that 7-8 is the satisfaction score without asking again.

Experiment and Extend

Now that you have a working agent, try these variations:

Add Field Validation

Make the satisfaction score require a 1-10 range:
{
  "id": "satisfaction_score",
  "name": "Satisfaction Score",
  "description": "Customer's satisfaction rating, must be a number from 1 to 10",
  "type": "number",
  "required": true,
  "maxAttempts": 3
}
The maxAttempts limits how many times the AI will ask for clarification before moving on.

Add a Conditional Field

Only ask about specific issues if the score is low:
{
  "id": "issue_details",
  "name": "Issue Details",
  "description": "If satisfaction is 5 or below, what specific issues did they experience",
  "type": "text",
  "required": false,
  "condition": "satisfaction_score <= 5"
}

Connect to a Real Trigger

Replace the Start node with:
  • App Trigger (Email) — Start feedback collection when a customer emails
  • Webhook — Trigger from your website after a purchase
  • Scheduled Trigger — Send feedback requests on a schedule

Send Results Somewhere

Add nodes after the conversation completes:
  • App Action (Google Sheets) — Log feedback to a spreadsheet
  • App Action (Slack) — Alert your team about low scores
  • App Action (HubSpot) — Update the customer record

Troubleshooting

Check your field descriptions. If they’re vague, the AI might not recognize valid answers. Be specific about what you’re collecting.
Adjust the persona.tone in your skillset. Add personality descriptors like “warm”, “casual”, or “empathetic”.
Add maxAttempts to fields so the AI moves on after a few tries. Also ensure optional fields are marked required: false.
Make sure you’re referencing the correct path: {{node_key.collectedData.field_id}}. Check your node key matches.

Next Steps

You’ve built your first conversational agent! Here’s where to go next: