Glossary
Glossary
The glossary is a fundamental part of shaping your agent's understanding of its domain. Think of it as your agent's professional dictionary—a set of terms specific to your business or service context.
When to Use the Glossary
When you create an agent to handle specific tasks, it often needs to understand the unique vocabulary of your domain. For example, if your agent helps guests book rooms at the Boogie Nights hotel, it needs to know what "Boogie Nights" means in your context—in this case, that it's not just a movie title, but your hotel's name.
Structure of Terms
Each glossary entry consists of three components:
- Term: The word or phrase being defined
- Definition: What this term means in your specific context
- Synonyms: Alternative ways users might refer to this term
For example,
- Term: Boogie Nights
- Definition: Our luxury beachfront hotel located in Miami
- Synonyms: BN Hotel, The Boogie, Boogie Hotel
How Agents Use the Glossary
The glossary serves two crucial purposes in agent interactions. First, it helps your agent understand customers better when they interact with it. When a guest says "I'd like to stay at The Boogie," the agent knows they're referring to your hotel.
Second, it helps the agent interpret your guidelines correctly. Consider this guideline:
- Condition: The user asks about Ocean View rooms
- Action: Explain the Sunrise Package benefits
For this to work effectively, your glossary might include:
- Term: Ocean View
- Definition: Our premium rooms on floors 15-20 facing the Atlantic
- Synonyms: seaside rooms, beach view
- Term: Sunrise Package
- Definition: Complimentary breakfast and early check-in for Ocean View bookings
- Synonyms: morning special, sunrise special
Here's how to create a new glossary term:
parlant glossary create \
--agent-id AGENT_ID \
--name TERM_NAME \
--description TERM_DESCRIPTION \
--synonyms COMMA_SEPARATED_LSIT # Optional
Here's an example of how to add a glossary term to a specific agent:
parlant glossary create \
--tag agent:AGENT_ID \
--name TERM_NAME \
--description DESCRIPTION \
--synonyms COMMA_SEPARATED_LIST # Optional
You can also tag glossary terms to form term groups. Only agents who are themselves tagged with the same tag would be able to access those terms.
parlant glossary create --tag orders --name oid --description "Order ID"
parlant agent tag --id AGENT_ID --tag orders
Glossary vs Guidelines vs Agent Description
Each component serves a distinct purpose in shaping your agent's behavior:
- The Glossary teaches your agent "what things are". For example, "A Club Member is a guest who has stayed with us more than 5 times." You can have as many terms as you want.
- Guidelines teach your agent "how to act in situations". For example, "When speaking with Club Members, acknowledge their loyalty status." You can have as many guidelines as you want.
- Agent Description provides overall context and personality. For example, "You are a helpful hotel booking assistant for Boogie Nights." The agent's description is static and limited.
Think of it this way: the glossary builds your agent's vocabulary, guidelines shape its behavior, and the agent description sets its overall context, role, personality and tone.
Glossary vs Tools
While both glossary terms and tools help your agent understand your domain, they serve fundamentally different purposes. The glossary provides static knowledge, while tools enable dynamic data access.
Consider a hotel booking scenario:
Glossary Term:
- Term: Club Member
- Definition: A guest who has stayed with us more than 5 times
- Synonyms: loyal guest, regular guest
Tool:
check_member_status(user_id) # Returns current stay count and benefits
The glossary term provides a consistent definition of what a Club Member is, while the tool can check a specific user's actual status in your database. Similarly:
Glossary Term:
- Term: Ocean View Room
- Definition: Premium rooms on floors 15-20 facing the Atlantic
- Synonyms: seaside room, beach view
Tool:
check_room_availability(room_type, dates) # Returns current availability and rates
The glossary helps your agent understand what an Ocean View Room is, while the tool provides real-time information about specific rooms' availability and pricing.
This separation between static knowledge (glossary) and dynamic data access (tools) helps create clear, maintainable agent implementations that can handle both general inquiries and specific, data-driven interactions.