vicky-more@prod

~/map/cortexongoing

Cortex

AI support assistant — reads only what you're allowed to see

Cortex lives inside the company's admin panel. Admins ask questions in plain English and get answers from live business data in seconds — through read-only tools that respect the panel's own permissions and mask personal data before anything reaches the model.

read-only by designOpenAI tool callingcost-efficient model routingPII masked before the modelautomated evaluation suite

01Architecture

two systems, one signed bridge

The AI service never touches the database directly — it can only call tools the panel exposes, over a narrow, signed channel.

01 · entry

Admin panel chat

  • Admins sign in through the existing panel — no extra password
  • In-chat thumbs-up / thumbs-down feedback
02 · agent service

Cortex agent — Python (FastAPI)

  • OpenAI models with tool calling
  • Routes each question to the right model
  • Masks personal data before any model call
03 · data tools

Read-only PHP tools

  • Inquiries, invoices, payments, attendance, batches, employees, leave, support requests, dashboard metrics
  • One tool runs the panel's existing reports on demand
model routing

Lower-cost model handles most questions

  • Routine lookups and single-tool answers stay cheap and fast.
model routing

Stronger model takes the harder ones

  • Harder, multi-step questions escalate — keeping overall LLM spend cost-efficient.

02Privacy & access control

guardrails, not bypasses

Every answer goes through the same rules the admin panel already enforces — Cortex adds guardrails, it doesn't bypass any.

auth

Panel permissions, unchanged

Tools check the panel's own module, branch and report permissions, so an admin can only ask about what they could already open.

pii

Personal data masked

Phone numbers, emails and salary data are masked before anything reaches the AI model.

transport

Signed, replay-safe, expiring

Services talk only through HMAC-signed requests over a private Unix socket, protected against replayed requests; chats expire automatically.

03Evaluation & monitoring

tested like any production system

An assistant that reads business data has to be tested and watched like any other production service.

eval

Automated evaluation suite

Built from real admin questions. On its latest full run it passed in full with zero privacy or access leaks.

llmops

LLMOps dashboard

A Next.js dashboard tracks usage, answer rate, response time, AI cost against budget, conversation review and the health of each tool.

feedback

Feedback loop

In-chat thumbs-up / thumbs-down ratings feed back into review, so weak answers surface quickly.

04Agent trace

router → tools → permissions → masking → answer

Pick a sample question to replay the steps Cortex goes through before it answers.

! Illustrative example — not real data. Questions, tool names and values are made up.

sample questions

admin> choose a sample question

    Illustrative only. The real system's tools, prompts and data are private.

    Next: TRATOM.

    Edge recording across 150+ classrooms with a multimodal-LLM analytics layer.