This goes into a bit into pioneer territory, that is to say that integrating this functionality outside of a functional template would likely prove costly.
At the core, you would need a library like ai-sdk, an OpenAI compatible endpoint, and the ability for a user to provide their own AI API key via UI settings (or provide an application-wide API key yourself that powers the search). There are multiple other ways to achieve this as well, but I don't believe any exist in a predictable, #mkstack-like template at this time.
My advice would be to wait for mkstack or another interested party to provide a functional template that an agent can easily integrate into your application. ๐