@memberjunction/content-autotagging 5.49.0 → 5.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,7 @@ AI-powered content ingestion, autotagging, and vectorization engine for MemberJu
5
5
  > **Read these guides first** if you're working on tag classification, taxonomy growth, or governance:
6
6
  > - [Content Autotagging Guide](../../guides/CONTENT_AUTOTAGGING_GUIDE.md) — pipeline architecture, prompt structure, source-type providers
7
7
  > - [Taxonomy & Tagging Guide](../../guides/TAXONOMY_TAGGING_GUIDE.md) — the tag taxonomy itself: 4+1-tier resolver, per-tag governance, scoping, the suggestion queue, Tag Health, and per-source configuration knobs
8
+ > - [Content Segmentation Guide](../../guides/CONTENT_SEGMENTATION_GUIDE.md) — **how content is chunked before embedding.** This pipeline chunks twice, for two different consumers: embedding chunks (persisted as `Content Item Chunks`, sized to the embedding model) and tagging chunks (transient, sized to the LLM context window). Both route through `@memberjunction/ai-segmentation` via `resolveSegmenterKey()` / `segmentTextForChunking()`, sharing a strategy but **keeping separate token budgets**. Override `resolveSegmenterKey()` to opt into structure-, topic-, or transcript-aware segmentation. Read before touching either.
8
9
 
9
10
  ## Overview
10
11
 
@@ -1,9 +1,104 @@
1
- import { BaseEngine, IMetadataProvider, UserInfo } from '@memberjunction/core';
1
+ import { BaseEngine, IMetadataProvider, UserInfo, EntityInfo } from '@memberjunction/core';
2
2
  import { MJContentSourceEntity, MJContentItemEntity, MJContentFileTypeEntity, MJContentProcessRunEntity, MJContentTypeEntity, MJContentSourceTypeEntity, MJContentTypeAttributeEntity, MJContentItemTagEntity, MJContentSourceTypeParamEntity, MJContentProcessRunEntity_IContentProcessRunConfiguration } from '@memberjunction/core-entities';
3
+ import type { MJContentSourceEntity_IContentSourceConfiguration } from '@memberjunction/core-entities';
3
4
  import { ContentSourceParams, ContentSourceTypeParams, ContentSourceTypeParamValue } from './content.types.js';
4
5
  import { RateLimiter } from './RateLimiter.js';
5
6
  import { ProcessRunParams, JsonObject, ContentItemProcessParams } from './process.types.js';
7
+ import { BaseEmbeddings } from '@memberjunction/ai';
6
8
  import type { MJAIPromptEntityExtended } from '@memberjunction/ai-core-plus';
9
+ import { FixedWindowSegmentationOptions } from '@memberjunction/ai-segmentation';
10
+ import { VectorDBBase, VectorRecord } from '@memberjunction/ai-vectordb';
11
+ /**
12
+ * Resolved vector infrastructure for a specific (embeddingModel + vectorIndex) pair.
13
+ * Items sharing the same pair are batched together for efficient processing.
14
+ */
15
+ export interface ResolvedVectorInfrastructure {
16
+ embedding: BaseEmbeddings;
17
+ vectorDB: VectorDBBase;
18
+ indexName: string;
19
+ embeddingModelName: string;
20
+ /** The AI model ID for the embedding model (UUID), used by AIModelRunner for tracking */
21
+ embeddingModelID: string;
22
+ /**
23
+ * Reduced embedding dimensions from `MJ: Vector Indexes.Dimensions`, when set. Passed to the
24
+ * embedding call so models that support it (e.g. text-embedding-3-*) produce shorter vectors.
25
+ * Undefined means the model's native dimensionality (matches PR #3175's entity-path behavior).
26
+ */
27
+ dimensions?: number;
28
+ /**
29
+ * Parsed `MJ: Vector Indexes.ProviderConfig` JSON — the opaque, provider-specific blob passed
30
+ * to the vector DB so drivers can read their own settings (e.g. Pinecone's `namespaceField`).
31
+ * Undefined when the index has no ProviderConfig or it is not valid JSON.
32
+ */
33
+ providerConfig?: Record<string, unknown>;
34
+ }
35
+ /**
36
+ * How a chunk's vector-DB record id is derived — `'recordId'` (the chunk's own PK, purge-safe) or
37
+ * `'hash'` (deterministic, EntityDocument-parity). Derived from the generated JSONType interface so
38
+ * it tracks the metadata definition. See {@link AutotagBaseEngine.resolveChunkVectorID}.
39
+ */
40
+ export type VectorIDStrategy = NonNullable<MJContentSourceEntity_IContentSourceConfiguration['VectorIDStrategy']>;
41
+ /**
42
+ * Whether an item always embeds as chunk rows (`'alwaysChunk'`) or embeds as a single item-level
43
+ * vector when it fits in one chunk (`'mixed'`). Derived from the generated JSONType interface.
44
+ */
45
+ export type ChunkTextStorage = NonNullable<MJContentSourceEntity_IContentSourceConfiguration['ChunkTextStorage']>;
46
+ /** Vector-metadata shaping config (field strategy, per-field rules, curated toggles). Derived from the generated JSONType interface. */
47
+ export type VectorMetadataConfig = NonNullable<MJContentSourceEntity_IContentSourceConfiguration['VectorMetadata']>;
48
+ /** Per-field vector-metadata rule (inclusion, truncation, StoreAs coercion). Derived from {@link VectorMetadataConfig}. */
49
+ export type VectorMetadataFieldConfig = NonNullable<VectorMetadataConfig['Fields']>[string];
50
+ /**
51
+ * Vector-storage behavior resolved for a single content item, derived from its ContentSource
52
+ * configuration (falling back to its ContentType defaults, then hardcoded defaults). Produced by
53
+ * {@link AutotagBaseEngine.resolveItemVectorStorageConfig}.
54
+ */
55
+ export interface ResolvedVectorStorageConfig {
56
+ vectorIDStrategy: VectorIDStrategy;
57
+ chunkTextStorage: ChunkTextStorage;
58
+ /** How vector metadata is shaped (undefined ⇒ the curated default set). */
59
+ metadata?: VectorMetadataConfig;
60
+ }
61
+ /**
62
+ * One embedding unit produced from a ContentItem: a slice of its text plus the id minted for the
63
+ * chunk up front. `chunkID` becomes BOTH the ContentItemChunk row's PK and its vector-DB id (under
64
+ * the 'recordId' strategy), so it is known at metadata-build time — which lets a chunk vector carry
65
+ * its own identity ({@link buildVectorMetadata}) even though the chunk row is written later.
66
+ */
67
+ export interface EmbeddingChunk {
68
+ item: MJContentItemEntity;
69
+ chunkIndex: number;
70
+ text: string;
71
+ chunkID: string;
72
+ }
73
+ /**
74
+ * A chunk whose vector has been upserted and is ready to be written as a ContentItemChunk row.
75
+ * `chunkID` becomes the row PK; `vectorRecordID` is the id the vector was actually stored under
76
+ * (equal to chunkID under 'recordId', a hash under 'hash').
77
+ */
78
+ export interface PersistedChunk {
79
+ chunkIndex: number;
80
+ text: string;
81
+ vectorRecordID: string;
82
+ chunkID: string;
83
+ }
84
+ /** Running tally for a PurgeDeletedChunks pass. */
85
+ export interface ChunkPurgeStats {
86
+ /** Chunks whose vector was removed from the store and row flipped to 'Deleted'. */
87
+ purged: number;
88
+ /** Chunks that could not be purged this run (left 'Pending', retried next run). */
89
+ failed: number;
90
+ /** Chunks with no VectorRecordID — nothing to remove remotely, marked 'Deleted' directly. */
91
+ skipped: number;
92
+ }
93
+ /** Running tally for an EmbedPendingChunks pass. */
94
+ export interface ChunkEmbedStats {
95
+ /** Chunks whose text was embedded, upserted, and row flipped to EmbeddingStatus='Complete'. */
96
+ embedded: number;
97
+ /** Chunks that could not be embedded this run (left 'Pending', retried next run). */
98
+ failed: number;
99
+ /** Chunks with empty/missing text or a missing parent — nothing to embed, left untouched. */
100
+ skipped: number;
101
+ }
7
102
  /**
8
103
  * Result of a vectorization operation, including counts and AIPromptRun IDs
9
104
  * for linking to ContentProcessRunDetail records.
@@ -190,10 +285,33 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
190
285
  saveLLMResults(LLMResults: JsonObject, contextUser: UserInfo): Promise<void>;
191
286
  deleteInvalidContentItem(contentItemID: string, contextUser: UserInfo): Promise<void>;
192
287
  /**
193
- * Chunks text using the shared TextChunker utility for token-aware splitting.
194
- * Falls back to simple character-based splitting when TextChunker is not available.
288
+ * Registration key of the segmentation strategy this engine uses.
289
+ *
290
+ * Defaults to `FixedWindow`, which reproduces the engine's historical token-window
291
+ * behavior exactly — routing through the strategy layer is a refactor, not a behavior
292
+ * change. Override in a subclass (or, once the config field lands, resolve it from the
293
+ * Content Source / Content Type `Configuration`) to opt into structure-aware
294
+ * (`StructuralText`), topic-aware (`SemanticText`), or transcript-based (`Transcript`)
295
+ * segmentation.
296
+ *
297
+ * @see [Content Segmentation Guide](../../../../../guides/CONTENT_SEGMENTATION_GUIDE.md)
298
+ */
299
+ protected resolveSegmenterKey(): string;
300
+ /**
301
+ * Run the resolved segmentation strategy over `text` and return its text payloads.
302
+ *
303
+ * Returns null when segmentation fails, so callers can apply their own fallback rather
304
+ * than silently embedding nothing.
305
+ */
306
+ protected segmentTextForChunking(text: string, options: FixedWindowSegmentationOptions): Promise<string[] | null>;
307
+ /**
308
+ * Chunks text for the LLM tagging pass, sized to the *tagging model's* context window.
309
+ *
310
+ * Note the budget here is deliberately independent of the embedding budget
311
+ * ({@link MAX_EMBEDDING_TOKENS}) — these two chunk sites feed different consumers and
312
+ * must not be collapsed into one call. Tagging chunks are transient and never persisted.
195
313
  */
196
- chunkExtractedText(text: string, tokenLimit: number): string[];
314
+ chunkExtractedText(text: string, tokenLimit: number): Promise<string[]>;
197
315
  /**
198
316
  * Simple character-based chunking as fallback
199
317
  */
@@ -340,9 +458,167 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
340
458
  */
341
459
  private buildChunksForBatch;
342
460
  /**
343
- * Build VectorRecord objects from embedding chunks and their corresponding vectors.
461
+ * Build VectorRecord objects from embedding chunks and their corresponding vectors. Resolves
462
+ * each item's storage config once and shares the item-level-vs-chunk decision between the
463
+ * vector id and the metadata so the two always agree.
464
+ */
465
+ protected buildVectorRecords(allChunks: EmbeddingChunk[], vectors: number[][], tagMap: Map<string, string[]>, infra: ResolvedVectorInfrastructure): VectorRecord[];
466
+ /**
467
+ * Build the single {@link VectorRecord} for one embedding chunk. Resolves the item's storage
468
+ * config, decides item-level-vs-chunk once, and shares that decision between the vector id and
469
+ * the metadata so the two always agree. `protected` so subclasses can override per-record
470
+ * shaping (id, metadata, or provider directives) without reimplementing the batch loop in
471
+ * {@link buildVectorRecords}.
472
+ *
473
+ * @param chunk The embedding unit (item slice + minted chunk id).
474
+ * @param vector The embedding produced for `chunk`.
475
+ * @param chunkCountForItem Total chunks produced for `chunk.item` this batch — drives the
476
+ * item-level-vs-chunk decision ({@link isItemLevelVector}).
477
+ * @param tags Resolved tag names for `chunk.item`, if any.
478
+ * @param contentItemEntity The 'MJ: Content Items' entity metadata, for display-field resolution.
479
+ * @param infra Resolved vector infrastructure (source of provider directives).
480
+ */
481
+ protected buildVectorRecord(chunk: EmbeddingChunk, vector: number[], chunkCountForItem: number, tags: string[] | undefined, contentItemEntity: EntityInfo | undefined, infra: ResolvedVectorInfrastructure): VectorRecord;
482
+ /**
483
+ * Compute a vector record's per-record provider directives (e.g. Pinecone namespace) from the
484
+ * source content item and the index's ProviderConfig. Returns undefined when the index has no
485
+ * ProviderConfig — the common case — so no provider routing is applied and the base
486
+ * BuildProviderDirectives is not even invoked. The item's full field set (GetAll) is handed to
487
+ * the driver so it can read whatever field its config names (e.g. `namespaceField: 'OrganizationID'`).
488
+ * Namespace is resolved from the parent ContentItem (org-level), the same source for a chunk's
489
+ * vector as for an item-level vector.
490
+ */
491
+ protected buildProviderDirectives(item: MJContentItemEntity, infra: ResolvedVectorInfrastructure): Record<string, unknown> | undefined;
492
+ /**
493
+ * Choose the vector-DB record id for one chunk based on the item's resolved config.
494
+ * - 'recordId' (default): the chunk's own id (chunkID), which is also the ContentItemChunk PK.
495
+ * Purge-safe — a re-chunk mints fresh ids, so a superseded chunk and its replacement never
496
+ * collide.
497
+ * - 'hash': deterministic. An item-level single vector uses the bare item hash; every other
498
+ * case uses a per-(item, chunkIndex) hash. Deterministic ⇒ unsafe with re-chunk + purge
499
+ * (documented on the config), but preserves 5.49 EntityDocument parity when opted into.
500
+ */
501
+ protected resolveChunkVectorID(chunk: EmbeddingChunk, config: ResolvedVectorStorageConfig, isItemLevel: boolean): string;
502
+ /**
503
+ * Persist the vector-database record identifiers produced during this batch back into MJ.
504
+ *
505
+ * Where the id lands is governed by the item's resolved {@link ChunkTextStorage}:
506
+ * - 'mixed' + single chunk: the item embeds as one vector, so its record id is stored directly
507
+ * on ContentItem.VectorRecordID (set in-memory here; persisted by the subsequent 'Complete'
508
+ * status Save so no extra write is needed).
509
+ * - 'alwaysChunk' (any chunk count) or 'mixed' multi-chunk: per-chunk provenance is recorded in
510
+ * ContentItemChunk rows (ContentItemID, Sequence, Text, VectorRecordID) and
511
+ * ContentItem.VectorRecordID is left null (the chunk table is the source of truth).
512
+ *
513
+ * `allChunks` and `records` are parallel arrays (buildVectorRecords maps 1:1), so
514
+ * records[i].id is the vector-DB id for allChunks[i]. Best-effort: a persistence failure
515
+ * for one item is logged but does not abort the batch — the vectors are already upserted.
516
+ */
517
+ private persistVectorReferences;
518
+ /**
519
+ * Supersede a content item's current (live) chunks with a freshly-embedded set: the live
520
+ * chunks are SOFT-deleted (DeleteStatus='Pending', rows kept) and the new chunks appended,
521
+ * atomically. A later PurgeDeletedChunks removes the superseded chunks' vectors from the
522
+ * 3rd-party store and flips them to 'Deleted'. Either the swap commits or it rolls back;
523
+ * on failure this throws and the caller (persistVectorReferences) logs it and moves on.
524
+ *
525
+ * Provider discipline (server, multi-user): the RunView read, the entity objects, and the
526
+ * transaction ALL go through `this.ProviderToUse` — the connection allocated to this request.
527
+ * A bare `new RunView()` would run on the process-global provider/connection, outside this
528
+ * transaction and under the wrong user's context.
529
+ */
530
+ private replaceContentItemChunks;
531
+ /**
532
+ * Build (in-memory only — no DB access) the replacement ContentItemChunk rows for an item.
533
+ * These rows are created only after the chunk's vector has been successfully embedded and
534
+ * upserted (see persistVectorReferences), so each row is stamped EmbeddingStatus='Complete'
535
+ * with LastEmbeddedAt=now — mirroring how the parent ContentItem is stamped on a successful
536
+ * embed. TaggingStatus is left at its 'Pending' default (chunks are not tagged individually;
537
+ * tagging happens at the Content Item level) and DeleteStatus is left null (not slated for
538
+ * deletion).
539
+ */
540
+ private buildChunkRows;
541
+ /**
542
+ * In one server-side transaction (SQL-only — no third-party calls): SOFT-delete the superseded
543
+ * live chunks (set DeleteStatus='Pending', keeping the rows) and insert the new chunks. Either
544
+ * the whole swap commits or it rolls back.
545
+ *
546
+ * The superseded chunks' vectors are removed from the vector database out-of-band by
547
+ * PurgeDeletedChunks, which batches the remote deletes to each provider's limits — a
548
+ * cross-system delete can't live inside this SQL transaction (it can't be rolled back if the
549
+ * remote store already applied it). Keeping the rows (soft delete) also preserves history and
550
+ * lets the vector purge be retried. There is no unique constraint on (ContentItemID, Sequence),
551
+ * so a superseded chunk and its replacement may share a Sequence until the old one is purged.
552
+ */
553
+ private commitChunkReplacement;
554
+ /**
555
+ * Actually remove chunks that have been soft-deleted (DeleteStatus='Pending'): delete their
556
+ * vectors from whatever 3rd-party vector store holds them, then flip the row to 'Deleted' with
557
+ * LastDeletedAt (the SQL row is kept as a tombstone). Bounded per run (maxItems) and per remote
558
+ * call (PURGE_VECTORDB_SUBBATCH) + rate-limited, so a large backlog or a single big re-chunk
559
+ * can't hammer the DB or the vector provider. Meant to run out-of-band from vectorization
560
+ * (on demand or scheduled).
561
+ *
562
+ * Ordering is delete-vector-first, then mark 'Deleted': if the run dies mid-way the chunk stays
563
+ * 'Pending' and is retried next run (at worst a redundant remote delete, which is idempotent for
564
+ * the vector stores we target).
565
+ *
566
+ * @returns counts of chunks purged (vector removed + marked Deleted), failed, and skipped
567
+ * (no VectorRecordID — marked Deleted directly, nothing to remove remotely).
568
+ */
569
+ PurgeDeletedChunks(contextUser: UserInfo, options?: {
570
+ maxItems?: number;
571
+ }): Promise<ChunkPurgeStats>;
572
+ /** Load soft-deleted chunks awaiting purge (bounded, oldest first). Returns [] on failure. */
573
+ private loadPendingChunks;
574
+ /** Load the parent Content Items for a set of chunks (needed for infra resolution). null on failure. */
575
+ private loadChunkParentItems;
576
+ /** Group chunks by their parent item's vector infrastructure and purge each group's vectors. */
577
+ private purgeChunksByInfrastructure;
578
+ /** Delete one infra group's chunk vectors in bounded sub-batches, then mark the rows Deleted. */
579
+ private purgeChunkGroup;
580
+ /** Remove a batch of chunk vectors from the vector DB (rate-limited). Returns whether it succeeded. */
581
+ private deleteChunkVectors;
582
+ /** Mark a soft-deleted chunk as fully Deleted (its vector already removed). Best-effort save. */
583
+ private markChunkDeleted;
584
+ /**
585
+ * (Re)embed persisted ContentItemChunk rows that are awaiting embedding
586
+ * (EmbeddingStatus='Pending' AND DeleteStatus IS NULL): embed each chunk's stored `.Text`,
587
+ * upsert the vector under the chunk's identity (see the Chunk-Identity Contract), then stamp
588
+ * the row EmbeddingStatus='Complete' with its VectorRecordID + LastEmbeddedAt. This is the
589
+ * migration path (backfill vectors for chunk rows created without them) and the recovery path
590
+ * (a chunk whose embed previously failed stays 'Pending' and is retried).
591
+ *
592
+ * Bounded per run by `maxItems` and per embed/upsert call by CHUNK_EMBED_SUBBATCH + rate-limited,
593
+ * so a large backlog drains over several runs rather than hammering the API or vector store.
594
+ * Meant to run out-of-band from live vectorization (on demand or scheduled). Best-effort per
595
+ * chunk — a failure leaves the row 'Pending' (retried next run) and never aborts the pass.
596
+ *
597
+ * @returns counts of chunks embedded, failed, and skipped (empty text / missing parent).
598
+ */
599
+ EmbedPendingChunks(contextUser: UserInfo, options?: {
600
+ maxItems?: number;
601
+ }): Promise<ChunkEmbedStats>;
602
+ /** Load chunks awaiting embedding (bounded, oldest first). Returns [] on failure. */
603
+ private loadPendingEmbeddingChunks;
604
+ /**
605
+ * Group pending chunks by their parent item's vector infrastructure (embedding model + index)
606
+ * and embed each group. Mirrors purgeChunksByInfrastructure so the two share the same
607
+ * chunk → parent-item → infrastructure resolution.
608
+ */
609
+ private embedChunksByInfrastructure;
610
+ /** Embed + upsert one infra group's chunks in bounded sub-batches, then stamp each row Complete. */
611
+ private embedChunkGroup;
612
+ /**
613
+ * Pair each persisted chunk with its parent item as an {@link EmbeddingChunk} (chunkID = the
614
+ * chunk's existing PK, so the vector id + metadata identity match the live write path). Chunks
615
+ * with empty text or a missing parent are counted as skipped and dropped.
344
616
  */
345
- private buildVectorRecords;
617
+ private toEmbeddableChunks;
618
+ /** Embed one sub-batch's texts, upsert the vectors, and stamp each surviving chunk row Complete. */
619
+ private embedAndPersistChunkBatch;
620
+ /** Stamp a chunk row as embedded: record its vector id, flip to Complete, timestamp. Best-effort. */
621
+ private markChunkEmbedded;
346
622
  /**
347
623
  * Upsert vector records to the vector database in sub-batches with rate limiting.
348
624
  * Returns true if all sub-batches succeeded.
@@ -380,10 +656,19 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
380
656
  */
381
657
  private getDefaultVectorInfrastructure;
382
658
  /**
383
- * Shared helper: given vector index details and embedding model ID, resolve all
384
- * driver instances needed for embedding + upsert. Uses AIEngine for Vector Databases.
659
+ * Shared helper: given a VectorIndex and embedding model ID, resolve all driver instances
660
+ * needed for embedding + upsert, plus the index's Dimensions / parsed ProviderConfig (so the
661
+ * embed call and the upsert can honor reduced dimensions and provider routing). Uses AIEngine
662
+ * for Vector Databases.
385
663
  */
386
664
  private createInfrastructureFromIndex;
665
+ /**
666
+ * Parse a VectorIndex's ProviderConfig JSON blob into an object for provider-specific routing
667
+ * (e.g. Pinecone's namespaceField). Mirrors the entity-vectorization pipeline's helper. Returns
668
+ * undefined for null/empty/invalid JSON — a bad blob is logged and treated as "no config" so it
669
+ * never blocks vectorization.
670
+ */
671
+ private parseProviderConfig;
387
672
  /** Find an embedding model by ID in AIEngine, with helpful error reporting */
388
673
  private findEmbeddingModel;
389
674
  /** Create a BaseEmbeddings instance for a given driver class */
@@ -391,7 +676,28 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
391
676
  /** Create a VectorDBBase instance for a given class key */
392
677
  private createVectorDBInstance;
393
678
  /** SHA-1 deterministic vector ID for a content item */
394
- private contentItemVectorId;
679
+ private contentItemVectorID;
680
+ /**
681
+ * SHA-1 deterministic vector ID for a specific chunk of a content item, used only by the
682
+ * 'hash' {@link VectorIDStrategy} for multi-chunk items. It is deterministic on
683
+ * (contentItemId, chunkIndex), which is exactly what makes 'hash' unsafe with re-chunk +
684
+ * purge — a re-chunk that produces the same index reuses the id (documented on the config).
685
+ */
686
+ private contentItemChunkVectorID;
687
+ /**
688
+ * Resolve the vector-storage behavior for a content item using the cascade:
689
+ * ContentSource override -> ContentType default -> hardcoded default. Reads the strongly-typed
690
+ * ConfigurationObject accessors emitted by CodeGen for each entity's Configuration JSONType.
691
+ */
692
+ protected resolveItemVectorStorageConfig(item: MJContentItemEntity): ResolvedVectorStorageConfig;
693
+ /**
694
+ * True when this item's single embedding vector is stored at the ContentItem level (on
695
+ * ContentItem.VectorRecordID) rather than in a ContentItemChunk row. Only the 'mixed'
696
+ * storage mode does this, and only when the item produced exactly one chunk; 'alwaysChunk'
697
+ * always writes a chunk row (item-level id stays null). buildVectorRecords and
698
+ * persistVectorReferences share this predicate so the vector id and its persistence agree.
699
+ */
700
+ protected isItemLevelVector(config: ResolvedVectorStorageConfig, chunkCount: number): boolean;
395
701
  /** Build the text that gets embedded: Title + Description + full Text */
396
702
  /**
397
703
  * Max tokens per embedding chunk. text-embedding-3-small supports 8,191 tokens.
@@ -403,8 +709,55 @@ export declare class AutotagBaseEngine extends BaseEngine<AutotagBaseEngine> {
403
709
  * the embedding model's token limit. Returns one or more text chunks.
404
710
  */
405
711
  private buildEmbeddingChunks;
406
- /** Build metadata stored alongside the vector — truncate large text fields */
407
- private buildVectorMetadata;
712
+ /**
713
+ * Build the metadata object stored alongside the vector. Mirrors the entity-vectorization
714
+ * pipeline's decomposed shape ({@link addContentSystemMetadata}/{@link addCuratedMetadata}/
715
+ * {@link addStrategyDisplayFields}/{@link addEntityIconMetadata}/{@link addUpdatedAtMetadata}/
716
+ * {@link addTagsMetadata}) so each concern can be overridden independently.
717
+ *
718
+ * `VectorMetadata.FieldStrategy` selects the field set:
719
+ * - unset ⇒ the curated content default (source ids + Title / Description / URL), preserving
720
+ * historical behavior.
721
+ * - 'all' / 'include' / 'exclude' / 'explicit' ⇒ ContentItem fields resolved by
722
+ * {@link getContentDisplayFields}, with per-field StoreAs coercion + truncation.
723
+ *
724
+ * The identity keys are chunk-aware (see the Chunk-Identity Contract); under 'explicit' only
725
+ * `Entity` is kept so content search results stay labeled (record id is recovered from the
726
+ * vector id under the default 'recordId' strategy).
727
+ */
728
+ protected buildVectorMetadata(chunk: EmbeddingChunk, isItemLevel: boolean, tags: string[] | undefined, config: ResolvedVectorStorageConfig, contentItemEntity: EntityInfo | undefined): Record<string, string | number | boolean | string[]>;
729
+ /**
730
+ * Add the identity/system keys. `Entity` is always present (chunk-aware). Under 'explicit' the
731
+ * rest are omitted (minimal metadata); otherwise `RecordID` — plus `ContentItemID` / `Sequence`
732
+ * for chunk vectors — are included so an external hydrator can fetch the row(s).
733
+ */
734
+ private addContentSystemMetadata;
735
+ /** The curated default content metadata set (historical behavior when no FieldStrategy is set). */
736
+ private addCuratedMetadata;
737
+ /** Add the strategy-selected ContentItem fields, with per-field StoreAs coercion + truncation. */
738
+ private addStrategyDisplayFields;
739
+ /**
740
+ * Resolve which ContentItem fields go into metadata for the configured strategy. Mirrors the
741
+ * entity pipeline: 'include'/'explicit' take only fields explicitly marked Included (candidate
742
+ * set is the full field list; only unstorable binary types are refused); 'all'/'exclude' take
743
+ * the conservative eligible set (no PKs, uniqueidentifiers, binary, or __mj_* fields) minus any
744
+ * marked Included:false.
745
+ */
746
+ private getContentDisplayFields;
747
+ /** Store one field's value with its configured/typed coercion (epoch/number/boolean/UUID/string). */
748
+ private setCoercedFieldValue;
749
+ /** Per-field truncation: explicit override → field MaxLength (if small) → global default. */
750
+ private resolveMetadataTruncationLimit;
751
+ /** Add the content entity's icon: default on under a set strategy, opt-in under 'explicit'. */
752
+ private addEntityIconMetadata;
753
+ /** Add __mj_UpdatedAt for recency: default on under a set strategy, opt-in under 'explicit'. */
754
+ private addUpdatedAtMetadata;
755
+ /**
756
+ * Add the item's Tags array. Tags aren't a ContentItem field (they're derived), so they're a
757
+ * toggle like icon/updatedAt: on by default (and under the curated default), opt-in under
758
+ * 'explicit'.
759
+ */
760
+ private addTagsMetadata;
408
761
  /** Load all tags for the given items in a single RunView call */
409
762
  private loadTagsForItems;
410
763
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AutotagBaseEngine.d.ts","sourceRoot":"","sources":["../../../src/Engine/generic/AutotagBaseEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAqB,QAAQ,EAAuB,MAAM,sBAAsB,CAAA;AAEhJ,OAAO,EACH,qBAAqB,EAAE,mBAAmB,EAAE,uBAAuB,EACnE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