<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yann Bohbot</title>
    <description>The latest articles on DEV Community by Yann Bohbot (@yannb9).</description>
    <link>https://dev.to/yannb9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F351604%2Fe27c3092-52f3-404c-a003-e8b93a2140f3.jpeg</url>
      <title>DEV Community: Yann Bohbot</title>
      <link>https://dev.to/yannb9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yannb9"/>
    <language>en</language>
    <item>
      <title>Building My Healthcare Agent with Zero Prompt Headaches Using Parlant</title>
      <dc:creator>Yann Bohbot</dc:creator>
      <pubDate>Tue, 13 May 2025 14:47:02 +0000</pubDate>
      <link>https://dev.to/yannb9/building-my-healthcare-agent-with-zero-prompt-headaches-using-parlant-2f4i</link>
      <guid>https://dev.to/yannb9/building-my-healthcare-agent-with-zero-prompt-headaches-using-parlant-2f4i</guid>
      <description>&lt;p&gt;I want to share my experience building customer-facing AI conversations with Parlant. Building reliable AI conversations became surprisingly straightforward with it. Rather than endlessly fiddling with prompts trying to get them to behave properly, I can now precisely control how my agents respond to specific scenarios with clear, simple, contextual guidelines.  &lt;/p&gt;

&lt;p&gt;What I like most about Parlant is that it aligns with how I think about conversations, not as standalone responses (like most Q&amp;amp;A RAG agents), but as ongoing interactions that shift, adapt, and carry context forward.&lt;/p&gt;

&lt;p&gt;The project I was working on and sharing here is designed around three healthcare-focused use cases, each demonstrated through natural interaction examples. These conversations will simulate real exchanges between a patient and a healthcare assistant, covering appointment booking, medication information, and insurance policy management. &lt;/p&gt;

&lt;p&gt;The goal in this post is to share my journey using Parlant and walk through how I structured the project, how simple it is to set up an agent, define its guidelines, and connect it to my tools. Along the way, I'll highlight some roadblocks I encounter and explain how to overcome them. Beyond showing how easy it is to build agents with Parlant, I also want to dive into best practices on how to ensure accurate, reliable responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Use Case
&lt;/h2&gt;

&lt;p&gt;My first use case focuses on helping a patient reschedule an appointment with their doctor. I'll show how the agent sticks to the rules and guidelines I've set, handling context shifts smoothly while keeping responses clear and accurate. Here's the ideal conversation I'm looking to achieve:&lt;/p&gt;

&lt;h3&gt;
  
  
  The Ideal Conversation:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Patient:&lt;/strong&gt; Hi, I need to reschedule my appointment with Dr. Chen please.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Hey Sarah! I'd be happy to help reschedule your appointment with Dr. Chen. I see your appointment is scheduled for March 18th, at 2:30 PM. What day or time would work better for you?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Patient:&lt;/strong&gt; I need something preferably in the morning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; Let me check Dr. Chen's availability for those times. I see openings on Wednesday the 26th at 9:30 AM or Friday the 28th at 10:15 AM. Would either of those work for you?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Patient:&lt;/strong&gt; The Friday appointment works. Also, will I need to do any lab work before this appointment?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; I've rescheduled your appointment for Friday, March 28th at 10:15 AM with Dr. Chen. Regarding lab work, I see Dr. Chen has ordered a basic metabolic panel for you. You should come in 15 minutes early to have blood drawn before your appointment. Is there anything else you need help with today?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Patient:&lt;/strong&gt; That's all. Thank you!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent:&lt;/strong&gt; You're welcome, Sarah. You'll receive a confirmation via email shortly. Have a great day!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Structuring My Application - Laying the Groundwork
&lt;/h2&gt;

&lt;p&gt;I don't want you to get lost with my setup. The order in which you build your agent is totally up to you. I'll do my best to explain every step I took in structuring my application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup with Poetry
&lt;/h3&gt;

&lt;p&gt;I'm creating this project with poetry, but &lt;code&gt;pip install parlant&lt;/code&gt; works the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;poetry new healthcare-agent
&lt;span class="nb"&gt;cd &lt;/span&gt;healthcare-agent
poetry add parlant 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Databases
&lt;/h3&gt;

&lt;p&gt;I'm using two separate JSON files: one for &lt;strong&gt;patients **and one for **doctors&lt;/strong&gt;. The &lt;a href="https://github.com/emcie-co/uc-healthcare-agent/blob/main/data/patients.json" rel="noopener noreferrer"&gt;patients.json&lt;/a&gt; includes all relevant information, such as contact details, upcoming appointments, lab results, medications, and allergies, for every patient. &lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/emcie-co/uc-healthcare-agent/blob/main/data/doctors.json" rel="noopener noreferrer"&gt;doctors.json&lt;/a&gt; contains the doctors' specialty, availability, current patients, and scheduled appointments for each as well. The goal is to keep both files in sync, so that when a new patient tries to book an appointment with a doctor, they'll see the most up-to-date availability.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Agent Tools
&lt;/h3&gt;

&lt;p&gt;For me, planning and preparation are key to building a good application, possibly a large-scale one. I start by noting what tools my agent needs to assist the patient in rescheduling an appointment. When users say, &lt;em&gt;“I want to schedule an appointment with my doctor,”&lt;/em&gt; I expect my agent to automatically recognize the patient, identify their doctor, and assist with their booking request.&lt;/p&gt;

&lt;p&gt;Here's how I'm breaking this down:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Identifying The Patient:&lt;/strong&gt; A tool to fetch the patient's data from the &lt;code&gt;patients.json&lt;/code&gt;. It's triggered as a &lt;a href="https://www.parlant.io/docs/concepts/customization/context-variables#creating-a-tool-enabled-context-variable" rel="noopener noreferrer"&gt;tool-enabled context variable&lt;/a&gt;, ensuring that the agent always has access to the most up-to-date patient information throughout the conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Listing Doctors' Availability:&lt;/strong&gt; A tool to fetch the doctors' availability slots. It is triggered when the patient asks for their doctor's availability in any form within the conversation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rescheduling an Appointment:&lt;/strong&gt; A tool to reschedule an existing appointment. It is triggered when the patient confirms the scheduled time slot they want to reschedule and the new time slot they wish to reschedule the appointment with.&lt;/p&gt;

&lt;p&gt;My focus here is rescheduling, but I made sure the agent can also handle new appointments and cancellations. I'm not covering them here, but they're part of the broader flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building My Healthcare Agent
&lt;/h2&gt;

&lt;p&gt;I'm going to start setting up my healthcare agent. First, I'll run the server on my terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;parlant-server run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating My Agent
&lt;/h3&gt;

&lt;p&gt;On a new terminal, I'll create my agent and give it a name and a personality through this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant agent create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"David"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"You are a detail-oriented healthcare agent who combines
warm empathy with remarkable efficiency, maintaining a gentle sense of 
humor to put anxious patients at ease, while calmly managing complex
medical needs without forgetting previously discussed details, and
skillfully prioritizing urgent matters without dropping routine tasks."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating My Guidelines
&lt;/h3&gt;

&lt;p&gt;This part is really fun. I'll create a guideline where a patient requests to schedule an appointment, and the agent asks for the patient's preferred times. I'll also create another guideline to have the agent suggest time slots based on the patient's preferences. I'm just testing this out to make sure my agent focuses on the instructions I give.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient asks to schedule an appointment"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"ask the patient for their preferred time"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient gives preferred times for scheduling an appointment"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"provide timeslots from 9:00AM to 11:00AM for morning preferences and 1:00PM to 5:00PM for afternoon preferences"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Testing It Out - Sandbox UI
&lt;/h3&gt;

&lt;p&gt;To test it out, I'll navigate to Parlant's Sandbox UI at  &lt;a href="http://localhost:8800/chat" rel="noopener noreferrer"&gt;http://localhost:8800/chat&lt;/a&gt; and start a conversation with David, my healthcare assistant. &lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/DVhkSJ9a3YE"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Parlant's Sandbox UI gives me a lot of insights into how my agent reacts to the conversation. It allows me to debug its behavior and understand its thinking process, something that you don't see much in other frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building My Conversation Flow
&lt;/h2&gt;

&lt;p&gt;This is where things get interesting. I'm going to build a flow that replicates the conversation experience from the example I listed above. I'll create service tools that work with my databases and tie them to my guidelines. When a guideline is triggered, my agent will use those tools I built to respond to the patient based on the conversation's context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up My Service Tools
&lt;/h3&gt;

&lt;p&gt;I'll create my service tools with the module command. This command generates a boilerplate module and automatically registers it in my &lt;code&gt;./parlant.toml&lt;/code&gt;, so the server loads it at startup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant-server module create module &lt;span class="nt"&gt;--template&lt;/span&gt; tool-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My &lt;code&gt;module.py&lt;/code&gt; is now located at the core of my application. However, I've reordered my files to match each conversation topic, and I'll have a &lt;code&gt;module.py&lt;/code&gt; built that acts as the main service entry point for each topic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;healthcare-agent/
└── modules/
    └── appointments/
        ├── module.py        # module entry point
        ├── general.py       # general functions
        ├── scheduling.py    # scheduling functions
        ├── rescheduling.py  # rescheduling functions
        └── cancelling.py    # cancelling functions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the tools I'm using through the &lt;code&gt;module.py&lt;/code&gt; in my &lt;code&gt;./modules/appointments&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;contextlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AsyncExitStack&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;lagom&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;parlant.sdk&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;PluginServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ServiceRegistry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ToolContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ToolParameterOptions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;modules.appointments.general&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;get_patient_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;get_doctors_availability&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;modules.appointments.rescheduling&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;reschedule_appointment&lt;/span&gt;

&lt;span class="n"&gt;EXIT_STACK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AsyncExitStack&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8199&lt;/span&gt;
&lt;span class="n"&gt;TOOLS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="n"&gt;get_patient_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;get_doctors_availability&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;reschedule_appointment&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize_module&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;container&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;127.0.0.1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PluginServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;TOOLS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;hosted&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;container&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ServiceRegistry&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;update_tool_service&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;appointments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sdk&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;PORT&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;transient&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;EXIT_STACK&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enter_async_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;EXIT_STACK&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push_async_callback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shutdown&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;shutdown_module&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;EXIT_STACK&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;aclose&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Building My Custom Tools
&lt;/h3&gt;

&lt;p&gt;With Parlant, building tools requires me to use &lt;code&gt;ToolContext&lt;/code&gt; as a tool parameter and &lt;code&gt;ToolResult&lt;/code&gt; to return the output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;mytool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ToolContext&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# your code here
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ToolContext&lt;/code&gt; gives me access to things like &lt;code&gt;customer_id&lt;/code&gt;, &lt;code&gt;agent_id&lt;/code&gt; and &lt;code&gt;session_id&lt;/code&gt; that are used in the conversation. Then, the function returns the data wrapped in a &lt;code&gt;ToolResult&lt;/code&gt;, which is stored in the conversation context.&lt;/p&gt;

&lt;h3&gt;
  
  
  My First Tool - Doctor's Availability
&lt;/h3&gt;

&lt;p&gt;I'm going to store all my information-fetching tools inside my &lt;code&gt;general.py&lt;/code&gt;. This will include getting patients' data records, doctors' availability, healthcare coverage, and more, if I need to add.&lt;/p&gt;

&lt;p&gt;I'm going to start with fetching a doctor's availability. Here's an Idea of how this would look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;parlant.core.services.tools.plugins&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;parlant.core.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ToolContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ToolResult&lt;/span&gt;

&lt;span class="n"&gt;DOCTORSDB_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;doctors_database_path&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_doctors_availability&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ToolContext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;doctor_name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;doctors_data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DOCTORSDB_PATH&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;doctor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;doctor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;doctors_data&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;doctor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;doctor_name&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;doctor&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No doctor with the name &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;doctor_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;availabilities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;doctor&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;doctor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scheduling&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;availability&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;sorted_availability&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_sort_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;availabilities&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;sorted_availability&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;availabilities&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sorted_availability&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll have this tool trigger when a patient asks about a doctor's availability schedule. The tool takes the doctor's name as an argument and searches through the doctors' database. I'll trigger it with this guideline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient asks about a doctor's availability"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"suggest the two most recent availability slots"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to tie it with my tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant guideline tool-enable &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--id&lt;/span&gt; &lt;span class="nv"&gt;$GUIDELINE_ID&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--service&lt;/span&gt; &lt;span class="s2"&gt;"appointments"&lt;/span&gt;
&lt;span class="nt"&gt;--tool&lt;/span&gt; &lt;span class="s2"&gt;"get_doctors_availability"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's test out the result:&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/hdE1iO8jZUs"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Like a toolbox pre-loaded for the job at hand!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All right, so I covered a few key parts of my project. Still, I'm missing an important piece in my application. I want my agent to recognize the patient they're speaking to. For that, I'm going to implement Parlant's &lt;a href="https://www.parlant.io/docs/concepts/entities/customers" rel="noopener noreferrer"&gt;customer&lt;/a&gt; feature, which will allow the agent to identify the patient and retrieve their data record.&lt;/p&gt;

&lt;h3&gt;
  
  
  Identifying Patients
&lt;/h3&gt;

&lt;p&gt;In Parlant, a &lt;strong&gt;“customer”&lt;/strong&gt; is just anyone talking to the agent. They are set in the Parlant server, and I can personalize my agent's behavior for each one. For now, I just want my agent to recognize them and get their medical information. I'm going to create a customer with Parlant and have its ID match the one I have in my databases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant customer create &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"Sarah Johnson"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This returns a customer ID that I'll match with my patient ID in my &lt;code&gt;patients.json&lt;/code&gt; database and will be shared with the agent through the conversation's context. So when the agent calls &lt;code&gt;get_patient_data&lt;/code&gt; or any tool needing a patient ID, it will access it from the tool's &lt;code&gt;ToolContext&lt;/code&gt; using &lt;code&gt;customer_id&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_patient_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ToolContext&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;patients_db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PATIENTSDB_PATH&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;patient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;patient&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;patients_db&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;patient&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;patient_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ToolResult&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;patient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when the tool is called, it will return the data record for the patient whose &lt;code&gt;context.customer_id&lt;/code&gt; matches the &lt;code&gt;patient_id&lt;/code&gt; from the patients database.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keeping Track Of The Latest Record Updates
&lt;/h3&gt;

&lt;p&gt;I mentioned earlier that there's a way to ensure that my agent works with the most up-to-date data from the patient in the database. This stems from a common misuse of guidelines, which I initially fell into as well.&lt;/p&gt;

&lt;p&gt;At first, I thought I needed to trigger the  &lt;code&gt;get_patient_data&lt;/code&gt; tool using a guideline, where the condition is that it triggers at the start of the conversation. The problem with that approach is that the agent only fetches the data at the beginning. If that data changes later, the agent won't call the &lt;code&gt;get_patient_data&lt;/code&gt; tool again because the trigger condition no longer applies.&lt;/p&gt;

&lt;p&gt;The right way to do it is to apply the &lt;a href="https://www.parlant.io/docs/concepts/customization/context-variables#creating-a-tool-enabled-context-variable" rel="noopener noreferrer"&gt;tool-enabled context variable&lt;/a&gt;. It's a way to continuously run the &lt;code&gt;get_patient_data&lt;/code&gt; tool, on every agent response. Here's how to do it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant variable create &lt;span class="sb"&gt;`&lt;/span&gt;     
&lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"Getting the patient the most up-to-date medical record"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"up-to-date-patient-medical-record"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--service&lt;/span&gt; &lt;span class="s2"&gt;"appointments"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--tool&lt;/span&gt; &lt;span class="s2"&gt;"get_patient_data"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can also control the time frames in which I want this tool to be triggered by adding &lt;code&gt;--freshness-rules&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Time to put it to the test:&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/EXmnY7kx_jk"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Cooking Up the Last Bits
&lt;/h2&gt;

&lt;p&gt;Now that I've walked through the baseline of building my healthcare agent, it's time to pull it all together. I'm going to wrap this up and bring the rest of the implementation to life.&lt;/p&gt;

&lt;p&gt;These are the guidelines I've set in place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient requests to reschedule an appointment"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"refer the patient's scheduled appointments and ask which appointment they want to reschedule"&lt;/span&gt;

parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient chooses the appointment they want to reschedule"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"ask the patient what day or time would work better for them to reschedule."&lt;/span&gt;

parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient provides a preferred day or time for rescheduling"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"provide the doctor's next two available appointment slots based on the user's preference"&lt;/span&gt;

parlant guideline create &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--condition&lt;/span&gt; &lt;span class="s2"&gt;"patient chooses appointment slot for rescheduling with their doctor"&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nt"&gt;--action&lt;/span&gt; &lt;span class="s2"&gt;"assist and confirm the appointment in detail"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, I'll set the tools I want to trigger:&lt;/p&gt;

&lt;p&gt;This guideline:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; patient provides a preferred day or time for rescheduling&lt;br&gt;
&lt;strong&gt;Action:&lt;/strong&gt; provide the doctor's next two available appointment slots based on the user's preference&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Triggers this tool:  &lt;code&gt;get_doctors_availability&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This guideline:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; patient chooses appointment slot for rescheduling with their doctor&lt;br&gt;
&lt;strong&gt;Action:&lt;/strong&gt; assist and confirm the appointment in detail&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Triggers this tool:  &lt;code&gt;reschedule_appointment&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  First Tentative Conversation
&lt;/h3&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/kyYn8_mQokA"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This was the first full conversation I had with the agent, start to finish. My biggest learning curve wasn't in the setup (which felt smooth and straightforward), but simply learning how to control the agent through guidelines and tools. &lt;/p&gt;

&lt;p&gt;What I really appreciate is that I don't need to rely on excessive prompt tuning to get the agent to follow my “business needs”. Parlant already has a smart system in place for that, called &lt;a href="https://www.parlant.io/files/AttentiveReasoningQueries.pdf" rel="noopener noreferrer"&gt;ARQs&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;My agent now follows my instructions the way I wanted it to. Regardless of that, this isn't the conversation experience I'm expecting to have (Obi-Wan Kenobi mind control gesture). Thankfully, Parlant addresses this, too.&lt;/p&gt;

&lt;p&gt;In my next post, I'll cover how to match the conversation style of my ideal example using Styled Utterances. I'll walk through how to build utterance templates that reflect the tone I want and show how to restrict the agent to only use responses generated from those templates when generating responses.&lt;/p&gt;

</description>
      <category>parlant</category>
      <category>llm</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
