AI assistant
Configure the in-app AI chat and replenishment explanations
MPH WMS includes a built-in AI assistant that can answer questions about your warehouse (stock levels, pick locations, order status, replenishment suggestions) in natural language. It also powers the Explain with AI button on the reorder suggestions page.
The assistant is BYOK (Bring Your Own Key) — you choose the provider and supply credentials. We never proxy AI traffic through our servers.
Choosing a provider
Go to Settings → AI assistant and pick one of:
- Anthropic (Claude) — recommended for best Swedish output and tool use. Get a key at console.anthropic.com.
- OpenAI (GPT) — works well, slightly cheaper for the smaller models. Get a key at platform.openai.com.
- Custom (self-hosted) — point the assistant at any OpenAI-compatible endpoint, including Ollama, LM Studio, vLLM, and LocalAI. Your data never leaves your own machine or network.
Setup — Anthropic or OpenAI
- Select the provider.
- Pick a model. The dropdown lists supported options; defaults are chosen for you.
- Paste your API key. It is encrypted with AES-256-GCM before being written to the database — only your tenant can decrypt it.
- Click Test connection to verify. A green toast with the model's reply confirms success.
- Flip Activate assistant on and click Save. A sparkle icon appears in the top bar; click it to open the chat.
You can rotate the key at any time by entering a new value and saving — leave the field blank to keep the existing key.
Setup — Custom (Ollama, LM Studio, vLLM)
- Select Custom (self-hosted).
- Enter the Base URL for your endpoint. Quick-pick buttons cover the most common setups:
- Ollama (localhost) —
http://localhost:11434/v1 - Ollama (from Docker) —
http://host.docker.internal:11434/v1(use this when the web app runs in a container and Ollama runs on the host) - LM Studio (localhost) —
http://localhost:1234/v1 - vLLM (localhost) —
http://localhost:8000/v1
- Ollama (localhost) —
- Enter the model name exactly as it appears in your runtime. For Ollama, this is the name shown by
ollama list(e.g.llama3.1,qwen2.5,mistral-nemo). - The API key field is optional — most local backends accept any value. Fill it in only if you've put your endpoint behind a proxy that requires a token.
- Test connection and Save as above.
The chat assistant calls tools (search items, look up stock, etc.) to get accurate answers. Pick a model that supports tool use / function calling — Llama 3.1+, Qwen 2.5, Mistral Nemo work well. Smaller or older models will ignore tools and hallucinate data.
What the assistant can do
The assistant has read-only access to your warehouse data via tools:
- Look up items by SKU or name, including pick locations.
- Report current stock per warehouse, including reserved and available.
- Look up sales orders by order number, including line items and handling status.
- List recent orders, optionally filtered by status.
- Generate purchase suggestions based on sales velocity, current stock, incoming POs and supplier lead times.
- Read these docs — the assistant searches and quotes the in-product documentation, so you can ask "how do I configure carriers?" or "what does landed cost mean?" and get an answer with a link to the relevant page.
It can also propose write actions that require explicit approval before they run:
- Adjust on-hand stock for an item in a warehouse.
- Assign a pick location to an item (primary / add / replace).
- Set a shipping template on an order.
- Create a new bundle item or convert an existing item into a bundle, including suggesting reasonable components.
Each proposed write appears as a card in the chat with an Approve and Decline button. Nothing changes until you approve.
It does not modify data yet. Write actions (adjust stock, change order status, etc.) are planned for a later release behind explicit per-action confirmation.
Permissions
The assistant always acts within the calling user's permission set. A user without stock:read cannot get the assistant to retrieve stock data, even by asking. Row Level Security keeps each tenant's data isolated.
Privacy
- Your API key is encrypted at rest and only decrypted in-process when handling a chat request.
- The messages you send are forwarded to the chosen provider (Anthropic, OpenAI, or your own server). With the custom provider, nothing leaves your network.
- Every conversation is logged for audit in your tenant's
ai_conversation/ai_messagetables, so administrators can review usage.
Cost
Anthropic and OpenAI bill you directly based on token usage — MPH WMS adds nothing on top. The self-hosted option has no per-token cost beyond running your own hardware.