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 minutesWhat 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
Step 2: Add the Start Trigger
Every workflow needs a trigger. For testing, we’ll use a manual start.Add a Start node
Drag a Start node onto the canvas. This lets you manually trigger the workflow while testing.
Step 3: Add the Ask a Person Node
This is where the magic happens. The Ask a Person node manages the conversation.Step 4: Configure Your Skillset
The skillset defines what information your AI collects and how it converses.Understanding the Skillset
Let’s break down what each part does:| Section | Purpose |
|---|---|
persona | Defines the AI’s personality and tone |
fields | The information to collect (like form fields, but conversational) |
greeting | The opening message (uses {{customerName}} from workflow data) |
confirmationMessage | The 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.Select a channel
For testing, select Web Widget as the channel. This gives you a chat interface to test with.
Step 6: Handle the Completion
When the conversation finishes, you’ll want to do something with the collected data.Connect the event handle
The Ask a Person node has an Event Handle output. This triggers when the conversation completes.
Step 7: Test Your Agent
Open the chat
A chat window will appear (or check the channel you configured). You’ll see the greeting message.
Have a conversation
Respond naturally! Try:
- Giving a satisfaction score
- Providing a suggestion
- Saying you have nothing else to add
What’s Happening Behind the Scenes
When your agent runs, here’s the flow:- Workflow starts → Passes customer data to the skillset
- AI sends greeting → Uses the persona and greeting template
- User responds → AI analyzes the response
- AI decides what to do → Accept answer? Ask for clarification? Move on?
- Repeat → Until all required fields are collected
- AI confirms and closes → Sends confirmation message
- Workflow continues → Event handle triggers with collected data
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: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: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
The AI keeps asking the same question
The AI keeps asking the same question
Check your field descriptions. If they’re vague, the AI might not recognize valid answers. Be specific about what you’re collecting.
The conversation feels robotic
The conversation feels robotic
Adjust the
persona.tone in your skillset. Add personality descriptors like “warm”, “casual”, or “empathetic”.Users are getting stuck
Users are getting stuck
Add
maxAttempts to fields so the AI moves on after a few tries. Also ensure optional fields are marked required: false.I'm not getting the collected data
I'm not getting the collected data
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:Lead Qualification Guide
Build a more complex agent that qualifies leads and syncs to your CRM.
Skillset Engine Reference
Deep dive into all skillset configuration options.
Channels Documentation
Learn about all available communication channels.
E-commerce Returns Guide
See a real-world example with integrations.
