Skip to main content

Data Model: hbf-nlp

Domain objects used by this service. Full schemas: docs/domain-model.md

Objects This Service Uses

ObjectAccessKey Fields Used
Tenantreads via hbf-core-apiid, settings, plugins
ChatSessionDTOreads/writes via hbf-core-apiid, messages, status
ChatSessionMessageDTOreads via hbf-core-apitype, text
NLPPipelinereads/writes via hbf-core-apiid, status, failedReason, tenantId
KnowledgeBasereads via hbf-core-apiid, tenantId, organizationId
KnowledgeBaseArticleDtoreads via hbf-core-apiid, title, body, group, tags
Integrationreads via hbf-core-apiid, type, enabled
OpenAIIntegrationreads via hbf-core-apiapiKey, model settings
AzureAIIntegrationreads via hbf-core-apiendpoint, apiKey, deployment
GeminiAIIntegrationreads via hbf-core-apiapiKey, model settings
Corpusreads via hbf-core-apiid, title, body
MissedQuestionwrites via hbf-core-apiquery, organizationId
TestSetreads via hbf-core-apiid, tenantId, items
Userreads via hbf-core-api (auth)id, email, roles

Local Entities

EntityTableDBKey Fields
ModelmodelMySQLid (uuid), name, integrationType, enabled, type, modelCardUrl
ModelVariationmodel_variationMySQLname (PK), modelId (PK, FK to Model)
ModelPropertymodel_propertyMySQLname (PK), modelId (PK, FK to Model), label, type, defaultValue, options, association
NumberModelPropertymodel_property (STI)MySQLmin, max, step
StringModelPropertymodel_property (STI)MySQL(inherits ModelProperty)
BooleanModelPropertymodel_property (STI)MySQL(inherits ModelProperty)
ArrayModelPropertymodel_property (STI)MySQLlength
MessageMetadatamessage_metadataMySQLid, messageId (unique), sessionId, tenantId, organizationId, query, metadata (JSON)

Notes

  • Uses TypeORM with MySQL/MariaDB for local entities.
  • Model entities use single-table inheritance (STI) via @TableInheritance for property types.
  • MessageMetadata stores NLP processing steps as JSON metadata per chat message.
  • Communicates with helvia-rag-pipelines for RAG pipeline training and inference.
  • Uses cache (via NestJS CacheModule) for tenant and pipeline lookups.
  • Imports types from both the barrel export and deep paths (@helvia/hbf-core-api/dist/src/datamodel/nlp, @helvia/hbf-core-api/dist/src/datamodel/knowledgeBase).