Possibly similar to how Mycroft does it?
Have a file with triggers (they have a simple format of sentences, with ()
groups, like (hello|hi) everyone
will match both hello everyone and hi everyone, and can be combined recursively to shorten templates a lot), and then some execution.
Also, I'd request having more options - instant answer, side widgets (wiki widget), main widgets (embedded in results, like news and images), and special page that can be opened from the previous (like how Google has it for vote results).
I'd love to be able to extend kagi even more.