iVendNextDevelopers Request a sandbox

13. AI on iVendNext — bring your own

A cashier presses AI tip on a sale and the hint appears in the till's own sheet

A cashier presses AI tip on a sale; a short hint appears in the till's own sheet. In this walk a stand-in answered; a real AI model has not been tried.

Add a short AI hint to the till, or give a manager an AI assistant that answers questions about the shop and, after a yes, changes a promotion or a price. The customer brings the AI; you bring the service that connects it.

For: a builder who wants an AI hint at the till, or an AI assistant for a manager, working with a customer's iVendNext. Reference implementation: A till key that asks an AI model with ../samples/s6_ai_till_key/ · A manager's AI assistant with ../samples/s10_ai_manager/ · our MCP server ../tools/mcp_server/.

When to use it

When a customer wants AI at the counter or in a manager's hands, on a model it chooses and pays for.

The rule: bring your own AI. The customer uses an assistant it already pays for, or a free open-weight model on its own machine (the recipe names Ollama, llama.cpp and vLLM). We pay for no model, ship none and never charge per question. Nothing AI runs inside the customer's site: your service or ours runs outside it, on the customer's own key.

You want The shape
A short AI-written hint for the cashier during a sale (an add-on to suggest, a care note) an AI till key: a till key (chapter 6) whose answer is a message
A manager who asks the shop a question, and, with a yes, changes a promotion or a price our MCP server, on the manager's own key
An agent that reacts to what happens in the shop an outside app on the event feed (chapter 5). The kit has no agent sample yet: not covered

Steps: an AI hint at the till

  1. Pick the provider and run the service. The sample keeps its logic in core.py, the provider in providers.py and the HTTP service in service.py: about a hundred lines of standard-library Python. Set these in its environment:

    • PP_POINT_SECRET: the signing secret you will give the shop;
    • PP_AI_PROVIDER: stub (no AI at all) or chat;
    • for chat only: PP_AI_URL (any service that speaks the chat-completions request), PP_AI_KEY (the customer's own key, if it needs one) and PP_AI_MODEL.

    Put it behind HTTPS. The till calls HTTPS only.

  2. Register the key in the shop. A System Manager opens Retail Remote App Key in Desk and adds a record with:

    • your name, an app name, the key and its label;
    • message as the only thing it may return;
    • your HTTPS address (the service's route is …/point/ai_tip) and the signing secret;
    • the time to answer: 3 seconds unless raised; at most 10 on this record, at most 5 if a manifest declares it. Design for 3 (chapter 6).

    Tick the customer's consent and paste the consent text the sample prints. The sample builds that text from the same list of fields it builds the prompt from, so the words and the data cannot drift apart.

    The AI tip key's record in Desk: enabled, message only, the partner's HTTPS address

    The key's record in Desk, cut above the signing secret.

  3. Switch the key on in the store: POS Studio → the theme → Apps → tick the key → Save, as for any till key.

  4. Choose a model that answers in time, or raise the time to answer to what the counter can bear. Use a small model and a short prompt (the sample asks for at most 40 words).

What is sent, and to whom.

Steps: a manager's AI assistant

The till's price for AirPods before and after the manager's yes, and the promotion on in Desk

The manager says yes to the 10% off AirPods promotion: the till's price drops from R 3,999.00 to R 3,599.10, and Desk shows the promotion as Active.

  1. Give the manager a key with only the rights they need: read on sales, closings, stock, profiles, items, prices and promotions; write on promotions and price rows only if they may change them. The server can never give more than the role has: if a reader's key says yes to a change, the change is refused by the shop (403). Keep the role narrow for privacy too: the assistant's read tools return any field the manager's key may read, so a customer's name on a sale can reach the AI provider.

  2. Pick a profile and start the server outside the shop.

    • profile_read.json lets the assistant look: 6 tools, 3 record types, and no write exists in it.
    • profile_writes.json adds one write: switching a promotion on or off, or changing a price-list row. It names the one field of each type that may change.

    A profile can only take away from the server. Put HTTPS in front of it before anyone else reaches it.

    IVN_BASE=https://shop.example python3 tools/mcp_server/server.py --http 127.0.0.1:8130 --profile samples/s10_ai_manager/profile_read.json
    IVN_BASE=https://shop.example python3 tools/mcp_server/server.py --http 127.0.0.1:8130 --profile samples/s10_ai_manager/profile_writes.json --writes
    

    Over HTTP, each request brings the manager's own Authorization: token <key>:<secret>. The server forwards it to the shop and never stores it. An AI desktop app that starts its own tool servers runs the same command without --http, with IVN_BASE, IVN_KEY and IVN_SECRET in its environment.

  3. Connect the assistant. Any assistant that speaks the Model Context Protocol will do. The profile's words tell it to add sales up in the shop rather than list them, and to show a preview and ask before any change.

  4. Test with the scripted assistant before a person uses it. It plays the manager's sentences with fixed rules, so the whole path runs with no AI account: python3 -m unittest discover -s samples/s10_ai_manager/tests.

How a write is guarded.

⚠ The server cannot see a person. confirm is the assistant's promise that the manager said yes. Use an assistant that asks before it calls a tool marked as changing things, and read the audit log.

What is refused, and why

When your service is down, and when the till is offline

What happens The cashier reads
The model is slow, past the time to answer AI tip did not answer in time. Nothing was added to the sale.
The model is down, errors or answers nonsense AI tip could not finish. Nothing was added to the sale. The service never invents a tip
The answer breaks the message rules AI tip answered in a way this till cannot use. Nothing was added to the sale.

A service that is down, or a wrong secret, is refused whole, with nothing added to the sale. A till key is online only; offline, the sale goes on without it. The manager's assistant needs the shop; offline was not tested, and the MCP server being down is not covered by the kit yet.

Technical notes

What the kit has proven

What it has not

The pictures

Both flows were walked on our test bench on 2026-10-07, iVendNext POS app at 8dc36aab8: S6's till frame is /pos?frame=terminal, 1440 wide, then Desk; S10's is the same till frame, then Desk. Every S6 frame is cut above the record's signing secret; every S10 frame is cut above the till's key row. The S10 conversation itself is text, in the sample's README.

See also

3. The ladder and the four rules · 5. Outside apps and the event feed · 6. Till keys

This page in the kit