zsh also supports the "alias anywhere" concept (their term is "global alias") by using the `-g` flag.
alias -g ag='2>&1 | grep'
some-command ag 'words' # equivalent to: some-command 2>&1 | grep 'words'