CRM-ASSISTANT

An assistant inside the CRM that only sees what your role may see.

RAG9 READ-ONLY TOOLSACCESS IN CODEANSWER CACHECOST LOGNODE.JS · TYPESCRIPT
♦ ASSISTANTKNOWLEDGE BASEUSAGE & COSTPROFILESANNA NOVAK · SALES MANAGER
YOU

Can we take back a fan that was made to order?

ASSISTANT

No. Made-to-order fans (status “on order” at the time of sale, custom voltage or coating) cannot be returned. The 24-month warranty still applies to them.

SOURCE · RETURNS AND WARRANTY POLICY
YOU

Does Atlas Construction have overdue invoices?

DENIEDfind_customer → found 1, but not among your customers; ask their manager (Olga Brandt)
ASSISTANT

I couldn’t find Atlas Construction in your customer list. According to the system, this customer exists but is assigned to another sales manager — Olga Brandt. You would need to check with her for details on their invoices.

›Ask the assistant…
ACCESS BY ROLEENFORCED IN CODE
TOOLSALESSERVICEHEAD OF SALES
catalog · 4 tools√—√
get_model√√√
customers · 3 toolsOWN 5/8—ALL 8
order_statusOWNANY, NO PRICESALL
finance fields√HIDDEN√
MORNING BRIEFING · OLGASOURCE PER LINE
Opening sentencetext[MODEL]
Tasks due by tomorrow2[DB]
Shipments2[DB]
Overdue invoices3[DB]

LISTS AND NUMBERS ARE INSERTED BY CODE. NOTHING TO REPORT MEANS NO MODEL CALL AT ALL.

THE PROBLEM

Sales and service staff answer customer questions by digging through a knowledge base, a catalog and the CRM. An assistant can do that in seconds — as long as it never shows a manager someone else’s customer, never invents a product code, and doesn’t pay for the same answer twice.

WHAT I BUILT

  • Knowledge-base search that mixes vectors and BM25; the sources under each answer are attached by code, not written by the model.
  • Nine read-only CRM tools for the catalog, customers and orders. The model decides when to call them; the tools decide what it may see.
  • A morning briefing assembled from the database: tasks, shipments, overdue invoices. The model writes one sentence on top and isn’t called at all when there is nothing to report.
  • An answer cache per role and a usage log with tokens and cost for every request.

HOW IT’S CHECKED

  • Access is enforced in code, not in the prompt. A sales manager sees only their own customers and orders; a service engineer gets no customer data and no prices. A refusal shows up as a red DENIED step in the inspector.
  • Product codes in an answer are checked against what the tools actually returned in this request; anything else is flagged.
  • Every briefing line is tagged DB or MODEL, so it’s obvious which part the model wrote.
  • Follow-ups and other languages are rewritten into a standalone English question before the search, so the knowledge base is searched with the full question.

WHAT THE DEMO SHOWS

Northwind Air, a fictional distributor of ventilation equipment: 46 fans, 8 customers, 22 knowledge-base articles and three roles — sales manager, service engineer, head of sales. 36 recorded model answers replay without an API key.

9 TOOLSAll read-only, scoped by role in code
3 ROLESSales, service, head of sales
22 DOCSPolicies, how-tos, product guides, plus curated answers
9 TESTSAccess rules, code checks, cache keys, briefing
The demo: a sales manager asks about another manager’s customer, and the inspector shows the find_customer step as DENIED
REAL SCREENSHOT · THE REFUSAL HAPPENS IN THE TOOL, BEFORE THE MODEL SEES ANY DATA
RUN ITNODE 22 · NO API KEY NEEDED
$ git clone https://github.com/nrmnprm/crm-assistant
$ cd crm-assistant && npm install
$ npm start # http://127.0.0.1:4320
→ without a key: replays the recorded answers
→ with a key in .env: live answers