Building generative AI applications with Amazon Bedrock Agents – Part 4
OpenAI Dall-E 3: Amazon Bedrock Agents use cases

Building generative AI applications with Amazon Bedrock Agents – Part 4

In today's rapidly evolving workplace, enhancing employee experience and streamlining Human Resources operations are crucial. HR departments face mounting pressure to deliver exceptional service, instant support, and consistent answers, yet they are often overwhelmed by repetitive inquiries and outdated systems. In response to this critical need, the HR Assistant Agent was created, a generative AI-powered solution built on AWS's advanced AI capabilities. This innovative agent provides employees with immediate, personalized, and accurate HR support at scale, significantly enhancing the overall employee experience.

Watch the Demo

Before we dive into the technical details, watch this short video demo to see the HR Assistant Agent in action.

Video 1: HR Assistant Agent Demo

Meeting the HR Challenge with the HR Assistant Agent

Traditional HR methods are often slow and frustrating, failing to meet employee expectations for on-demand, self-service support. This leads to frustration, wasted time, and inconsistent information. Key problems include:

  • Employees wasting time searching lengthy documents or navigating complex portals.
  • Long wait times for email responses and delays in accessing critical information like leave balances.
  • HR inboxes overflowing with repetitive questions.
  • Inconsistent policy interpretation across departments.

The HR Assistant Agent (Figure 1) addresses these pain points by placing HR knowledge and processes directly into employees' hands, providing instant, intuitive, and intelligent support.

The agent delivers three primary benefits that transform HR services:

1. Efficient Information Retrieval It streamlines how employees access information, saving valuable time.

  • Provides immediate, on-demand access to policies, benefits data, and leave balances.
  • Uses a natural language interface to understand contextual questions.
  • Delivers consistent and accurate information drawn directly from official sources.

2. Guidance and Support The agent actively helps employees navigate company procedures.

  • Offers real-time, step-by-step guidance for processes like onboarding and time-off requests.
  • Provides immediate clarification on policies and assists with form completion.

3. HR Ticket Optimization It improves HR operational efficiency by automating responses to common inquiries.

  • Significantly reduces the volume of basic HR tickets, allowing for immediate resolutions.
  • Frees up HR professionals to focus on more complex cases and strategic initiatives.
  • Generates analytics on common employee concerns to identify information gaps.

Article content
Figure 1: HR Assistant Agent Functionalities

HR Assistant Agent – Full AWS Architecture & Implementation Summary

The HR Assistant Agent is an AI-powered internal HR solution built using Amazon Bedrock Agents (Figure 2) designed to automate and enhance employee experience around HR-related queries.

The solution's scalable, secure architecture, deployed entirely via AWS CloudFormation, makes it both robust and easily replicable across enterprise environments. The entire solution can be deployed in a single shot using this CloudFormation template, typically taking only 8 to 10 minutes to provision all necessary resources and become fully operational. You can find the code base in this GitHub repository.

Article content
Figure 2: HR Assistant Agent AWS Architecture

Core Components of the Architecture

--> HR Assistant Agent:

  • Serves as the user-facing interface, answering employee questions.
  • Powered by Amazon Bedrock Agents, configured with custom instructions that define its identity and behavioral boundaries.
  • Uses Claude v3.5 Sonnet or similar models for natural language generation.

--> Custom Instruction Configuration:

  • The agent is explicitly instructed to operate as "CompanyXYZ HR Assistant", trained to answer questions about HR policy, vacation balances, and job details using the data in its knowledge base.
  • It can prompt users for parameters like employee ID when fetching PTO balances or job details.
  • Custom Instructions: The agent is given a specific persona and a detailed set of instructions on how to operate. For example:

Instruction: !Sub |
  You are CompanyXYZ HR Assistant, a specialized AI agent designed to help employees with HR-related inquiries and requests. Your primary data source is the bedrock-kb-${AWS::StackName} knowledge base containing CompanyXYZ HR policies and Employee Handbook.
  
  CORE CAPABILITIES:
  1. Vacation/PTO Balance Inquiry:
     - Retrieve current vacation leave or PTO balance for any employee
     - Required parameter: Employee ID
     - Return: Employee name and current vacation balance
          
  2. Employee Information Lookup:
     - Access comprehensive employee details including personal and job information
     - Required parameter: Employee ID
     - Return: Name, email, position, basic pay, organizational unit
  
  3. Leave of Absence (LOA) Request Processing:
     - Submit and process leave requests on behalf of employees
     - Required parameters: Employee ID, start date, end date, leave type (PTO or Sick)
     - Return: Request confirmation and status
     
  INTERACTION GUIDELINES:
     - Maintain a professional, helpful, and empathetic tone
     - Always verify employee identity before providing sensitive information
     - Don't repeatedly request parameters you already have in the conversation
     - For company policy questions, always search the knowledge base first
     - Provide clear, actionable responses with specific details when available
     - If information is not available, clearly state limitations and suggest alternatives
          
  KNOWLEDGE BASE USAGE:
     - Query the knowledge base for all HR policy, procedure, and handbook questions
     - Use retrieved information to provide accurate, up-to-date responses
     - Reference specific policies or sections when applicable
          
  RESPONSE FORMAT:
     - When describing functionality, use natural language without exposing technical function names
     - Structure responses clearly with bullet points or numbered lists when appropriate
     - Always confirm successful completion of requests
     - Provide next steps or additional resources when relevant        

--> Knowledge Base Integration:

  • Amazon S3 stores HR policy documents which are embedded using models like Titan Embed Text v1 or Cohere Embed English v3.
  • The vector embeddings are indexed in Amazon OpenSearch Serverless (AOSS) under a VECTORSEARCH collection with encryption, network, and access policies configured.
  • A Bedrock Knowledge Base built on this AOSS backend allows semantic search on HR content.

--> Dynamic Indexing and Vector Tuning:

  • A Lambda function (AossIndexLambdaFunction) determines vector dimension automatically: 1536 for Amazon Titan and 1024 for Cohere.
  • Index creation is automated upon stack deployment.

--> Action Groups for HR Tasks:

  • Defined through OpenAPI schemas and integrated into the agent as custom actions, enabling interaction with backend HR databases.
  • These actions invoke a central Lambda function (BedrockAgentHRAssistantLambdaFunction) to:

-- Fetch PTO balance: /vacation-leave-balance

-- Retrieve employee info: /employee-info

-- Submit LOA requests: /leave-of-absence

--> HR System Integration:

  • Employee data is stored across two Amazon DynamoDB tables:

-- DynamoDBEmployeeDataTable: General employee data and PTO balances.

-- DynamoDBEmployeeLOATable: Records leave of absence requests.

  • Leave requests trigger an email workflow through SESAPILambdaFunction, sending approval/rejection links to managers with notification status updates to the employee.

--> User Interface :

  • A Streamlit web application provides an intuitive and user-friendly chat interface for employees to interact with the HR Assistant Agent.
  • For the Proof of Concept (POC), the Streamlit application runs on a cost-effective EC2 t2.nano instance. For a production-scale environment, a containerized service like Amazon ECS, Amazon EKS or AWS App Runner is recommended for scalability, reliability, and integration into CI/CD pipelines.
  • The architecture includes a secure VPC, an Application Load Balancer to distribute traffic, and an Amazon CloudFront distribution to reduce latency for global users.
  • Employees interact via a real-time chat interface, supported API Gateway endpoints.

--> Email Workflow Integration:

  • Automated manager approval and rejection handled via SES.
  • Example URLs:

-- ACCEPT_URL=.../action=ACCEPT&employeeID=...

-- REJECT_URL=.../action=REJECT&employeeID=...

--> Lambda & API Components

  • Lambda Functions:

-- BedrockCreationSyncLambdaFunction: Initial vector store sync with S3.

-- BedrockOngoingSyncLambdaFunction: Keeps vector store in sync with S3.

-- BedrockAgentHRAssistantLambdaFunction: Executes Bedrock Agent actions.

-- SESAPILambdaFunction: Handles email approval/rejection operations.

-- AossIndexLambdaFunction: Dynamically creates OpenSearch indexes.

  • API Gateway Endpoints:

-- /bedrock-api: Processes chat input and forwards it to the agent.

-- /ses-api: Handles email-based action links for leave approvals.

End-to-End Query Processing Flow

When a user interacts with the agent, the system follows a sophisticated data flow:

  1. Document Ingestion: HR documents uploaded to the S3 bucket are automatically processed, chunked into manageable segments, and converted into vector embeddings by the Bedrock embedding model.
  2. Vector Indexing: These embeddings are then stored and indexed in the OpenSearch Serverless vector database with relevant metadata.
  3. Query Processing: When a user submits a question, the agent first determines if it's a knowledge query or a request for a specific action. For knowledge questions, it converts the query into a vector embedding and performs a similarity search in OpenSearch to find the most relevant document chunks. For action requests (e.g., "What's my PTO balance?"), it identifies the correct Action Group.
  4. Response Generation: For knowledge questions, the retrieved document context is passed to the Bedrock generation model (Claude v3 Sonnet), which synthesizes a comprehensive answer. For action requests, the agent invokes the appropriate Lambda function, gets the result, and presents it to the user in a natural, conversational format.

Examples:

  1. Policy Q&A: “What’s our harassment policy ?” → Instant answer from official HR doc.
  2. Vacation Requests: “Help me request time off from July 30, 2025 to August 3, 2025” → Checks balance, routes request for approval.
  3. Employee Details: “How much PTO do I have left ?” → Retrieves from DynamoDB and displays instantly.
  4. LOA Process: “How do I request a leave of absence?” → Guides step-by-step and submits.
  5. Approval via Email Links: Managers receive action links to approve/reject leave—no portal logins required.

Future Improvements

As generative AI technology advances, the HR Assistant Agent can evolve into a more proactive and intelligent advisor. Key future enhancements include:

  • Multilingual Support: Serve global teams by responding in multiple languages
  • Predictive Analytics: Anticipate employee needs based on patterns (e.g., life events, career progression)
  • Deep HRIS Integration: Seamless workflows with systems like Workday, Oracle, or SAP
  • Personalized Interactions: Tailor responses based on employee role, location, department, or tenure
  • Voice Interface: Enable hands-free, conversational access via mobile or smart devices
  • Attrition Risk Insights: Early warnings and recommendations for HR interventions

Conclusion

The HR Assistant Agent represents a major step forward in transforming how organizations deliver HR services. By integrating generative AI, semantic search, and workflow automation on AWS, it eliminates inefficiencies, empowers employees with instant support, and allows HR teams to focus on high-impact initiatives.

Looking ahead, the next evolution of this solution lies in multi-agent collaboration—where specialized AI agents work together to handle more complex, cross-functional HR scenarios. In our next article, we'll delve into the exciting possibilities of a multi-agent HR assistant. Imagine a system where specialized AI agents, each an expert in a specific HR domain (e.g., benefits, payroll, talent management), collaborate seamlessly to handle even more complex and nuanced HR scenarios, offering unparalleled precision, depth of knowledge, and tailored support to employees.

Nicholas Beaudoin

Director, AI @ Wavicle | Director of AI Programs @ Caltech CTME

1w

Great stuff Zakaria!

To view or add a comment, sign in

Others also viewed

Explore topics