Ai search app for slack

I want to create an app that helps in auto answering any query based on the chat history in Slack/Teams.