Skip to main content

Domain Model

Field-level schemas for all core domain objects in the Helvia Platform platform. Source of truth: hbf-core (Java/Kotlin, MongoDB). Consumer types: hbf-core-api (TypeScript). Last updated: 2026-03-19

Object Map

Core Objects

Organization

Top-level container for all resources. Multi-tenant boundary.

FieldTypeRequiredNotes
idStringyesPK
displayNameStringyes
imageStringnoLogo URL
timezoneStringnoDefault: "UTC"
dataRetentionPeriodIntnoDays
auditLogsRetentionPeriodIntnoDays
loginSettingsLoginSettingsnoSSO, branding, auto-creation

Collection: organizations Full schema: docs/domain-model/organization.md TypeScript: hbf-core-api/src/datamodel/organization.ts


Tenant

A single chatbot instance within an Organization. Contains all bot content, settings, and deployment config.

FieldTypeRequiredNotes
idStringyesPK
displayNameStringno
organizationOrganizationyes@DBRef lazy
contentBotContentno@DBRef lazy
settingsTenantSettingsyesUser-editable settings
systemSettingsTenantSystemSettingsyesModerator-level settings
nlpMapMap<String, String>noLanguage to NLPPipeline ID
powerupsList<Powerup>yesEnabled features
spaceSpaceyesBOT_LAB, CX, EX

Collection: tenants Full schema: docs/domain-model/tenant.md TypeScript: hbf-core-api/src/datamodel/tenant.ts


User

Platform user with roles across Organizations and Tenants.

FieldTypeRequiredNotes
idStringyesPK
emailStringyes@Indexed
passwordStringyesHashed
fullNameStringyes
isModeratorBooleanyes
organizationsList<Organization>yes@DBRef lazy
tenantRolesMap<String, Map<String, Set<TenantRole>>>yesorg -> tenant -> roles
organizationRolesMap<String, Set<OrganizationRole>>yesorg -> roles

Collection: users Full schema: docs/domain-model/user.md TypeScript: hbf-core-api/src/datamodel/user.ts


ChatSession

A single conversation session between a subscriber and a bot.

FieldTypeRequiredNotes
idStringyesPK
uuidStringyes@Indexed unique
tenantTenantno@DBRef lazy
statusChatSessionStatusyesACTIVE, COMPLETED
messagesList<ChatSessionMessage>yesEmbedded
liveChatsList<LiveChatSession>noEmbedded
metadataChatSessionMetadatanoDeployment info, subscriber info
intentsMap<String, Int>noIntent name to count

Collection: chat-sessions Full schema: docs/domain-model/chat-session.md TypeScript: hbf-core-api/src/datamodel/chat_session.ts


ChatSessionMessage

A single message within a ChatSession. Embedded in ChatSession.messages.

FieldTypeRequiredNotes
idStringnoSet by hbf-bot
messageStringnoMessage text
typeChatSessionMessageTypenoTEXT, POSTBACK, ATTACHMENT, TRIGGER
categoryChatSessionMessageCategorynoCOMMON, FEEDBACK, FALLBACK, LIVE_CHAT, BACK
isUserInteractionBooleanno
liveChatEventTypeLiveChatEventTypenoFor live chat messages
dateDatenoTimestamp

Embedded in: ChatSession.messages Full schema: docs/domain-model/chat-session-message.md TypeScript: hbf-core-api/src/datamodel/chat_session.ts


BotContent

Container for all bot activities (flows). One per Tenant.

FieldTypeRequiredNotes
idStringyesPK
activitiesList<Activity>yesDefault empty
mainActivityStringnoActivity ID of entry point
staticVariablesList<StaticVariable>yesBot-level variables

Collection: bot-contents Full schema: docs/domain-model/bot-content.md TypeScript: hbf-core-api/src/datamodel/botContent.ts


BotDeployment

A deployment of a bot to a specific messaging platform.

FieldTypeRequiredNotes
idStringyesPK
handleStringyes@Indexed unique, deployment identifier
platformMessagingPlatformyes
displayNameStringno
tenantTenantyes@DBRef lazy
messagingAppMessagingAppno@DBRef lazy
settingsBotDeploymentSettingsyesLayout + integration config
isPreviewBooleanno

Collection: bot-deployments Full schema: docs/domain-model/bot-deployment.md TypeScript: hbf-core-api/src/datamodel/botDeployment.ts


KnowledgeBase

A collection of knowledge articles, shared across Tenants within an Organization.

FieldTypeRequiredNotes
idStringyesPK
nameStringyes
organizationOrganizationyes@DBRef lazy
typeKnowledgeBaseTypeyesINTERNAL, INTEGRATION, SHARED
tenantAssociationsSet<TenantAssociation>noTenants using this KB
languagesSet<KnowledgeBaseLanguage>no

Collection: knowledge-bases Full schema: docs/domain-model/knowledge-base.md TypeScript: hbf-core-api/src/datamodel/knowledgeBase.ts


Integration

Polymorphic external service integration (OIDC, CRM, LLM, Livechat, Ticketing, Translation).

FieldTypeRequiredNotes
idStringyesPK
nameStringyes
typeIntegrationTypeyesDiscriminator for polymorphism
categoryIntegrationCategoryyes
enabledBooleanno
organizationOrganizationyes@DBRef lazy

Collection: integrations Full schema: docs/domain-model/integration.md TypeScript: hbf-core-api/src/datamodel/integration.ts


NLPPipeline

Polymorphic NLP/NLU engine configuration (LUIS, OpenAI, Dialogflow, Helvia).

FieldTypeRequiredNotes
idStringyesPK
nameStringyes
typeNLPTypeyesDiscriminator for polymorphism
languageStringyesPrimary language
statusNLPStatusnoCREATED, OUTDATED, TRAINING, FAILED, READY, INITIALIZING
organizationOrganizationyes@DBRef lazy
tenantTenantyes@DBRef lazy

Collection: nlp-pipelines Full schema: docs/domain-model/nlp-pipeline.md TypeScript: hbf-core-api/src/datamodel/nlp.ts


Subscriber

An end-user of a bot, identified by a platform-specific handle.

FieldTypeRequiredNotes
idStringyesPK
handleStringyes@Indexed unique, platform user ID
fullNameStringno
emailStringno
tenantTenantyes@DBRef lazy, @Indexed
blackboardBasicDBObjectnoRuntime state storage
customDataBasicDBObjectno

Collection: subscribers Full schema: docs/domain-model/subscriber.md TypeScript: hbf-core-api/src/datamodel/user.ts


Broadcast

A message broadcast to groups of subscribers.

FieldTypeRequiredNotes
idStringyesPK
labelStringyes
tenantTenantyes@DBRef lazy
groupsList<Group>yes@DBRef lazy
statusBroadcastStatusyes@Indexed
typeBroadcastTypeyes
methodBroadcastMethodyes
platformMessagingPlatformyes

Collection: broadcasts Full schema: docs/domain-model/broadcast.md TypeScript: hbf-core-api/src/datamodel/broadcast.ts


MessagingApp

Platform-specific messaging application configuration.

FieldTypeRequiredNotes
idStringyesPK
appIdStringyes@Indexed unique
appNameStringyes@Indexed unique
platformMessagingPlatformyes
configMessagingAppConfigurationsyesPlatform-specific config

Collection: messaging-apps Full schema: docs/domain-model/messaging-app.md TypeScript: hbf-core-api/src/datamodel/messaging_app.ts


Survey

Survey responses collected from a ChatSession.

FieldTypeRequiredNotes
idStringyesPK
tenantIdStringyes
chatSessionChatSessionno@DBRef lazy
subscriberStringyesSubscriber ID
questionsList<SurveyQuestion>yes
typeSurveyTypenoINTERVIEW, LIVECHAT, USER_FEEDBACK

Collection: surveys Full schema: docs/domain-model/survey.md TypeScript: hbf-core-api/src/datamodel/survey.ts


FlowGraphNode (hierarchy)

Polymorphic node within a bot flow graph. 36 subtypes.

FieldTypeRequiredNotes
idStringyes
typeFlowGraphNodeTypeyesDiscriminator
labelLocalized<String>yes
actionConversationActionno
positionFlowGraphPositionnox, y coordinates

Embedded in: FlowGraphContent.nodes (within Activity) Full schema: docs/domain-model/flow-graph-nodes.md TypeScript: hbf-core-api/src/datamodel/botContent.ts (compiled form)


Other MongoDB Documents

BotContentCompiled

Pre-compiled version of BotContent for runtime execution. One per Tenant.

FieldTypeNotes
idStringPK
activitiesList<ActivityCompiled>
customActivitiesList<ActivityCompiled>
metadataBotContentCompilationMetadata

Collection: bot-contents-compiled


Group

A named group of subscribers, used for broadcasts.

FieldTypeNotes
idStringPK
tenantTenant@DBRef lazy, @Indexed
labelStringGroup name
handleString@Indexed
subscribersSet<String>Subscriber IDs
platformMessagingPlatform
activeBoolean

Collection: groups


KnowledgeBaseGroup

A named group of articles within a KnowledgeBase. Created automatically when files are synced from external sources (e.g., Azure Blob). One group per source file.

FieldTypeNotes
idStringPK
nameStringGroup name (= file name for synced KBs)
sourceIdStringStable opaque identifier for the source item. Format for Azure Blob: azb_<sha256base64url> (hash of azure:<account>:<container>:<blobPath>)
knowledgeBaseKnowledgeBase@DBRef lazy
organizationOrganization@DBRef lazy
sourceStringProvider type string, e.g. AZURE_BLOB

Collection: knowledge-base-groups


Tag

Organization-scoped label applied to tenants or chat sessions.

FieldTypeNotes
idStringPK
labelStringTag name
scopeTagScopeTENANTS or CHAT_SESSIONS
organizationOrganization@DBRef lazy

Collection: tags


AuditLog

Record of a change to any domain object.

FieldTypeNotes
idStringPK
objectIdString@Indexed, ID of modified object
collectionStringMongoDB collection name
payloadStringJSON serialization of modified object
descriptionString
categoryAuditCategoryACCESS_CONTROL, CONTENT, BOT_SETTINGS, BOT_DEPLOYMENTS, ORG_SETTINGS, ORG_MANAGEMENT
organizationOrganization@DBRef lazy

Collection: audit-logs


ApiToken

API access token scoped to an Organization with role-based permissions.

FieldTypeNotes
idStringPK
tokenStringToken value
roleOrganizationRole
tenantRolesMap<String, Set<TenantRole>>
organizationOrganization@DBRef lazy
issuedByStringUser who created it

Collection: api-tokens


UserInvitation

Pending invitation for a user to join an Organization.

FieldTypeNotes
idStringPK
emailString@Indexed
statusUserInvitationStatusACCEPTED, PENDING, EXPIRED, REVOKED
organizationOrganization@DBRef lazy
tenantRolesMapRoles to grant on acceptance
expirationDateDate

Collection: user-invitations


TestSet

A set of test cases for NLP validation.

FieldTypeNotes
idStringPK
nameString
tenantTenant@DBRef lazy
languageLanguageCode
casesList<TestSetCase>Input/expected intent pairs

Collection: test-sets


TenantStats

Aggregated statistics for a Tenant.

FieldTypeNotes
idStringPK
tenantTenant@DBRef lazy
lastStatsUpdateDate
dataBasicDBObjectKey-value stats

Collection: tenant-stats


Key Enums

MessagingPlatform

MICROSOFT_TEAMS, MICROSOFT_WEB_CHAT, VIBER, FACEBOOK, LIVECHAT, SLACK, INSTAGRAM, UNITY, WHATSAPP, API, ZENDESK

TenantRole

HBF_TENANT_ADMIN, HBF_TENANT_EDITOR, HBF_TENANT_VIEWER, HBF_TENANT_LIVECHAT_ADMIN

OrganizationRole

HBF_ORG_ADMIN, HBF_ORG_EDITOR, HBF_ORG_VIEWER, HBF_ORG_LIVE_AGENT, HRWIZ_EMPLOYEE, HBF_ORG_LIVECHAT_ADMIN

Powerup (feature flags)

HRWIZ, FAQS, BROADCASTS, FLOWS, LIVECHAT, SURVEYS, INTERVIEWS, CHAT_SESSIONS, SENTIMENT_ANALYSIS, ANALYTICS, SETTINGS, BACKUPS, INTEGRATIONS, BILLING, MONITORING, NLU_CACHING, CONNECTORS

Space

BOT_LAB, CX, EX

LanguageCode (28 values)

EN, EL, ES, PT, PT_BR, IT, FR, DE, FI, BG, CS, NL, ET, HE, PL, RO, RU, SR, SL, SV, TR, UK, ZH, FIL, NO, HR, HU, DA

IntegrationType

OIDC_AUTHENTICATION, MICROSOFT_DYNAMICS_CRM, MICROSOFT_DYNAMICS_KB, AZURE_BLOB_STORAGE_KB, CISCO_LIVECHAT, HELVIA_LIVECHAT, ZENDESK_LIVECHAT, GENESYS_LIVECHAT, AZURE_AI_LLM, OPEN_AI_LLM, GEMINI_AI_LLM, ZENDESK_TICKETING, GOOGLE_TRANSLATION

IntegrationCategory

AUTHENTICATION, CRM, KB, LIVECHAT, LLM, TICKETING, TRANSLATION

NLPType

LUIS_NLP, OPENAI_NLP, HELVIA_NLP_SPECIFICATION, HELVIA_RAG_PIPELINE, DIALOGFLOW_NLP, HELVIA_GPT

NLPStatus

CREATED, OUTDATED, TRAINING, FAILED, READY, INITIALIZING

FlowGraphNodeType (36 values)

EMPTY, INTRO, SELECT, MESSAGE, MEDIA, OPTION, MULTI_OPTION, DYNAMIC_MULTI_OPTION, TEXT_INPUT, SWITCH_CASE, SWITCH_VARIABLE, SWITCH_QUERY, SEND_STORED_DATA, HTTP_REQUEST, MISSED_QUESTION, JUMP, LINK_OPTION, LIVECHAT (deprecated), LIVECHAT_REQUEST, ANALYTIC_TAGS, FILE_UPLOAD, USER_FEEDBACK_JUMP, USER_INFO, VARIABLE, EMAIL, ACTION, KNOWLEDGE_BASE_ARTICLE, CARD, CAROUSEL, RESET, INPUT_QUERY, LLM, CUSTOM_RESPONSE, CSAT, STICKY_NOTE, SEMANTIC_SEARCH, GENERATION

ChatSessionStatus

ACTIVE, COMPLETED

ChatSessionMessageType

TEXT, POSTBACK, ATTACHMENT, TRIGGER

ChatSessionMessageCategory

COMMON, FEEDBACK, FALLBACK, LIVE_CHAT, BACK

SurveyType

INTERVIEW, LIVECHAT, USER_FEEDBACK

BroadcastStatus

INACTIVE, PENDING, SENDING, WAITING, COMPLETE, ERROR

BroadcastType (TypeScript)

MESSAGE, POLL, QUIZ, ANALYTICS_REPORT

BroadcastMethod (TypeScript)

BATCHES, ONE_SHOT

ActivityType

DECISION_TREE, LIVECHAT_FLOW, AUTOMATED_ANSWERS, INTERVIEW, USER_FEEDBACK, KNOWLEDGE_BASE, LIVECHAT_SYSTEM_MESSAGE

ResponseType

TEXT, MEDIA, QUICKANSWERS, QUICKPOSTBACK, CAROUSEL, SHARE, HANDOVER, CARD, CUSTOM, DATE_PICKER, DROP_DOWN, CHECKBOX, ACTIONABLE, KNOWLEDGE_BASE, INPUT_QUERY, CSAT


Service-Owned Entities

NestJS microservices own their own TypeORM/PostgreSQL entities. These are not part of the core MongoDB domain model. For per-service data models, see:

  • packages/<service>/docs/data-model.md (generated by exploration scans)
  • docs/architecture/ for cross-service communication diagrams

hbf-data-manager (MySQL — hbf_data_manager database)

Stores per-interaction metadata events published by hbf-bot via Kafka. No dependency on hbf-core domain objects — references ChatSession by its uuid string only.

EntityKey fieldsNotes
InteractionMetadataid (bigint PK, auto-inc), hbf_event_id (char 36), session_id (char 36), ts (timestamp), type (text), friendly_name (text nullable), payload (json), has_error (boolean nullable), duration_ms (int nullable), created_at (timestamp), updated_at (timestamp)One row per bot-workflow step. session_id = ChatSession.uuid. Indexes: idx_session_ts (session_id, ts), idx_hbf_event_ts (hbf_event_id, ts)

Full schema: packages/hbf-data-manager/docs/data-model.md


open-bot-framework (PostgreSQL — obf database) (planned, not yet in use)

Standalone DirectLine 3.0 gateway (planned, not yet in use). Intended as a future self-hosted replacement for Azure DirectLine. Currently hbf-webchat connects to hbf-bot via Azure DirectLine (Microsoft's botframework-directline). No dependency on hbf-core or hbf-core-api.

EntityKey fieldsNotes
OpenBotid (uuid), handle (unique), endpoint, schemaVersionRegistered bot with HTTP endpoint
OpenBotSecretid (uuid), openBotId (FK), secretHash, plainReducted, expiresAtbcrypt-hashed API secret for OAuth2 client credentials
WebChatChannelid (caller-supplied), openBotId (FK), name, secret1, secret2Webchat site with two rotating DirectLine secrets

Full schema: packages/open-bot-framework/docs/data-model.md


hbf-knowledge-manager (no local database)

NestJS service with no local database or TypeORM entities. All persistent state lives in hbf-core (MongoDB). The service orchestrates file sync from external sources into hbf-core KB objects via the hbf-core-api HTTP client.

hbf-core objects consumed:

hbf-core objectHow used
Integration (type AZURE_BLOB_STORAGE_KB)Provides storage credentials (accountName, containerName, sasToken, pathPrefix, allowedContentTypes) and webhookKey for routing inbound Azure Event Grid events
KnowledgeBaseTarget KB that receives synced articles. Looked up by integrationId
KnowledgeBaseGroupCreated/deleted per source file via fileToArticles / deleteBySourceId. sourceId = azb_<sha256base64url>
KnowledgeBaseArticleCreated by hbf-core's fileToArticles pipeline (semantic-doc-segmenter)

Key service-side types (no persistence):

TypeLocationPurpose
IntegrationConfigsrc/common/interfaces/integration-config.interface.tsRuntime config passed between source and sync engine
AzureBlobConfigsrc/sources/azure-blob/azure-blob.interface.tsTyped config for Azure Blob Storage
AzureEventGridEventsrc/sources/azure-blob/azure-blob.interface.tsIncoming webhook payload from Azure Event Grid
AzureSubscriptionValidationEventsrc/sources/azure-blob/azure-blob.interface.tsHandshake payload for Event Grid subscription validation
NormalisedSourceEventsrc/common/interfaces/webhook-handler.interface.tsProvider-agnostic event after parsing
SyncResultsrc/common/interfaces/knowledge-source.interface.tsResult of a full-sync operation
ProviderType (enum)src/common/enums/provider-type.enum.tsAZURE_BLOB
EventAction (enum)src/common/enums/event-action.enum.tsCREATED, DELETED

sourceId format (Azure Blob): azb_<sha256base64url> where the hash input is azure:<accountName_lower>:<containerName_lower>:<normalised_blobPath>. Built by buildAzureBlobSourceId() in src/sources/azure-blob/azure-blob-source-id.ts.

webhookKey format (Azure Blob): <accountName_lower>/<containerName_lower>. Used by hbf-core to index Integration documents for fast lookup on incoming webhooks.


hbf-lcg (MySQL — lcm database)

NestJS live-chat gateway service. Owns its own TypeORM entities in MySQL. References hbf-core's ChatSession (and related objects) only by string IDs passed at runtime — no ORM foreign keys into MongoDB.

EntityTableKey fieldsNotes
LiveChatSessionlive_chat_sessionid (int PK auto-inc), subscriberHandle (indexed), externalServiceSessionId (indexed), externalConversationId (nullable, indexed), organizationId, tenantId, integrationType, status (SubscriberStatus), setCookies (nullable), createdAt, acceptedAt (nullable), lastActivity, plugin (JSON nullable)One row per live-chat handoff. status enum: NONE, ACTIVE, PENDING. plugin stores provider-specific config.
CiscoEventcisco_eventid (int PK auto-inc), eventId (int), eventType (CiscoEventType, default TypingEvent), status (nullable), livechatSession (ManyToOne → LiveChatSession, CASCADE delete)Deduplication by unique constraint (livechatSession, eventId). CiscoEventType default: TypingEvent.

SubscriberStatus enum: NONE, ACTIVE, PENDING

CiscoEventType enum: includes at minimum TypingEvent (default)

Full schema: packages/hbf-lcg/docs/data-model.md