Zum Inhalt springen
>_<
AI EngineeringWiki

Mattermost AI Agent

Tools · 6 min

A Mattermost bot brings AI to your team chat. This guide shows you how to set it up.

Why Mattermost?

  • Open Source - self-hosted
  • Full data control
  • Enterprise features
  • Integrations with everything

Bot Setup

# 1. Create Bot Account
# In Mattermost: System Console > Integrations > Bot Accounts

# 2. Get Access Token
# Save the token securely!

# 3. Add to channel
/memberadd @ai-bot

Python Bot Example

import mattermost
from mattermost import Webhook

# Connect to Mattermost
client = mattermost.Client('your-instance.com')
client.login('bot-email', 'bot-token')

# Simple AI response
@client.on_message
def handle_message(event):
    if event.text.startswith('!ai'):
        prompt = event.text[3:]
        response = ollama.chat('llama3', prompt)
        client.post_message(event.channel, response)

With n8n

  • Use Mattermost Node in n8n
  • Trigger on new messages
  • Connect to Ollama
  • Post response back

Commands

CommandDescription
!ai What is...?Ask AI anything
!summarizeSummarize thread
!helpShow help

Next step: ship workflows that stay operable

Use proven n8n patterns, templates and integrations for workflows that stay local, documented, and auditable.

Why AI Engineering
  • Local and self-hosted by default
  • Documented and auditable
  • Built from our own runtime
  • Made in Austria
Not legal advice.