Agents

Ricardo Updated by Ricardo

Agents

The Agent card lets you create sophisticated, agentic AI-powered conversations that are natural, resilient and, honestly, magical.

It's packed with powerful features. Let's look at them one by one.

Instructions

Your agent's instructions define how it behaves. Write them clearly and specifically so the agent acts the way you need.

Prompting tips
Start with a role and context: Begin by telling the agent what it is and what it's doing. Example: "You are a patient appointment reminder assistant" or "You are a diabetes check-in bot for our clinic." This grounds all its decisions.

Be explicit about what to do: Don't say "be helpful." Say exactly what you want: "Send friendly reminders 24 hours before appointments" or "Check in weekly on medication adherence." The more specific, the better the agent performs.

Set clear boundaries: Tell the agent what NOT to do. For healthcare: "Never prescribe medications," "Never diagnose conditions," "Never discuss treatment plans." Be explicit about topics that need human review.

Show, don't just tell: Include examples of good responses. Instead of "handle escalations well," write: "If a patient reports chest pain, respond: 'This needs immediate attention. Please contact your clinic right away.'"

Define tone and language: Specify how the agent should sound and what language to use: "Keep responses brief (2-3 sentences)," "Use formal medical language," or "Be warm and conversational."

Test and refine: Start with your core instructions, try them with real scenarios, and adjust based on what works. Good instructions usually need iteration.

Pro tip: What we tend to do ourselves is to write a prompt, and ask an LLM like ChatGPT or Claude to improve it.

Actions

Actions are how you connect Agents to the rest of your Journeys. They let you define conditions when the Agent should exit the conversation, and move somewhere else.

Before replying to a user's message, the Agent first checks if it matches any action you specified. If it does, it immediately follows the branch you defined in your journey. If it doesn't, it replies to the user.

A few examples on how you can use this:

  • Agentic workflows: connect multiple specialised Agents to each other (tip: if you're doing this, we recommend having a "router" agent that routes the user without replying, that all sub-agents connect to)
  • Drive users to another part of your journeys: it's a great way to mix Agents and the rest of your Journeys
  • Escalate to a human: if you have human support, create an action that detects if the user wants to speak with a person

Memory

By default, we give Agents all the messages from the last 2 hours of conversation. This makes it reply contextually to what happened before it started, making it a more seamless experience.

However, you can also fine-tune the Agent's memory, so that its memory settings match your goals. Here's what the 3 options do:

  • None: this sends no past messages to the Agent. Great for sensitive situations
  • This journey: this only sends messages sent during this session in this specific journey
  • Conversation: this automatically sends past messages in the conversation, regardless where they happened. You can customise how far back we should have memory for.

Longer-term memory is auto-compacted by the Agent block on-demand, so that token spend is optimal.

Pass profile fields

You can also pass the user's profile, so that responses are more personalised. You have full control over how much (or how little) fields you pass. By default, we pass none — for maximum privacy.

Collect data

You can also configure your Agents to collect data, which is super handy for things like onboarding, registration, appointment booking, surveys, and anything that requires the Agent to proactively collect.

Just tell it what information you want, and which profile field to save it. Presto.

Skills

Last, but definitely not least, Agents can also perform operations in the background to enrich the conversation. These are called Skills.

You can use them anytime your Agent requires some external information, like checking a doctor's calendar for available timeslots, retrieve any extra context not in the main prompt, or performing an action like booking an appointment.

There are 2 types of skills:

💡 Knowledge skills

Instead of having one big prompt with everything your Agent needs to know, which makes it expensive and slow, you can now break its knowledge into smaller chunks. Each chunk is a Knowledge Skill.

Then, when the Agent needs that information, it retrieves it. Internally, the Agent keeps a "table of contents" of everything it knows, only accessing knowledge when it needs.

This makes generations much cheaper and faster!

Skills are reusable across different Agents, so you can also easily reuse knowledge across Agents.

⚡️ Function Skills

If you're familiar with function calling, you'll be at home with Function Skills. They give your Agents capabilities of executing custom code to enrich their conversations.

Want it to autonomously book an appointment into your system? Or retrieve a list of doctors and their availabilities? Or get the current weather? Simply build a Function Skill for your Agent, and they'll autonomously use it whenever they need them

How to build Function Skills?

Function skills are built using the Lua programming language and the Turn SDK. Here are in-depth developer docs.

Not a developer? No problem. LLMs are extremely capable of generating Lua code. We've created a Claude Skill that allows you to just ask Claude to generate skills.

As with Knowledge Skills, Function Skills are also shared across Agents, helping you also manage shared knowledge and capabilities. Write once, use multiple times.

Closing thoughts

The Agent card is the most powerful way of building with Turn.io today. All of these small features, in combination, enable you to build extremely rich and high quality AI-powered conversational experiences.

We can't wait to see what you do with them.

Was this article helpful?

AI in Journeys

Start from a Playbook

Contact