> Source: https://builder-docs.ema.ai/builder-guides/examples/employee-assistant
> Title: Example: Building an Employee Assistant

# Example: Building an Employee Assistant

> This walkthrough builds a complete Employee Assistant AI Employee using Ema's Employee Experience Suite. The finished assistant handles greetings, answers personalized HR policy questions, and falls back to document search for general queries.

## What You Will Build

A chatbot AI Employee that:

-   Classifies incoming messages by intent (greetings versus policy questions)
-   Summarizes conversation context for multi-turn interactions
-   Extracts personalization tags (country, band) from the user profile
-   Rewrites queries for optimal document retrieval
-   Searches uploaded HR documents and returns cited answers

## Prerequisites

-   Access to the GWE platform
-   One or more HR policy documents (PDF, DOCX, or TXT) ready to upload

## Locate the Chatbot Template Tile

1.  Navigate to the GWE platform.
2.  Locate the tile labeled **GWE Chatbot Persona**.
3.  Click **Create and save** and assign a name to your assistant (for example, "Employee Assistant").

## Access the Workflow Builder

1.  Click **Go to Workflow builder** on the confirmation screen.
2.  A **Chat Trigger** block is automatically present. This block handles all incoming user conversations.

## Step 1: Add a Categorize Conversations and Route Agent

The Categorize Conversations and Route agent classifies incoming queries so the workflow can route them to the correct path.

1.  Add the **Categorize Conversations and Route** agent to the canvas.
2.  Connect the chat trigger's **chat conversation** output to the **conversation input** of the categorizer.
3.  Open the categorizer's configuration panel on the right.
4.  Click **Add a Category** and define the following intents:
    -   **Greetings/Feature Inquiries** -- example phrases: "Hi", "What can you do?", "Hello there!"
    -   **Fallback** (default category) -- catches any query that does not match a defined category. In this example, fallback handles general HR questions that require document lookup.

## Step 2: Maintain Context with a Conversation Summarizer

The Conversation Summarizer condenses the chat history so downstream agents receive concise context instead of the full transcript.

1.  Add the **Conversation Summarizer** agent.
2.  Connect the chat trigger's **chat conversation** output to its **conversation input**.
3.  Set a **Trigger When** condition so this agent runs only when the **Fallback** category is active:
    -   Click the agent, select **Add Trigger When**, and choose the **Fallback** category from the categorizer.

## Step 3: Extract Personalization Tags

The Tag Extractor pulls metadata such as country and band from the user's profile, enabling personalized responses.

1.  Add the **Tag Extractor** agent.
2.  Connect the chat trigger's **chat conversation** output to its **conversation input**.

## Step 4: Respond to Greetings

1.  Add a **Respond to a Query** agent to handle queries in the Greetings category.
2.  Connect the chat trigger's **user query** to this agent's **query input**.
3.  In the configuration panel, write instructions that provide a friendly introduction and list the assistant's capabilities.
4.  Rename the agent to something descriptive (for example, "Greetings Responder").
5.  Set a **Trigger When** condition so this agent fires only for the **Greetings/Feature Inquiries** category.

## Step 5: Rewrite the Query for the Fallback Path

A Query Rewriter reformulates the user's question using conversation context and personalization tags, producing a search-optimized query.

1.  Add a **Respond to a Query** agent and rename it **Query Rewriter**.
2.  Write instructions that tell the agent to act as a query rewriter -- combining the summarized conversation and user tags into a single, coherent search query.
3.  Connect the **summarized conversation output** from the Conversation Summarizer to the Query Rewriter's **query input**.
4.  Connect the **user tags output** from the Tag Extractor to its **user tags input**.

## Step 6: Perform Knowledge Search Using the Rewritten Query

1.  Add the **Knowledge Search** agent.
2.  Connect the **query output** from the Query Rewriter to the Knowledge Search agent's **query input**.
3.  Upload relevant HR documents:
    -   In the configuration panel, click **Add Data Source**.
    -   Select **Upload Documents** and upload your files (for example, leave policies, travel guidelines, performance processes).
4.  After upload, click **Manage** next to the document folder to add or remove documents and assign **metadata tags** for improved retrieval accuracy.

## Step 7: Respond Using Search Results

1.  Add a **Respond to a Query** agent.
    
2.  Connect:
    
    -   **Query** from the Query Rewriter
    -   **User Tags** from the Tag Extractor
    -   **Search Results** from the Knowledge Search agent
3.  Write instructions that define the assistant's tone and formatting. For example:
    
    > "You are a helpful and professional HR assistant. Use a conversational tone. Format the response with clear bullet points when listing policies or steps."
    

## Step 8: Publish Workflow Outputs

Publish the final outputs so they appear in the chatbot's response interface:

1.  Select the **Greetings Responder** agent and enable **Publish this as a workflow output**.
2.  Select the **Respond to a Query** agent (from Step 7) and enable **Publish this as a workflow output**.

The correct output is rendered to the end user based on which intent path the query follows.

## Step 9: Save and Activate

1.  Review all connections and agent configurations.
2.  Click **Save Changes** in the workflow builder.
3.  Activate the AI Employee for testing.

## Step 10: Customize the Assistant Identity

On the **Configuration Page**, personalize your AI Employee:

-   **Assistant Name** -- click the name field to rename (for example, "HR Buddy" or "AskEma").
-   **Icon** -- click the avatar to upload a custom icon.
-   **Welcome Message** -- edit the message first-time users see (for example, "Hi! I'm here to help with your HR questions.").
-   **Conversation Starter Buttons** -- add buttons that appear alongside the welcome message to simplify common queries.

## Step 11: Test Your Employee Assistant

1.  Click the **chat icon** at the bottom-right of the screen to open the preview window.
2.  Try different queries to verify:
    -   The categorizer routes greetings and policy questions correctly.
    -   Search results are accurate and well-formatted.
    -   Personalization tags influence the response when expected.
3.  Iterate on agent instructions as needed before going live.

## Next Steps

-   [Writing Effective Instructions](/legacy-docs/builder-guides/chat/writing-instructions) -- refine your agent prompts for better output quality.
-   [Adding Workflow Branches](/legacy-docs/builder-guides/chat/workflow-branches) -- add more intent categories beyond greetings and fallback.
-   [Improving Chat Performance](/legacy-docs/builder-guides/chat/improving-performance) -- optimize response quality with conversation summarizers and static responses.
