Data Model: hbf-nlp
Domain objects used by this service. Full schemas:
docs/domain-model.md
Objects This Service Uses
| Object | Access | Key Fields Used |
|---|---|---|
| Tenant | reads via hbf-core-api | id, settings, plugins |
| ChatSessionDTO | reads/writes via hbf-core-api | id, messages, status |
| ChatSessionMessageDTO | reads via hbf-core-api | type, text |
| NLPPipeline | reads/writes via hbf-core-api | id, status, failedReason, tenantId |
| KnowledgeBase | reads via hbf-core-api | id, tenantId, organizationId |
| KnowledgeBaseArticleDto | reads via hbf-core-api | id, title, body, group, tags |
| Integration | reads via hbf-core-api | id, type, enabled |
| OpenAIIntegration | reads via hbf-core-api | apiKey, model settings |
| AzureAIIntegration | reads via hbf-core-api | endpoint, apiKey, deployment |
| GeminiAIIntegration | reads via hbf-core-api | apiKey, model settings |
| Corpus | reads via hbf-core-api | id, title, body |
| MissedQuestion | writes via hbf-core-api | query, organizationId |
| TestSet | reads via hbf-core-api | id, tenantId, items |
| User | reads via hbf-core-api (auth) | id, email, roles |
Local Entities
| Entity | Table | DB | Key Fields |
|---|---|---|---|
| Model | model | MySQL | id (uuid), name, integrationType, enabled, type, modelCardUrl |
| ModelVariation | model_variation | MySQL | name (PK), modelId (PK, FK to Model) |
| ModelProperty | model_property | MySQL | name (PK), modelId (PK, FK to Model), label, type, defaultValue, options, association |
| NumberModelProperty | model_property (STI) | MySQL | min, max, step |
| StringModelProperty | model_property (STI) | MySQL | (inherits ModelProperty) |
| BooleanModelProperty | model_property (STI) | MySQL | (inherits ModelProperty) |
| ArrayModelProperty | model_property (STI) | MySQL | length |
| MessageMetadata | message_metadata | MySQL | id, 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
@TableInheritancefor 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).