# Employee Query Automation (HRMS Automatic Ticket Generation  + Knowledge Retrieval)

### Objective

Automate responses to employee HR queries by checking an internal knowledge base (policies).\
If the policy is found, reply immediately with policy details. If not found, automatically create an HRSM ticket, populate it with context, assign it to the correct HR agent, update the ticket as it progresses, and notify the employee by email/SMS. Ensure auditability and human-in-the-loop handover.

**Primary Actors:**

* **Employee (End User)** — raises an HR-related query
* **Soika AI HRMS Agent** — handles query routing and policy retrieval
* **Knowledge Base** — repository of HR policies and FAQs
* **Base row Database** — manages tickets and HR agent directory

**Target Platforms:**

* Web Portal / Employee Chatbot
* WhatsApp / Email
* HR Knowledge Base
* Baserow Database (Tickets, Policies, HR Directory)

### **2. Business Value Proposition**

The Soika AI HRSM Agent automates HR query management by instantly responding to common employee questions such as *“How many sick leaves do I have?”*.\
If the policy is found, the AI provides an immediate response. If not, it automatically creates a service ticket in the HRSM system, routes it to the correct HR representative, and notifies the employee of the next steps.

**Benefits:**

* 70–80% faster resolution for common HR queries
* Instant knowledge retrieval from HR policy database
* &#x20;Automatic ticket creation & HR agent assignment for unresolved queries
* Email notifications & tracking for employees
* &#x20;Reduced manual workload on HR support teams

### **3. Flow Summary**

**User prompt example:**

> “Create an Workflow AI Agent that acts as an HR Assistant, receives employee queries, checks HR policies, and creates HRSM tickets when necessary using Base row DB and Email integrations.”

#### **System Flow**

1. **Employee Query Received**
   * Example: “What’s the company’s paternity leave policy?”
2. **Knowledge Retrieval (HR Policy Check)**
   * Agent searches HR policy documents stored in the knowledge base.
3. **If Policy Found →**
   * AI replies directly with policy details.
4. **If Policy Not Found →**
   * Agent creates a new row (ticket) in HRSM via Base row DB.
   * Retrieves ticket details and assigns it to a relevant HR agent.
   * Sends an email or chat notification to the employee confirming ticket creation.

#### **System Response Example**

**Employee:** “Can I carry forward my annual leave?”\
**AI Agent:**

> “Let me check the HR policy on that.”\
> “The *Leave of Absence Policy (HRPOL-001)* states that unused annual leaves can be carried forward up to 5 days. Would you like me to share the detailed document?”

If the policy wasn’t found:

> “I couldn’t locate the exact policy for your query. I’ve created a service ticket for the HR team to review.\
> Your Ticket ID is *HR-TKT-2304*. Our HR representative will contact you shortly.”

### **4. Step-by-Step Process**

### **A. AI Agent Creation**

1️.Open Soika Mockingjay Platform\
2️.Ask Soika to create an AI Agent using a natural language prompt:

> “Create an Workflow AI Agent that acts as an HR Assistant, receives employee queries, checks HR policies, and creates HRSM tickets when necessary using Base row DB and Email integrations.”

<figure><img src="/files/HiEYXX7KFKBtlxIx1KR3" alt=""><figcaption><p>HR Copilot Agent</p></figcaption></figure>

### **B. Creating the Workflow Nodes and Blocks**

**Let's understand each and every node step by step**

<figure><img src="/files/UoG7ksAuS0SyWNIwch9w" alt=""><figcaption><p>Complete Workflow of HRMS</p></figcaption></figure>

#### Step I : Add Input Field to the Start Node(Both Query and Email) of the user

<figure><img src="/files/JzoFAK9igFNi1Fc4l3yR" alt=""><figcaption><p>Add Input fields to the Start Node</p></figcaption></figure>

#### Step II : Add LLM Node and provide the description.

System Instructions will explain the Agent to categories the Query. Example: Leave ,Attendance.

<figure><img src="/files/L0bFky77i8OQ1t2h7cM0" alt=""><figcaption></figcaption></figure>

#### Step III : Add Knowledge Retrieval Block and LLM2 node to understand if the query is related to HRMS

<figure><img src="/files/h9gYHf6X9ZYZRxXM1RIz" alt=""><figcaption></figcaption></figure>

#### Step IV : Add IF/ELSE Block and the conditions based on the user query.

<figure><img src="/files/otNzvcidh2ETtgR6bSrz" alt=""><figcaption><p>Prefix the Condition based on the previous LLM</p></figcaption></figure>

#### Step V : Add LLM Blocks to identify incase queries are not related to the Context(Knowledge Retrieval) .Generate a Random ticket in the Base row DB

<figure><img src="/files/wNZIgyxz9uCS3nYNDukt" alt=""><figcaption><p>LLM Node with Instructions</p></figcaption></figure>

#### Step VI : Add Parameters (table\_id, content) in Parameter Extractor Block and  provide instructions to it. Add Input Variable as LLM 4

<figure><img src="/files/FI2uuPHlbyabdAzcg7Yp" alt=""><figcaption><p>Parameter Extractor will Fetch the details of the Baserow DB Database</p></figcaption></figure>

#### Step VII : Add Create a Row Node with the Base row database Table ID&#x20;

This will help to generate a ticket number for the HR portal.

&#x20;Authorize using the provided API keys / OAuth access.

* Base row API URL: `https://api.baserow.io`
* Email (SMTP): `https://developers.google.com/workspace/gmail/smtp`&#x20;
* Create Tables in Base row (Ticket Creation and HR Employee).
* Click on the :(3 dots) next to the Table Name to get the Table ID which would be used in the Get Rows and Create Rows Input variables.

<figure><img src="/files/uRBoeb4gZ5tsPX7U4WUC" alt=""><figcaption><p>Creation of Tbles in BaseRow DB</p></figcaption></figure>

<figure><img src="/files/x8FmMB8rUFKygpODvLlc" alt=""><figcaption><p>Create a Row will help in the creation of ticket</p></figcaption></figure>

#### Step VIII : Add Get Rows and Parameter Extractor Block with employee name, email id and contact number

<figure><img src="/files/UhsWIc0XyG4zcg3YUiJB" alt=""><figcaption><p>Extract the details of the HR Employees to whom ticket would be assigned</p></figcaption></figure>

#### Step IX : Add LLM and Parameter Extractor block to fetch the details of Subject, Ticket Number etc.

<figure><img src="/files/3Olkmqh7qGOUGE2U2uCT" alt=""><figcaption><p>Add LLM node and Parameter Extractor Block</p></figcaption></figure>

#### Step X : Authorize to the Send Email block and add the Input Fields.

This block will share the email notification to the user with respective Ticket number and HR Employee details.

In the End Node, put the input field as Send Email.

<figure><img src="/files/zkFCwLmY2nsBi3GYkJd5" alt=""><figcaption></figcaption></figure>

#### Sending Email and Creation of Ticket&#x20;

<figure><img src="/files/BEFO6RlzODsMYsZGhful" alt=""><figcaption><p>Generating Automatic Tickets</p></figcaption></figure>

<figure><img src="/files/l5cWJWLwqCJIqA5kO1Hb" alt="" width="422"><figcaption><p>Sending Notification via Email</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soika-labs.gitbook.io/soika-mockingjay/use-cases/employee-query-automation-hrms-automatic-ticket-generation-+-knowledge-retrieval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
