# AI-Powered Replies

## How AI Replies Work

MailTrixy uses artificial intelligence to read incoming emails, understand their intent, and generate contextually appropriate replies. Instead of starting from a blank screen every time, the AI drafts a response that you can review, edit, and send — or, if you trust its accuracy, let it send automatically.

The AI does not simply produce generic text. It pulls relevant information from your Knowledge Base (company documents, FAQs, past conversations) using a technique called Retrieval-Augmented Generation (RAG) — a technique where the AI searches your uploaded documents for relevant information before writing a reply, so answers are based on your actual business knowledge — so the replies contain accurate, business-specific details rather than vague placeholders.

## Reply Generation Flow

Every AI-generated reply follows a predictable pipeline:

1. Email arrives — MailTrixy fetches the new message from your connected email account (IMAP/Gmail API/Outlook API).
2. Intent analysis — The AI reads the email and classifies its intent (question, complaint, request, follow-up, spam, etc.).
3. RAG context lookup — The system searches your Knowledge Base for the most relevant chunks (small sections that the document is split into for efficient searching) of information related to the email content.
4. AI generation — The email text, retrieved context, your personality preset, and any custom instructions are sent to the configured AI provider (OpenAI, Anthropic, etc.).
5. Confidence scoring — The AI assigns a confidence score (a percentage indicating how certain the AI is that its answer is correct) to its own reply, indicating how certain it is that the response is accurate and complete.
6. Delivery decision — Based on your settings, the reply is either auto-sent (if confidence meets the threshold) or queued for human approval.

> Tip: You can view the full generation log for any reply by clicking the AI Details icon next to the message. This shows the retrieved context, the prompt used, the confidence score, and the model that generated the reply.

## Personality Presets

Every business communicates differently. MailTrixy ships with six personality presets that control the tone, vocabulary, and style of AI-generated replies:

Preset | Best For | Description
--- | --- | ---
Professional | B2B, legal, finance | Formal language, structured sentences, no slang or emojis.
Friendly | SaaS, e-commerce | Warm and approachable tone while remaining informative.
Casual | Startups, communities | Conversational, relaxed language. May include light humor.
Sales | Lead nurturing, outreach | Persuasive, benefit-focused, with clear calls to action.
Support | Help desks, tickets | Empathetic, solution-oriented, step-by-step instructions.
Custom | Any | Write your own system prompt to define exactly how the AI should behave.

To change the preset, go to Settings → AI Configuration → Personality. You can also override the preset per email account if different accounts serve different purposes (e.g., sales@ vs support@).

## Confidence Threshold

Every AI reply includes a confidence score between 0 and 100. This score represents how certain the AI is that its response is accurate, complete, and appropriate for the email it received.

- 90–100: Very confident. The AI found strong matches in your Knowledge Base and the email had clear intent.
- 70–89: Moderately confident. The reply is likely correct but may benefit from a quick review.
- 50–69: Low confidence. The AI is unsure — the email may be ambiguous or the Knowledge Base may lack relevant information.
- Below 50: The AI recommends human review. Auto-send will never fire at this level.

You set the minimum confidence threshold in Settings. For example, if you set it to 80, only replies scoring 80 or above will be eligible for auto-send. Everything below that threshold is queued for your approval.

## Auto-Send vs Approval Mode

MailTrixy offers two delivery modes for AI replies:

- Approval Mode (default): Every AI-generated reply is saved as a draft. You see a notification, review the draft, optionally edit it, and click Send. This is the safest option and recommended when you are starting out.
- Auto-Send Mode: Replies that meet or exceed your confidence threshold are sent automatically without human review. Replies below the threshold still go to approval. This is ideal for high-volume support inboxes where speed matters.

> Important: Start with Approval Mode. Once you are satisfied with the AI's accuracy over a few hundred emails, gradually lower the confidence threshold or switch to Auto-Send.

## Business Hours Restriction

You can restrict AI auto-replies to your business hours. When this is enabled:

- Emails arriving during business hours get an immediate AI reply (or draft).
- Emails arriving outside business hours are queued and processed when the next business window opens.

This prevents customers from receiving replies at 3 AM, which can feel impersonal. Configure business hours under Settings → AI Configuration → Business Hours. You can set different hours for each day of the week and specify your timezone.

## AI Exclusion Rules

Not every email should receive an AI reply. Exclusion rules let you define conditions under which the AI stays silent:

- Sender exclusions: Skip AI replies for specific email addresses or domains (e.g., your own team, noreply@ addresses).
- Subject keyword exclusions: Skip emails whose subject contains certain keywords (e.g., "unsubscribe", "out of office", "auto-reply").
- Label/folder exclusions: Ignore emails in certain folders (e.g., Spam, Promotions, Newsletters).
- Conversation depth: Stop AI replies after a configurable number of exchanges in a single conversation thread to prevent infinite loops.

## Sentiment Analysis

MailTrixy analyzes the emotional tone of every incoming email and assigns one of four sentiment labels:

- Positive: The sender is happy, thankful, or satisfied.
- Neutral: The email is informational or procedural with no strong emotion.
- Negative: The sender is dissatisfied or expressing a problem.
- Angry: The sender is frustrated, using strong language, or escalating a complaint.

Sentiment data appears as a colored badge on each conversation. You can also filter your inbox by sentiment to prioritize angry or negative emails that need urgent human attention. The AI adapts its reply tone based on sentiment — for example, responding with more empathy and acknowledgment when the detected sentiment is negative or angry.

## Multi-Language Support

MailTrixy can detect the language of incoming emails and reply in the same language. This works automatically — no configuration required beyond choosing an AI provider that supports multilingual output (all major providers do).

- Auto-detect: The AI identifies the email language and responds in kind.
- Forced language: You can force all AI replies to use a specific language regardless of the incoming email language.
- Translation: Optionally, MailTrixy can show you a translated version of incoming emails alongside the original, so you can review replies in a language you understand.

Supported languages depend on your AI provider. GPT-4o and Claude support 90+ languages with high quality. Smaller models may produce lower-quality output in less common languages.