Reference & Glossary — v1.0

Every Field.
Every Term.

Complete field-level documentation for pipeline steps, agents, tools, KB entries, and message context — plus a full glossary of ZaronAI terminology.

AudienceDevelopers & integrators
CoversFields, tools, schemas, glossary
PrevCookbook
Pipeline Steps Agents Tools KB Entries Message Context Glossary
Section 01

Pipeline Step Fields

Each step in a Workflow is a pipelineSteps record. These fields control how the step runs, what it calls, and where control goes next.

Field Type Description
pkey Long Primary key. Auto-assigned.
stepOrder Decimal Display and load order within the workflow. Lower numbers run first.
stepLabel String Unique name for this step within the workflow. Used as the routing target by nextStepOnSuccess, nextStepOnFailure, and Router outcomes. Required
stepType String Controls special execution behavior. ROUTER — reads outcomeFieldName and jumps to the matching step label. GOTO — immediately advances to nextStepOnSuccess without calling the AI. Leave blank for a normal agent step.
targetAgentPkey Long The agent this step invokes. Links to the chatDefs (agent) record. Required for non-GOTO steps.
isFinalAnswer Boolean When true, the pipeline stops after this step and returns the agent’s output as the user-facing reply. Set this on the Finalizer step.
useTools Boolean When true, the step’s agent is given access to its configured tools during the tools pass.
useSchema Boolean When true, the step enforces its agent’s response schema. Set both useTools and useSchema to enable two-phase execution.
toolsMode String Passed directly to OpenAI as the tool availability setting. Typical values: auto, none.
toolChoiceMode String Controls how OpenAI selects a tool. auto — model decides. required — model must call a tool. none — no tools. Note: required automatically switches to auto after the first round to prevent infinite calling loops.
toolChoiceFunctionName String When set, forces the model to call this specific tool function by name (OpenAI force_function mode). Switches to auto after the first round.
resultMode Integer 0 Replace — this step’s output replaces the prior step’s output envelope. 1 Overlay — this step’s output is merged onto the prior envelope, preserving any fields not returned by this step. Useful for agents that progressively fill a shared data structure.
advanceCriteria JSON Array Zero or more field-equality expressions that must all be satisfied in the agent’s JSON response before the pipeline advances. Example: ["issue_ok=true","identity_ok=true"]. If not met, the pipeline holds at this step and returns the agent’s reply to the user.
preventEarlyExit Boolean When true, ZaronAI watches for departure phrases in the user’s message. If advance criteria are not yet met and departure intent is detected, a reminder is appended to the agent’s reply listing what is still required.
outcomeFieldName String For ROUTER steps: the field in the agent’s JSON response that contains the route label. For normal steps: the outcome field used to choose between nextStepOnSuccess and nextStepOnFailure.
successValues String Comma-separated values of outcomeFieldName that are considered a success. Anything else routes to nextStepOnFailure.
nextStepOnSuccess String Step label to jump to when the outcome is successful or advance criteria are met.
nextStepOnFailure String Step label to jump to on failure. Leave blank to hold at the current step.
stopOnError Boolean When true, an unhandled exception in this step halts the pipeline and surfaces the error rather than attempting to continue.
stepNotes String Developer notes. Not used at runtime.
recordactive Boolean Soft-delete flag. Set to 0 (false) to disable a step without deleting it.
Two-phase execution

When both useTools = true and useSchema = true, ZaronAI runs the step twice: Phase 1 with tools enabled (no schema), Phase 2 with schema enforced (no tools). Tool results from Phase 1 are persisted to the conversation history before Phase 2 runs.

Section 02

Agent Fields

An agent is a chatDefs record. It defines the AI model, system prompt, and response schema for one role in the pipeline.

Field Type Description
modelName String OpenAI model identifier. Examples: gpt-4o, gpt-4o-mini, gpt-4.1-nano. Note: GPT-4.1 series does not support the Responses API.
systemPrompt String (long) The agent’s instruction set. Sent as the system message before every conversation. Changes take effect immediately on the next call — no restart required.
responseSchema JSON String JSON Schema definition the agent must conform to when useSchema = true on the calling step. Each agent should have its own exclusive schema rather than sharing one across agents.
temperature Double Controls response randomness. Range 0.0–2.0. default 0.7 Note: not supported by all models (e.g. o-series).
maxTokens Integer Maximum tokens in the model’s response. Passed as max_tokens or max_completion_tokens depending on the model.
useResponsesAPI Boolean When true, calls are routed to the OpenAI Responses API instead of Chat Completions. Only compatible with supported models.
Section 03

Built-in Tools

Tools are server-side functions an agent can call during its execution. The AI decides when to call them. ZaronAI executes them and returns the result to the AI in the next message.

💾
save_user_info
Saves caller identity to the database. Designed to be called incrementally as the user provides details.
📚
retrieve_kb_entries
Searches the Knowledge Base by keyword. Lexical scoring — deterministic, fast, no embeddings.
🎫
finalize_send_ticket
Creates the ticket record, queues it for processing, and triggers SMS and email notifications.

save_user_info

Saves or updates contact fields for the current visitor session. Any field not passed is left unchanged. Call it incrementally — the AI can call it multiple times as the user provides more information across turns.

ParameterTypeDescription
firstNameString Visitor’s first name.
lastNameString Visitor’s last name.
emailString Email address.
phoneString Phone number. Normalized to E.164 format for SMS compatibility.
streetAddressString Street address line.
cityString City.
stateString State or province.
zipString Postal code.
save_user_info — return JSON
// Returned to the AI after each call { "saved": true, "userInfo": { "firstName": "Jane", "lastName": "Smith", "email": "[email protected]", "phone": "+16155550100", "streetAddress": "", "city": "", "state": "", "zip": "" }, "customer_recognized": false // true if this visitor was seen before (same name + IP) // recognition_context included when true }

retrieve_kb_entries

Searches the agent’s Knowledge Base JSON array using lexical scoring. No embeddings or external services required. Returns the top matching entries with confidence scores.

ParameterTypeDescription
queryString Search query. The tool tokenizes this into words and phrases and scores against each KB entry. Required
categoryString Optional. Filter to entries with this category value. Matching entries also receive a confidence boost of +2.
max_resultsInteger Maximum entries to return. Range 1–10. default 5
min_confidenceNumber Minimum normalized confidence score (0–1) for an entry to be included. Range 0–1. default 0.35
include_excerpt_charsInteger Character length of the content excerpt returned per entry. Range 50–1500. default 350
Scoring weights

Title match: +5 per token  •  Keyword match: +2 per token  •  Content match: +1 per token  •  Phrase bonus in title: +3  •  Phrase bonus in content: +1  •  Category match: +2

retrieve_kb_entries — return JSON
{ "kb_found": "true", "kb_items": [ { "id": "pump-001", "title": "Variable Speed Pump — Model VP100", "excerpt": "The VP100 is a 1.5HP variable speed pump...", "source": "equipment", "confidence": 0.87 } ] }

finalize_send_ticket

Called by the Finalizer agent to close the conversation and create the ticket record. Copies the saved visitor contact info into the output queue, assigns the ticket type, and triggers email and SMS dispatch via the client’s configured notification settings.

ParameterTypeDescription
ticket_typeString Classifies the ticket for routing and notification labeling. Example values: Service, Sales, General. default "Service"
Notifications

After the ticket record is created, cOutputQ.ProcessQ() dispatches notifications. Email is sent via the ZaronAI.com hosting account. SMS is sent via the client’s own Twilio credentials (Twilio_SID, Twilio_Token, Twilio_From) stored in the client’s key bundle.

Section 04

Knowledge Base Entry Schema

Each KB entry is a flat JSON object in the agent’s referenceData array. All fields are siblings at the top level — nothing is nested inside content.

FieldTypeDescription
idString Unique identifier for this entry. Required
titleString Entry title. Carries the highest scoring weight in retrieval (+5 per token). Required
categoryString Optional grouping label. Used for category-filter queries and scoring boost.
keywordsString Array Additional terms that should trigger this entry. Scoring weight +2 per match.
contentString Plain prose description. Used for search excerpts and content-token scoring. Do not nest data fields inside this string. Required
priceNumber / String Product or service price. Sibling of content, not inside it.
instockBoolean Inventory availability flag.
locationsString Array Service area or store locations where this item applies.
weightNumber Physical weight (product entries).
width / length / depthNumber Physical dimensions (product entries).
shapeString Shape descriptor (e.g. round, rectangular).
styleString Style or finish descriptor.
recordActiveBoolean Soft-delete flag. Inactive entries are excluded from retrieval. default true
updatedUTCDateTime ISO 8601 UTC timestamp of last update.
KB Entry — example
{ "id": "pump-vp100", "title": "Variable Speed Pump VP100", "category": "equipment", "keywords": ["pump", "variable speed", "energy efficient"], "content": "The VP100 is a 1.5HP variable speed pool pump...", "price": 649.00, "instock": true, "weight": 22.5, "recordActive": true, "updatedUTC": "2026-01-15T14:30:00Z" }
Section 05

Message Context & chatMessages Fields

Every turn in a conversation is stored as a chatMessages record. ZaronAI builds each OpenAI API request by loading only the messages where includeInContext = true, in pkey order.

FieldTypeDescription
pkeyLong Primary key. Defines message order within the conversation.
chatHdrPkeyLong Session key. Links all messages for one visitor conversation. Required
roleString OpenAI message role. One of: system, user, assistant, tool. See role table below.
contentString Message body text.
tool_call_idString OpenAI tool call ID. Required on tool role messages to link the result back to the call.
tool_callsJSON Array Present on assistant messages when the model requested tool calls. Stored as returned by OpenAI.
includeInContextBoolean When true, this message is included in the next API request. Set to false to suppress a message without deleting it. Pipeline user messages are always set to true to preserve conversation history across agents.
persistToolOutputBoolean When true on a tool definition, the tool’s result is saved back into the message history as an assistant message. This allows later agents to read what an earlier tool returned — for example, the contact info saved by save_user_info.
recordactiveBoolean Soft-delete flag. Inactive messages are excluded from all context builds and queries.

Message Role Reference

RolePurpose
system The agent’s instruction set. Always the first message sent to OpenAI. Contains the system prompt from the agent record.
user A message from the visitor, or an injected pipeline message passing context between steps.
assistant A message from the AI model. Also used to persist tool output summaries back into conversation memory.
tool The result returned by a tool call. Must include the matching tool_call_id.
Context ordering

OpenAI requires a strict message ordering: system first, then alternating user / assistant pairs, with tool results immediately following the assistant message that requested them. ZaronAI assembles this ordering automatically from the chatMessages table on every API call.

Section 06

Glossary

Every term used across ZaronAI documentation, in one place.

Agent
A single AI role with its own system prompt, tools, and response schema. Powered by an OpenAI model. Stored as a chatDefs record.
Pipeline
The Workflow — an ordered sequence of agent steps that processes each user conversation from first message to final ticket.
Step
One agent invocation within the pipeline. Has a label, type, advance criteria, branch targets, and execution flags. Stored in pipelineSteps.
Router
A step with stepType = "ROUTER". Reads the outcome field from the agent’s response and jumps to the matching step label. Supports any number of routes.
GOTO Step
A step with stepType = "GOTO". Immediately advances to nextStepOnSuccess without calling the AI. Used for conditional branching logic.
Finalizer
The last pipeline step. Has isFinalAnswer = true. Produces the user-facing reply and calls finalize_send_ticket to create the ticket record.
System Prompt
The agent’s instruction manual. Defines role, tone, rules, and knowledge. Sent as the system message before every conversation. Editable at any time without redeployment.
Schema
A JSON Schema definition the agent must conform to when returning its response. Enforced by OpenAI’s structured output feature. Each agent should have its own exclusive schema.
Advance Criteria
Field-equality expressions (e.g. issue_ok=true) stored on a pipeline step. All must be satisfied in the agent’s JSON response before the pipeline advances to the next step.
Exit Guard
Activated when preventEarlyExit = true. Detects departure phrases in the user’s message and appends a reminder of what is still needed before the conversation can close.
Two-Phase Execution
Running a step twice: Phase 1 with tools enabled (no schema) to execute side effects, then Phase 2 with schema enforced (no tools) to produce clean structured output. Enabled when both useTools and useSchema are true.
Overlay (resultMode 1)
A step result mode where the step’s output is merged onto the prior step’s output envelope rather than replacing it. Fields not returned by the current step are preserved from the prior step.
Replace (resultMode 0)
The default step result mode. The step’s output fully replaces the prior step’s output envelope.
includeInContext
A flag on each chatMessages record. When true, the message is included in the next OpenAI API call. Setting it to false suppresses the message without deleting it.
persistToolOutput
A flag on a tool definition. When true, the tool’s result is saved back into the conversation history as an assistant message, making it readable by later agents in the pipeline.
chatHdrPkey
The session key for a single visitor conversation. Every message, tool call, and agent invocation in that conversation references this key.
keyBundle
A per-client credential bundle loaded at runtime. Contains API keys (OpenAI, Twilio, etc.) so each client uses its own credentials. Never shared across clients.
Tool
A server-side function an agent can call during execution. The AI requests the call; ZaronAI executes it and returns the result. Built-in tools: save_user_info, retrieve_kb_entries, finalize_send_ticket.
Knowledge Base (KB)
A JSON array of structured entries attached to an agent as referenceData. Searched by the retrieve_kb_entries tool using lexical scoring. Domain-agnostic — works for any business type.
Lexical Scoring
The KB retrieval scoring method. Matches query tokens against title, keywords, and content with fixed weights. Deterministic and explainable — no embeddings or ML inference required.
Ticket
The output record created by finalize_send_ticket. Captures visitor contact info and conversation context. Queued for email and SMS dispatch via cOutputQ.ProcessQ().
ticket_type
A string parameter passed to finalize_send_ticket that classifies the ticket (e.g. Service, Sales). Drives notification labels and routing. Defaults to "Service" if omitted.
Soft Delete
ZaronAI never hard-deletes records. To deactivate a record, set recordActive = 0. All queries filter on this flag. Deleted records remain in the database for audit and recovery.
E.164
The international phone number format required by Twilio SMS (e.g. +16155550100). ZaronAI normalizes phone numbers to this format when saved via save_user_info.