Hack Day - Chat (Khat) GPT

Why did the AI buying assistant start a stand-up comedy career? Because it knows how to find the best "deals" of laughter!

Here is hoping ChatGPT is better at being a buying assistant than it is at writing jokes!

ChatGPT is the hottest topic around the industry and, inspired by a recent tech talk by our CTO, we used our most recent hack day to try and answer some questions about what Kogan.com could use ChatGPT for. Can we train ChatGPT with knowledge of our products so that it can be a buying assistant to our customers? Can we train it with our FAQs and customer support information so that it can help answer customer queries more efficiently? Through a few different experiments, we tried to answer these questions.

So what is ChatGPT?

ChatGPT is an advanced artificial intelligence language model developed by OpenAI that specialises in understanding and generating human-like text. It works by analysing large amounts of text data and predicting the most likely responses or content based on the context provided, leading to highly accurate and coherent interactions.

Where to begin?

The ChatGPT team on our hack day was the largest and involved a good mixture of different types of developers. We split into two main segments - our backend developers focused on training the model with our data and creating an API that could be interacted with. Our mobile developers focused on adding a chat feature to our current app, which would interact with the created API.

Implementation

Training the model

Starting out we investigated which language model would be the best fit for our application. Well-known models like GPT 3.5/4 are best suited for precise answers whereas models like Davinci are better at extended, concise responses. As this was a support-type bot with a general audience, we went with Davinci for a better user experience.

The process of training the bot involved creating a GPT vector index containing all our data using the OpenAI language model we’ve selected. We used the Python lib, LlamaIndex to facilitate this process. We were then able to query our GPT vector index with our questions.

We trained one of the models using product descriptions and product manuals and the second included customer support FAQs and a collection of fake customer support tickets to see if we could train positive interactions into the model.

So, with our models in hand, we jumped in with some questions!!

Immediately we found that general information from our customer interactions with the support team, such as customer name, was being used by the model to assume the user’s name etc. Questions like,

“How can I get a refund on my order”,

Would often come back with responses like,

“Sure , to receive a refund from Kogan…”

The security/privacy implications of a model being trained with conversations were becoming obvious and seemed like a bigger problem for another day, so we had to park the customer support branch of this project for the day.

We focused on the product assistant for the rest of the day, which turned out to be a great decision as we got some great results.

API Setup

In addition to building the model, we also needed to host it somewhere to make it available for the mobile app to consume. Initially, we started building out a lambda function behind an API gateway in AWS to host the application, but in the final hour of our hack day realised that the model wouldn’t fit into the lambda function’s available space, so we quickly pivoted by spinning up an EC2 instance using AWS Lightsail and setting up Flask as our API. It was great to see the team mitigate issues as they popped up like this.

Solution

At the end of the day, the team was able to showcase a working prototype, with our mobile app integrating with the API and returning some interesting responses. The most promising response we got was a question related to safety information contained within one of our product guides.

Q: “Can I use the Estelle Hair dryer in the bathroom?”

A: “No, you should not use the Estelle Hair Dryer in the bathroom. According to the safety warnings, it should not be used in the bath or shower, near a bathtub, washbasin or other products that contain water, and should be unplugged after use and the speed and heat settings should be set as required before use if it is being used in the bathroom.”

Another example of a general question was:

Q: “What options are available in the Kogan washing machine?”

A: ” The Kogan 7kg Top Load Washer offers a range of options, including 7kg clothes capacity, 6 wash programs and memory function, 8 water levels and 9 types of water power, LED display and delay start function, fuzzy logic control and detergent dissolve tech, child safety lock feature, and a drain pump filter to avoid blockages. It is made from high-quality, clear ABS material, making it easy to maintain and durable for everyday use. It also features personal preference settings, allowing you to customise your washing experience.”

At times, the model wouldn’t align the correct information with a given product but this was always good for a laugh.

Q: “Which Kogan toaster would best suit my family of 6”

A: “The Kogan 4 Slice Toaster (Silver) would best suit a family of 6. It features two independent browning controls, seven adjustable browning settings, built-in Defrost and Reheat functions, an ultra-sleek silver design, a weight capacity of 50kgs, and a frame material of wood. It also has a removable crumb tray at the bottom for easy cleaning.”

To improve this we could have provided our data in a more structured format, but for this experiment all our data was unformatted.

One of the main problems we discovered was the time it took to get a response from the API. Responding often took 5-10 seconds to come through and would come through as complete responses rather than each word like the ChatGPT client in your browser does. This was just a limitation of the library implementation and setting, so could be mitigated with a more bespoke solution.

As an added bonus, our mobile developers also took the time to work with SwiftUI, with one even using ChatGPT to assist with this along the way, and we were all impressed at what it was responding with.

Final Thoughts

Overall it was definitely a successful hack day for the ChatGPT team and highlighted the immense potential of the use cases of ChatGPT at Kogan.com. The hack days are a great opportunity to collaborate with other squads within the engineering team which we wouldn’t usually interact with on a daily basis.

MARCH 2022 HACKDAY (Part 1) The Morse Man bot

.. - ... / .... .- -.-. -.- / -.. .- -.-- / .- - / -.- --- --. .- -. -.-.--

The above elegant line of dits and dahs is Morse code. Developed in the 1800s, it has stood the test of time, and with its combination of nostalgia, intrigue and retro vibe, it’s primed for a resurgence in popularity. Instant messengers can feel a bit synthetic and for those who long for a more analog, authentic communication, Morse code may well meet this need. As part of our regular hack days at Kogan.com, and with the intention of improving Slack by adding personalised features, a Morse code bot was just one of a plethora of bots that was created on the day.

So how did we achieve this greatness?

It started with a repurposed Google Cloud project and a quickly assembled Flask app to lay the solid foundations on which to build. Because we care about developer experience, we added UAT builds on push to our dev branch, and because we care about consistency, we set up some pre-commit checks. Once that was done, it was time to start with the meat and potatoes, and get some functionality working. After examining Slack documentation we knew vaguely what we needed. That was to create a custom Slack app bot and use slash commands to access our Flask app. Essentially, one can access a Slack app bot by typing “/bot-name” into the message box and whatever message you write after this is sent as a parameter to the request url specified. The response from this request is then posted in the channel from which it was sent. We could now start work on the individual bots.

The Morse Man bot:

Our progress so far had worked well, but we soon stumbled upon a constraint that was rendering the Morse bot worthless. The problem is as follows, should you wish to utilise the Morse bot to encode a message, the bot replies to the channel with both of the following messages:

Morse Man Slack bot posts:

@userTryingToBeSecret sent this message: /morse Here is my super secret message

Morse Man Slack bot posts: .... . .-. . / .. ... / -- -.-- / ... ..- .--. . .-. / ... . -.-. .-. . - / -- . ... ... .- --. .

No point sending a secret message if you send the real message with it at the same time. Concerned that this could affect uptake and not wanting to jeopardize the project, a better technical solution would be necessary. Further investigation found there is an option to set the bot response to only be visible to the sender, and it was also found the Slack API can be used to send messages ad hoc. Combining these 2 possibilities we are now able to do the following:

  • Use a slash command to call the bot
  • Send a request to the Flask app (and return no response)
  • The Flask app receives the message as a parameter, and using sophisticated algorithms encodes it into Morse. At the same time we get the channel ID from the request API
  • Using the separate Slack web API, make a request to the channel and send the message!

Lastly, our Slack bot could only be taken seriously if it has a legitimate avatar, and hence our UI/UX designer got involved to add a polished feel to the project. The end result can be witnessed below.

The Horse Man bot:

Following on from the development and good learnings of the Morse Man bot, but instead of converting into Morse code, it uses an alternative proprietary encryption method to convert into horse dialect. Also complete with its own avatar.

Impersonator bot:

A skunk works project that was developed in the shadows. Someone noticed that you could supply any name and icon with the API request, and this essentially meant you would be able to impersonate any user on Slack(this is true apart from the small word ‘app’ after the username indicating its true source) By using the Slack API that returns user details, the bot can accept a username and a message, then automatically retrieve the users Icon and repost the message as that user. A dangerous discovery that was essentially banned immediately.

Humor bot:

Using the same foundations, but then uses external APIs to fetch jokes from Chuck Norris and Ron Swanson to inject some humor where required.

Dashboard bot:

A truly value adding bot. The idea was for a bot to provide snapshots of our Grafana dashboards when requested on slack. This could provide quick access for everyone and also add value if needed as part of a discussion. It leverages Selenium to login and render the dashboard, as well as take a screenshot, which is then returned with the Slack web API.

Unmorse bot:

Decodes Morse code. This has proven to be particularly useful, as it turns out not many people can read Morse code directly.

We now have a bunch of nifty bots at our disposal and a better understanding of the functionality available for integrating with Slack. At Kogan.com, hack days are considered an important tool in giving us the time to pursue alternative projects of our own choice. The skills and ideas seeded from a hack day can result in something that adds direct benefit or can be an opportunity to learn and upskill ourselves.  It also adds to the culture of our workplace and supports team work by giving us the chance to work with people outside our normal team.

Celebrating International Women’s day

Tuesday 8 March was International Women's Day, a celebration of women and their achievements. A day of celebrating the social, economic, cultural, and political achievements of women. This day also marks a call to action for accelerating women's equality. This year we thought we’d celebrate by spotlighting an incredible group of women who work in the Kogan.com engineering team. We’ve cultivated an inclusive environment to ensure that women in our team can thrive, from providing equal opportunities, coaching and mentorship at every career stage to various benefits that support home and work life. Here’s what this group of Kogan.com women had to say about why they love working in our product, design & engineering space and how to grow—personally and professionally. Check out their stories!

Why do you love being an engineer at Kogan.com?

“ There’s always something that pushes me to get out of my comfort zone, whether it’s a simple feature implementation or a head-scratching problem. I’m surrounded by very talented and driven teammates, so there’s never a boring day. Most importantly, I feel supported and I’m constantly reminded that working within the Engineering space doesn’t have to be monotonous.”

Ana Teo, Software Engineer.

“ Working in the Engineering Team is rewarding because we get to work on a variety of features and continuously learn new things. We have an amazing, talented team and the work environment is friendly and fun.”

Hanna Koskela, Software Engineer.

What do you love most about the product and design space at Kogan.com?

“ Before I became a member of the Kogan.com engineering team, I was an avid customer. I loved the vast number of products that Kogan.com offered and that I could buy anything from home appliances to clothes to setting up a credit card. Being a pre-existing customer I was already fairly familiar with the end-user experience, after joining I got to see how things operated to make the whole platform run smoothly. I enjoyed meeting the people behind the scenes, from the people involved in the financial operations to the customer care team. I’ve learnt so much from these experiences. I love that there are always new things to learn. This has encouraged me to think outside the box and keep developing my professional skills. Our team has an incredible opportunity to grow as every new project provides new experiences to learn from. No day is the same and I always feel like I am learning something new.”

Hien Do, Product Owner.

“ We don’t limit our products on e-commerce itself. We have brought Australians the most in-demand products and services such as Kogan Internet, Kogan Insurance, and Kogan Super. As a designer, I will continue exploring the possibilities with my colleagues, and designing a user experience that can benefit our customers as well as support our Kogan staff.”

Mengfei Hu, Senior User Experience Designer.

What comes to mind when you think of growth in the technology space?

“I think about growth and development as a tool to cultivate ownership. The more responsibility you give someone, the more ownership they have. Our team provides a wide range of growth paths for engineers and within our product design space. Team members get to really think about the details of what they want to do and chart their path so they get to have a high impact. Having clear goals and direction and using tools like CultureAmp, provides clarity so that each person knows what success looks like and how to get there.” 

Anita Rajalingam, Talent Acquisition Lead

“User experience has become one of the most widely used term in the technology space. Kogan.com is well known as one of the largest ecommerce platforms in the technology space that cares about their customers’ experience. They are meticulous about the product design as well as the functionality to ensure the users’ needs are always being listened to and responded. It’s such an honor for me to work as Senior UX Designer at Kogan. I endeavor to continue bringing immersive experiences to my product users.“You’re limitless if you go out of the box”

Michelle Huynh, Senior UX Designer

What is the best advice that you’ve received, or want to share to other women in technology?

“Perfectionism is the enemy of progress” 

Working in a male-dominated field, it’s easy to get into the mindset of having to “prove yourself” and wanting to do things perfectly. I learned early on that nobody will be as critical of my work as I am. Don’t let your sense of perfectionism stand in the way of delivering great work. 

Sandra Kärcher, Senior Product Manager

“Be exactly who you are and stay true to your values! The key to thriving in your work environment is authenticity. Also, take on any opportunity to learn something new - keep an open mind and don’t be so afraid to not succeed that you never try different things. The technology sector is incredibly diverse, and people are surprised that I work within the field despite not having formally studied computer science or IT. I remind myself every day that I don’t have to know everything, I just need to bring together the right people to find our solutions.”

Christine Kha, Product Owner

Supporting and celebrating women worldwide

We’re thrilled that we get to celebrate the accomplishments of women around the world—and within Kogan.com. Keen to see how you can take your engineering career to the next level at Kogan.com? We’re growing our engineering team and would love to hear from you!

DECEMBER 2021 HACKDAY (PART 1)

DECEMBER 2021 HACKDAY (PART 1)

**‘Twas the week before Christmas…**

…and like a ghost from the Charles Dickens classic, the Kogan Hackday was back to give the talented members of the Engineering team an opportunity to think of something other than what to add to last year’s Christmas shopping list.

What do **“image recognition”**, **“web audio”** and **“boom gates”** have in common? Absolutely nothing! But having a nice variety of topics this time around allowed us to push our limits as innovators and problem solvers through issues that we found interesting. After a quick introduction on the morning of the hack day, four teams were formed to work on the following problems:

My experience onboarding with the Engineering team at Kogan.com

Can you describe your experience leading up to your start at Kogan.com?

The recruitment process for a software engineering position at Kogan.com was fast, smooth and enjoyable. The whole process - from the initial recruiter conversation to the final interview included a focus on technical excellence and soft skills. It began with a phone conversation, followed by a technical interview, and then a meeting with our Head of Engineering, CTO and Director of People & Culture. The process was efficient and purposeful.

Now that you have joined the team, can you describe what your remote onboarding experience has been like?

I joined Kogan.com at a steep inflection point in the growth of the engineering team. The size of the team roughly doubled in one intake of new engineers. Given this, one would expect onboarding to be chaotic and met with challenges. The reality was contrary to this - onboarding was a pleasant experience met with ample support.

My first day was highly educational and filled with meetings covering technical architecture, business context and culture. Given the pandemic, everything was remote. However, the team did a wonderful job in organising an onboarding that was not impaired by work-from-home conditions. The company even delivered us all food for lunch.

During onboarding and day to day where appropriate, the team practices pair programming. Tell us more about your experience:

Pair programming has been an encouraged practice throughout onboarding. It has provided me with a short feedback loop for rapid upskilling and given me the opportunity to socialise with other engineers, despite the remote conditions of work. In some ways, remote pair programming has advantages over its in-person counterpart. It ensures that both engineers get to use their ideal computer setup, allows for concurrency in certain operations (such as each engineer simultaneously exploring different parts of the codebase on their own screens) and does not require sharing desk space.

Now that we have returned to the office and are working in a hybrid environment, what are you enjoying most about meeting your colleagues in person?

I am enjoying meeting my colleagues in-person. Although Kogan.com has done an excellent job in maintaining company culture whilst we’ve worked remotely, there are some aspects that cannot be replicated. It has been nice to experience the full culture, have lunch and grab coffee with others. I tend to ask a lot of questions, and it’s easier to do that in-person.

Why I joined the Kogan.com engineering team

Welcome to our monthly “Why I joined the Kogan.com engineering team” series! Every month, we talk with members of the Kogan.com engineering team to learn who they are and why they chose to pursue careers at Kogan.com.

Mengfei is our Designer extraordinaire who has been with us for over 4 years now. Her role sees her playing a big part in how our website interacts with our customers and she is involved in turning features developed by our engineers into user friendly applications for our customers. In her past time Mengfei loves to bake, travel and play the viola. Her superpower is spotting our pet cats lurking around our team’s backgrounds during video calls! Mengfei is also an avid photographer who regularly shares her brilliant snaps of her travels with the wider Kogan.com team.

Mengfei at Lake Tyrrell which is in between Melbourne CBD & Mildura

Describe what it’s like being a part of the Kogan.com Engineering team.

Busy, collaborative and an environment where creativity is embraced.

Every day we receive many requests from other teams, as well as feedback from customers. We also have new features that need to be analysed, designed, implemented, and released. As a UX designer at Kogan.com, I am always busy with proposing concepts, receiving feedback, and refining designs. During this process, there is a lot of room to be creative, especially when collaborating with other team members.

We’re always brainstorming various ways to solve usability issues, enhance the User experience, and deliver the best e-commerce site for our customers!

What is something unique about the Kogan.com Engineering team?

Our team is highly collaborative and we love supporting each other.

I joined Kogan.com 4 years ago as my first job after migrating to Australia. We were a team of 14 members at that time. In my time here, I have learnt a lot not only about design, but also about stakeholder management, negotiating requirements with developers, and even about the Australian culture! 

During this time, I have gained so much knowledge about how customers interact with our site which helps with designing features for our customers so they have a great shopping experience.I have also been fortunate enough to be part of the team working on building new vertical sites aligning to our overall company growth strategy. 

4 years ago, when I joined Kogan, I received a lot of support from team members. I had very little knowledge about front-end development at that time. The developers took time to walk me through the process, explored the different tools, and we worked together to find an efficient process to turn designs to implementation. Goran, our CTO, was always kind with his time and supported me to review my designs. He always empowered me and raised suggestions when I got stuck. 

I am so proud to say that I have now become one of the key members in our team who supports others by providing these design suggestions. I also play a big part in the user acceptance testing process. This helps us to get familiar with products and features much faster.

Tell us about a work challenge you’ve had to recently resolve

Our team has doubled in size recently due to the growth of our business and we’re seeing more and more new faces join us! To ensure our new developers aren’t waiting for my designs, I’ve had to learn to manage my time more effectively so I can deliver on these designs for my team and stakeholders.

Tell us about your proudest moment at work

I am really proud to see the new features that I’ve designed, released and used by customers,(though this is the whole team’s effort not my own ^_^).

Why I joined the Kogan.com engineering team

Why I joined the Kogan.com engineering team

Welcome to our monthly “Why I joined the Kogan.com engineering team” series! Every month, we talk with members of the Kogan.com engineering team to learn who they are and why they chose to pursue careers at Kogan.com.

Anita is the Talent Acquisition Lead at Kogan.com. She is a huge fan of coffee (strong long black please!) and is always on the lookout for the next greatest breakfast spot in Melbourne. In her time at Kogan.com, Anita has helped grow the team and introduce various internal & external community initiatives. Learn all about Anita, her team, and how she’s making an impact on #TeamKogan.