Building an Intelligent Chatbot with Slack, Amazon Lex, Kendra, S3, and Lambda 

Do you know where to find the Employee Handbook? Do you know what the insurance policy looks like? Exactly, this is why you want a Slack Chatbot with quick access to internal information. We built an (somewhat) intelligent chatbot solution that integrates Slack, Amazon Lex, Amazon Kendra, S3, and AWS Lambda to deliver precise responses to user queries. 

Here’s how the solution works: 

When an employee sends a query in Slack (for example, “@chatbot Tell me about the Insurance Policy”), Slack triggers an event that is forwarded to an AWS Lambda function, through an API Gateway. This function retrieves a Slack token securely stored in AWS Secrets Manager, ensuring that sensitive credentials are never hard-coded. 

The Lambda function then calls Amazon Lex, which uses custom intents and sample utterances to interpret the query. When Lex confidently matches an intent, it returns a structured response. However, if Lex isn’t confident and returns a FallbackIntent, the Lambda function automatically queries Amazon Kendra. Kendra—indexing our employee handbook stored in S3—searches for the most relevant snippet, often including a “Read more” link to the full document. 

Amazon Lex chatbot

This hybrid approach ensures that employees receive a useful answer whether Lex fully understands the query or not. The Lambda function intelligently determines whether to use Lex’s direct response or supplement it with Kendra’s search results, then sends the final answer back to Slack. 

“I used to spend 15–20 minutes searching for the right document. Now, I just ask the chatbot and get the answer in seconds” – Tony Regnhamn, Consulting Manager   

By integrating Slack, Lex, Kendra, S3, and Lambda, our architecture streamlines internal information retrieval and provides a robust, scalable, and cost-effective solution that keeps employees informed and productive.

“I like that I can ask a question anytime, day or night, and get an instant response. No more waiting for emails or tracking down the right person” – Stefanos Aslanis, Cloud Engineer

This solution not only simplifies access to critical policies but also demonstrates the power of modern AWS services working together to solve real business challenges. 

Do you need help with a solution likes this? Or something else? Don’t hesitate to contact us!

Want to know more what Buzzcloud can do? Check out our services!

More insights

Kontakta oss idag!

Är du redo att komma iväg på din AWS-resa? Vi ser fram emot att prata vidare kring hur vi kan hjälpa ditt företag främja innovationskraften.

Genom att klicka på skicka medelande så godkänner du våran privacy policy, du kan när som helst skriva till oss för att ta bort dina uppgifter.