AI Staff

Overview

Review chats, create learnings, approve trusted knowledge, and train AI Staff safely.

Not signed in No active session
Waiting for Firebase initialization.
Training Operations

Turn real merchant chats into structured learnings and approved AI knowledge.

This workspace reads your existing chat threads, lets you extract training signals, and moves approved answers into a trusted knowledge base for AI Staff.

Current source

chats

Existing merchant-user chat system
Threads chats
Messages subcollection
Learnings pending queue
Knowledge approved only

Merchants

Realtime

Count from Firestore merchant collection

Chat Threads

Realtime

Training source threads from chats

Pending Learnings

Review

Waiting for approval or rejection

Approved Knowledge

Trusted

Safe records available for AI Staff

Training Pipeline

How AI Staff learns in this app

Aligned
01

Select a real chat thread

Use the existing merchant-user chat conversations as source material.

02

Create a learning record

Extract the intent, prior answer, customer reply, and corrected final answer.

03

Add direct admin knowledge

Admins can type approved question-and-answer pairs directly into the knowledge base.

04

Approve into knowledge

Only trusted records become AI Staff knowledge for future use.

Current Focus

Training-only workspace

No live reply controls here

This app is only for training, learnings, and approved knowledge management.

Scope locked

Uses existing chat infrastructure

The training app reads from your current chats collection and messages subcollections.

Source of truth

Direct admin input supported

Knowledge can now come from manual admin-approved Q&A, not only from chat learnings.

Manual knowledge enabled

Governance

Training guardrails

Chat history as source only Enabled
Pending approval required Enabled
Manual admin knowledge Enabled
Auto-learn everything Blocked

Realtime Health

Connection state

Firebase config Checking
Auth session Waiting
Firestore Waiting

Merchant Chat Inbox

Realtime threads from chats

No chat threads loaded yet.

Conversation

Select a chat

No thread selected
Choose a thread from the left to view its actual messages.
No conversation selected yet.

Debug Console

Live save diagnostics

On-screen trace
Use this panel to see the exact resolved collection names, current signed-in admin session, token claims, and the latest Firestore save errors without opening DevTools.
Resolved collections Waiting for snapshot...
Signed-in user Waiting for snapshot...
Claims Waiting for snapshot...
Last action Waiting for snapshot...
No debug events yet. Use Refresh Debug Snapshot or try Save again.
Knowledge Command Center

Organize the AI brain into clean layers: approved answers, global knowledge, and merchant context.

Keep AI Staff smarter and safer by separating reusable platform knowledge from merchant-specific live context. Admins can now manage trusted answers, system-wide guidance, and structured merchant data from one polished workspace.

AI Layers Approved · Global · Context
Primary Goal Give AI better facts before OpenAI rewrites the reply.

Knowledge Tabs

Choose which AI layer you want to manage

Approved Knowledge

Trusted business answers

Used by AI
Showing all approved knowledge.
No approved knowledge loaded yet.

How Approved Knowledge Works

Final trusted answer layer

What belongs here

FAQ answers, payment guidance, policy replies, pickup explanations, and approved answer patterns that AI Staff can safely use as factual anchors.

How AI uses it

AI Staff reads this first for the correct meaning, then OpenAI rewrites the final wording so the response sounds more human and less robotic.

Best practice

Keep facts short, clear, and correct. Put operational numbers and live merchant settings in Merchant Context, not in plain answer text only.

Global Knowledge

RunZa-wide AI guidance

Homepage mode
Use this when the user has not selected a merchant yet. Store platform-level explainers, delivery basics, locker flow, ordering process, and system-wide policies here.
Best used for General homepage questions

Ordering flow, delivery basics, locker guide, and platform policies.

Avoid mixing No merchant-only facts

Keep exact merchant locations, prices, and live delivery settings inside Merchant Context.

Showing all global knowledge records.
No global knowledge loaded yet.

Global Knowledge Editor

Create platform-level knowledge

Mode: Create global knowledge

Knowledge Identity

Define the scope clearly

Conversation Trigger

What kind of question should this cover?

Approved Response

Anchor answer for AI Staff

Add reusable RunZa-wide knowledge for homepage-style AI conversations.

Merchant Context

Structured merchant info

Live config layer
This is where you store exact merchant data that AI should read as structured facts: location, lat/lng, hours, delivery fee setup, payment methods, radius, and pickup status.
Structured first Save exact operational values

Address, pins, fees, hours, and switches should live here for accurate AI answers.

Flexible layer Add custom merchant facts

Use extra fields for notes that do not fit the fixed inputs, like parking, pickup notes, or branch aliases.

No merchant context loaded yet.
No merchant context records loaded yet.

Merchant Context Editor

Input exact merchant details

Mode: Create merchant context

Merchant Identity

Core business details

Pick a merchant to auto-fill the basic merchant details below, then add or refine the context manually.

Location Layer

Address, pin, and landmark

Operations

Availability and payment

Delivery Pricing

Radius and fee setup

Flexible Merchant Fields

Extra facts not covered above

Add extra context like parking notes, pickup instructions, branch aliases, locker notes, landmark details, special store policies, or any custom merchant fact you want AI Staff to read later.

No extra fields yet. Add one when you need custom merchant info.
Save structured merchant info here so AI Staff can answer location, delivery fee, and store detail questions more accurately.

Pending Learnings

Approval queue

Needs review
No pending learnings loaded yet.

Review Strategy

What belongs in each layer

Global Knowledge

Use for homepage-level guidance, general RunZa flow, locker explainer, and platform-wide answers.

Merchant Context

Use for exact merchant facts like address, pin location, fee setup, radius, hours, and payment methods.

Approved Knowledge

Use for trusted answer patterns and policy replies that AI can safely rephrase for users.

Training Source

Selected chat context

No chat selected yet. Open the Chats tab and choose a conversation for training.

Latest customer message

Previous merchant / AI-style reply

Create Learning

Save a pending training record

Select a chat first, then create a structured learning record.

Test Console

Prompt the AI staff

Sample Output

AI response preview

Sure — the prep time of Cordon Bleu is around 25 minutes based on the merchant menu data.

Internal Access

Firebase sign in

Sign in with your Firebase Authentication account.

Collection Mapping

Current Firestore paths

Merchants merchants
Threads chats
Learnings ai_staff_learnings
Knowledge ai_staff_knowledge
Global Knowledge global_knowledge
Merchant Context merchant_context

This app reads from chats and saves structured learning records into ai_staff_learnings, approved answer patterns into ai_staff_knowledge, system-wide homepage guidance into global_knowledge, and merchant operational facts into merchant_context.