An Experiment in Personalised Onboarding

David Kolb
9 min readDec 4, 2023

--

Personalised Onboarding for Today’s Diverse Global and Remote Teams

Artificial Intelligence integrated in employee onboarding process depicted in a small, friendly and cozy office environment
Image David Kolb DALL-E 3

The onboarding process represents a critical phase in welcoming new team members and integrating them into an organisation’s culture and values. With the increasing complexity and diversity of global and remote teams, the challenge lies in personalising this experience for each new hire while maintaining efficiency and consistency across the organisation.

This blog post explores an innovative solution to this challenge: leveraging OpenAI’s Assistants API to transform the onboarding experience.

Learn more about generative AI terminology and large language models.

Enter Assistants

The Assistants API Beta from OpenAI is a tool to craft custom AI helpers tailored to tasks akin to a personalised ChatGPT. It extends the dynamic capabilities of the recently announced OpenAI GPTs. The Assistants API Beta allows firms to integrate AI-driven tools into their existing platforms.

Potential Use Cases

  • Customer Service: Assistants could handle high-volume customer queries across channels, providing fast, consistent responses by referencing knowledge bases.
  • Research and Analysis: Assistants could rapidly synthesise data into actionable intelligence, bringing efficiency and scale to document analysis.
  • Process Automation: Assistants could automate repetitive, rules-based tasks across operations, increasing efficiency and allowing employees to focus on high-value activities.

Learn more about large language model adoption.

Purpose of this Experiment

How might we leverage AI assistants to efficiently generate personalised, strategically-aligned onboarding communications while preserving authentic human connection?

This experiment aims to generate a customised onboarding letter for a new employee. This leverages existing company knowledge and utilises information extracted from internal documents to create a tailored, efficient, and informative introduction for new team members.

Summary of how assistants work

  • Files provide assistants with the necessary contextual knowledge to generate accurate responses.
  • Assistants are AI agents who understand and respond to user queries by leveraging files and models.
  • Threads maintain continuity between user and assistant interactions.
  • Messages facilitate conversations, enabling users and assistants to exchange information.
  • Runs allow assistants additional processing time for complex queries before responding.
Possible Levels of Personalisation for Onboarding Assistants

Pre-setup

Developed a fictional company with its history, strategy, values, culture, and team leader personas using ChatGPT-4.

Fictional “Innovatech” Company Overview

Install the openai libraries

pip install — upgrade openai

Get the OpenAI API key and create the environment variable (MacOS).

export OPENAI_API_KEY=’your-api-key-here’

Import the libraries and create the client (Python)

from openai import OpenAI
client = OpenAI()

Assistant Setup

  • File Creation: Prepared PDF files containing company strategy, values, culture, and leader personas.
  • Customisation and Attachment: Configured and personalised the assistant, attaching files. Included specific instructions for the assistant, such as generating onboarding letters.
Basic contents of the assistant

This custom JSON structure in this experiment holds the file details.

[
{
“file_name”: “teamleaderpersona.pdf”,
“file_purpose”: “assistants”
},
{
“file_name”: “companyhistory.pdf”,
“file_purpose”: “assistants”
},
{
“file_name”: “companyvalues.pdf”,
“file_purpose”: “assistants”
},
{
“file_name”: “companystrategy.pdf”,
“file_purpose”: “assistants”
}
]

Read the files and upload them to OpenAI. Note if you repeat this step, you will have duplicate files, albeit with different file_ids. Possibly a beta version error.

files = client.files.list()

# Initialize an empty list to store the file IDs
file_ids = []

# Loop through the files and extract the file IDs
for file in files.data:
file_id = file.id
file_ids.append(file_id)

# Print the list of file IDs
print("List of File IDs:")
print(file_ids)

List of files uploaded to OpenAI.

File ID: file-npuP7NS0TmORKM7EShPbzVIi
File Name: companystrategy.pdf
File Purpose: assistants
— — — — — — — — — — — — — — —
File ID: file-OPFe3bUaX7luuCisiB69RO5Q
File Name: companyvalues.pdf
File Purpose: assistants
— — — — — — — — — — — — — — —
File ID: file-7R7ldtRFb7r0OHb2vZoSKbzV
File Name: companyhistory.pdf
File Purpose: assistants
— — — — — — — — — — — — — — —
File ID: file-cCQK87YWveOoMo8RnHacO2H9
File Name: teamleaderpersona.pdf
File Purpose: assistants
— — — — — — — — — — — — — — —
Total Number of Files: 4

Create the assistant. You can choose an initial prompt (instruction) and the model type. I used the gpt-4–1106-preview.

instruction = """You are a helpful letter writer. Your job is to write 
warm and personable onboarding letters welcoming a new employee to the
company. The letter briefly touches upon the company's history
and core values, emphasizing a sense of belonging and alignment
with the company's ethos."""

assistant = client.beta.assistants.create(
# Name of the Assistant.
name="onboardingassistant",

# Description of what the Assistant does.
description="Tailors personalized onboarding experiences for new hires",

# Here, version of the GPT-4 model.
model="gpt-4-1106-preview",

# Main prompt for all interactions with the asssitant
instructions = instruction,

# List of tools enabled for the Assistant.
tools=[{"type": "retrieval"}],
file_ids=file_ids
)

Operating the assistant

  • Thread Attachment: Initiated a conversation thread with the assistant, establishing a continuous dialogue framework.
  • Message Creation: Composed messages to input into the thread, which can include additional files (like new hire details) and further instructions.
  • Prompt: Provided a prompt to the assistant specifying the desired response or action.
  • Run: Attach thread to the assistant to process and respond, effectively putting the system into operation.
Single message flow to the assistant

Create a thread

A thread is similar to a conversation.

thread = client.beta.threads.create()

Create a message. This is attached to the thread via the thread.id

Create a prompt ‘content’ to create a welcome letter for the new head of product.

Attached the persona of the new head of product as a file.

message = client.beta.threads.messages.create(
# Specify the ID of the thread to which this message belongs.
thread_id=thread.id,
# Define the role of the message sender.
role="user",
# Content of the message.
content=content,
file_ids=[fileid]
)

Here is the output from the message before the run command. You can tie this back to the Message_ID and the Thread_ID.

The File IDs: [‘file-UcqlrjLgGzuQycbxgvOk5NpL’] is the new file with the head of content persona.

The message sent to the assistant

Submit the thread to run.

run = client.beta.threads.runs.create(
# Specify the ID of the thread that the run will process.
thread_id=thread.id,
# Provide the ID of the Assistant that will handle the thread.
assistant_id=assistant,
# Give specific instructions for this run.
)

The run step is queued in OpenAI. To find out if your run has been completed, repeat this step.

run = client.beta.threads.runs.retrieve(
thread_id=thread.id,
run_id=run.id
)
print(run)

The code will return a status message, continuing several fields, including these. Once the ‘completed’ field has a time stamp, the run is completed.

cancelled_at=None, completed_at=1700932243, created_at=1700932209, 
expires_at=None, failed_at=None,

This code extracts several details, including the main content (The letter).

for message in messages.data:
# Print the details of each message
print("ID:", message.id)
print("Object Type:", message.object)
print("Created At:", message.created_at)
print("Thread ID:", message.thread_id)
print("Role:", message.role)

# Print the content of the message
for content in message.content:
if content.type == "text":
print("Content:", content.text.value)

# Print file IDs, if any
print("File IDs:", message.file_ids)

# Print the Assistant ID
print("Assistant ID:", message.assistant_id)

# Print the Run ID
print("Run ID:", message.run_id)

# Print any metadata
print("Metadata:", message.metadata)

print("\n----------------------------------------\n")

Results

The assistant successfully produced a personalised, strategically aligned onboarding letter for the fictional new Head of Product, Sophia Martinez.

Key highlights

  • Warmly welcomed Sophia while aligning her expertise with Innovatech’s innovation-focused values.
  • Blended company history and goals with details customised to Sophia’s background.
  • Achieved an enthusiastic yet professional tone that valued Sophia’s capabilities.
  • Incorporated customised information about Sophia’s role, interests, and location.
  • Accurately reflected company values around innovation, sustainability, and inclusivity.
ID: msg_oLYpr2W9sovf7wrjg5WrtVBW
Object Type: thread.message
Created At: 1700932225
Thread ID: thread_2ZT1U5nqIxVnDAle1BNjl8OU
Role: assistant
Content: Dear Sophia Martinez,

It is with great enthusiasm that I, Alexa Taylor, extend a heartfelt welcome
to you as the new Head of Product at Innovatech Solutions Ltd. As someone
who shares our passion for technological advancements and sustainability,
your expertise in product strategy and dedication to innovation will be
invaluable to our team.

Innovatech Solutions has a rich history that dates back to 2010, when our
visionary founders established a startup aimed at revolutionizing technology
applications across industries. Embracing innovative and user-friendly
designs, we quickly expanded our offerings into financial services, retail,
and hospitality, growing to become a tech leader known for pushing boundaries
to enhance business and consumer experiences worldwide【23†source】.

Our company values and culture are built around innovation, which echoes
your background in creating user-centric product designs and your proactive
role in women-in-tech initiatives. We believe in providing technology
solutions that are not only efficient and effective but also responsible
in their impact on society and the environment. This ethos aligns with
your own commitment to fostering educational and technological access
through community involvement.

Strategically, Innovatech aspires to be at the forefront of the tech
industry, transforming operations and customer interactions within our
target markets. Our focus on the development of tailored technology
offerings, sustainable practices, and continuous innovation is synergistic
with your experience in agile and lean methodologies, UX/UI design, and
data analytics. We are confident that together we can further our aim to
lead and redefine the role of technology in the fields we serve【27†source】.

I am excited about the fresh perspectives you will bring to our team,
especially given your capacity for leadership and strategic thinking.
Your proven ability to drive product vision while ensuring exceptional
user experiences aligns perfectly with our strategic goals, and I am eager
to see how your insights will drive our company forward.

Once again, welcome to Innovatech Solutions. I look forward to working
closely with you to achieve new milestones and foster a culture of innovation
and excellence.

Warm regards,

Alexa Taylor
Head of Operations
Innovatech Solutions Ltd.
File IDs: []

Environment clear down

Since this is a beta version. To avoid unknown costs in OpenAI, delete the files and the assistants. Further tests are needed on the requirement to delete threads and messages.

Delete Files

files = client.files.list()
user_confirmation = input("Do you want to delete all assistants? Type 'yes' to confirm: ")
if user_confirmation.lower() == 'yes':
for file in files.data:
file_id = file.id
client.files.delete(file_id)
print(f"Deleted file with ID: {file_id}")
else:
print("Deletion cancelled.")

Delete Assistants

my_assistants = client.beta.assistants.list(
order="desc",
limit="20",
)
print("List of Assistants:")
for assistant in my_assistants.data:
print(f"- {assistant.name} (ID: {assistant.id})")

user_confirmation = input("Do you want to delete all assistants? Type 'yes' to confirm: ")

if user_confirmation.lower() == 'yes':
for assistant in my_assistants.data:
response = client.beta.assistants.delete(assistant.id)
print(f"Deleted {assistant.name} (ID: {assistant.id})")
else:
print("Deletion cancelled.")

Challenges during the experiment

  • Beta Stage Drawbacks: There were inconsistencies in how well the API worked.
  • File Buildup: Duplicate files accumulated over time and needed manual removal of unneeded ones.
  • Storage Expenses: Additional costs may come with storing files.
  • Inaccurate Answers: Sometimes, the responses were wrong. I needed to directly reference files like ‘companystrategy.pdf’ in the prompt to improve the responses.
Duplicate files but unique file IDs

Conclusion.

This experiment demonstrated capabilities in leveraging AI to provide the personalised onboarding experiences needed to welcome today’s diverse global and remote teams.

  • Successful integration of customisation while maintaining organisational identity
  • Positioning aligned with onboarding best practices in setting context
  • Areas needing improvement, like file management and output inconsistencies
  • Initial confirmation that leveraging OpenAI assistants shows promise for this application

Further testing could uncover more potential for personalisation and automation in HR communications. However, refinement is still required to enhance accuracy and efficiency sufficiently for enterprise viability.

Striking the Balance

Utilising AI for crafting onboarding letters presents a complex and nuanced challenge. While AI has strong capabilities to produce tailored content, realising the personalisation is machine-generated can detract from authenticity and resonance. This highlights balancing customisation with human connection in AI communications — striking the appropriate balance is vital, especially for sensitive applications like onboarding.

As we advance AI adoption, integrating it to complement human interactions is crucial — particularly for communications. Future iterations should emphasise gathering user feedback to guide the development of AI that drives efficiency while resonating authentically.

Privacy Considerations

In this experiment, all data, including company information and employee details, was synthesised and did not correspond to actual individuals or confidential company data.

For real-world applications utilising OpenAI’s services, it is crucial to consult OpenAI’s privacy policies to understand how your data will be handled and protected.

Links

OpenAI assistants overview: https://platform.openai.com/docs/assistants/overview

OpenAI assistants API: https://platform.openai.com/docs/api-reference/assistants/createAssistant

David Kolb: www.linkedin.com/in/david-kolb/

--

--

David Kolb

Innovation Strategist & Coach | Cyclist 🚴‍♀️ | Photographer 📸 | IDEO U Alumni Coach