Glossary
Glossary
The glossary is a fundamental part of shaping your agent's understanding of its domain. Think of it as your agent's dictionary—a collection of terms specific to your business or service context.
When to Use the Glossary
When you create an agent to handle specific tasks, it 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—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 users better. 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:
- CLI
- Python
- TypeScript
$ parlant glossary create \
--agent-id AGENT_ID \
--name TERM_NAME \
--description TERM_DESCRIPTION \
--synonyms COMMA_SEPARATED_LSIT # Optional
from parlant.client import ParlantClient
client = ParlantClient(base_url=SERVER_ADDRESS)
term = client.glossary.create_term(
agent_id=AGENT_ID,
name=TERM_NAME,
description=TERM_DESCRIPTION,
synonyms=[...], # Optional
)
import { ParlantClient } from 'parlant-client';
const client = new ParlantClient({ environment: SERVER_ADDRESS });
const term = await client.glossary.createTerm(AGENT_ID, {
name: TERM_NAME,
description: TERM_DESCRIPTION,
synonyms: [...], // Optional
});
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"
- Guidelines teach your agent "how to act in situations". For example, "When speaking with Club Members, acknowledge their loyalty status"
- Agent Description provides overall context and personality. For example, "You are a helpful hotel booking assistant for Boogie Nights"
Think of it this way: the glossary builds your agent's vocabulary, guidelines shape its behavior, and the agent description sets its overall context 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.