@absolutejs/absolute 0.19.0-beta.637 → 0.19.0-beta.638

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/dist/ai/index.js CHANGED
@@ -749,7 +749,7 @@ var formatLeadMediaCueSummary = (input) => {
749
749
  return parts.length > 0 ? parts.join(" \xB7 ") : "none";
750
750
  };
751
751
  var formatRAGTraceMetadataRow = (key, value) => ({
752
- label: key === "sqliteQueryMode" ? "SQLite query mode" : key === "postgresQueryMode" ? "Postgres query mode" : key === "sqliteQueryPushdownMode" ? "SQLite pushdown mode" : key === "postgresQueryPushdownMode" ? "Postgres pushdown mode" : key === "sqliteQueryPushdownApplied" ? "SQLite pushdown applied" : key === "postgresQueryPushdownApplied" ? "Postgres pushdown applied" : key === "sqliteQueryPushdownClauseCount" ? "SQLite pushdown clauses" : key === "postgresQueryPushdownClauseCount" ? "Postgres pushdown clauses" : key === "sqliteQueryPushdownCoverageRatio" ? "SQLite pushdown coverage" : key === "postgresQueryPushdownCoverageRatio" ? "Postgres pushdown coverage" : key === "sqliteQueryTotalFilterClauseCount" ? "SQLite total filter clauses" : key === "postgresQueryTotalFilterClauseCount" ? "Postgres total filter clauses" : key === "sqliteQueryJsRemainderClauseCount" ? "SQLite JS remainder clauses" : key === "sqliteQueryMultiplierUsed" ? "SQLite query multiplier" : key === "sqliteQueryCandidateLimitUsed" ? "SQLite candidate limit" : key === "sqliteQueryMaxBackfillsUsed" ? "SQLite max backfills" : key === "sqliteQueryMinResultsUsed" ? "SQLite min results" : key === "sqliteQueryFillPolicyUsed" ? "SQLite fill policy" : key === "postgresQueryJsRemainderClauseCount" ? "Postgres JS remainder clauses" : key === "postgresQueryMultiplierUsed" ? "Postgres query multiplier" : key === "postgresQueryCandidateLimitUsed" ? "Postgres candidate limit" : key === "postgresQueryMaxBackfillsUsed" ? "Postgres max backfills" : key === "postgresQueryMinResultsUsed" ? "Postgres min results" : key === "postgresQueryFillPolicyUsed" ? "Postgres fill policy" : key === "sqliteQueryJsRemainderRatio" ? "SQLite JS remainder share" : key === "postgresQueryJsRemainderRatio" ? "Postgres JS remainder share" : key === "sqliteQueryFilteredCandidates" ? "SQLite filtered candidates" : key === "postgresQueryFilteredCandidates" ? "Postgres filtered candidates" : key === "sqliteQueryInitialSearchK" ? "SQLite initial searchK" : key === "postgresQueryInitialSearchK" ? "Postgres initial searchK" : key === "sqliteQueryFinalSearchK" ? "SQLite final searchK" : key === "postgresQueryFinalSearchK" ? "Postgres final searchK" : key === "sqliteQuerySearchExpansionRatio" ? "SQLite search expansion" : key === "postgresQuerySearchExpansionRatio" ? "Postgres search expansion" : key === "sqliteQueryBackfillCount" ? "SQLite backfill count" : key === "sqliteQueryBackfillLimitReached" ? "SQLite backfill limit reached" : key === "sqliteQueryMinResultsSatisfied" ? "SQLite min results satisfied" : key === "postgresQueryBackfillCount" ? "Postgres backfill count" : key === "postgresQueryBackfillLimitReached" ? "Postgres backfill limit reached" : key === "postgresQueryMinResultsSatisfied" ? "Postgres min results satisfied" : key === "sqliteQueryReturnedCount" ? "SQLite returned hits" : key === "postgresQueryReturnedCount" ? "Postgres returned hits" : key === "sqliteQueryCandidateYieldRatio" ? "SQLite candidate yield" : key === "postgresQueryCandidateYieldRatio" ? "Postgres candidate yield" : key === "sqliteQueryTopKFillRatio" ? "SQLite topK fill rate" : key === "postgresQueryTopKFillRatio" ? "Postgres topK fill rate" : key === "sqliteQueryUnderfilledTopK" ? "SQLite underfilled topK" : key === "postgresQueryUnderfilledTopK" ? "Postgres underfilled topK" : key === "sqliteQueryCandidateBudgetExhausted" ? "SQLite candidate budget exhausted" : key === "postgresQueryCandidateBudgetExhausted" ? "Postgres candidate budget exhausted" : key === "sqliteQueryCandidateCoverage" ? "SQLite candidate coverage" : key === "postgresQueryCandidateCoverage" ? "Postgres candidate coverage" : key === "leadSpeakerCue" ? "Lead speaker cue" : key === "leadSpeakerAttributionCue" ? "Lead speaker attribution" : key === "leadChannelAttributionCue" ? "Lead channel attribution" : key === "leadChannelCue" ? "Lead channel cue" : key === "leadContinuityCue" ? "Lead continuity cue" : key,
752
+ label: key === "sqliteQueryMode" ? "SQLite query mode" : key === "postgresQueryMode" ? "Postgres query mode" : key === "sqliteQueryPushdownMode" ? "SQLite pushdown mode" : key === "postgresQueryPushdownMode" ? "Postgres pushdown mode" : key === "sqliteQueryPushdownApplied" ? "SQLite pushdown applied" : key === "postgresQueryPushdownApplied" ? "Postgres pushdown applied" : key === "sqliteQueryPushdownClauseCount" ? "SQLite pushdown clauses" : key === "postgresQueryPushdownClauseCount" ? "Postgres pushdown clauses" : key === "sqliteQueryPushdownCoverageRatio" ? "SQLite pushdown coverage" : key === "postgresQueryPushdownCoverageRatio" ? "Postgres pushdown coverage" : key === "sqliteQueryTotalFilterClauseCount" ? "SQLite total filter clauses" : key === "postgresQueryTotalFilterClauseCount" ? "Postgres total filter clauses" : key === "sqliteQueryJsRemainderClauseCount" ? "SQLite JS remainder clauses" : key === "sqliteQueryMultiplierUsed" ? "SQLite query multiplier" : key === "sqliteQueryPlannerProfileUsed" ? "SQLite query profile" : key === "sqliteQueryCandidateLimitUsed" ? "SQLite candidate limit" : key === "sqliteQueryMaxBackfillsUsed" ? "SQLite max backfills" : key === "sqliteQueryMinResultsUsed" ? "SQLite min results" : key === "sqliteQueryFillPolicyUsed" ? "SQLite fill policy" : key === "postgresQueryJsRemainderClauseCount" ? "Postgres JS remainder clauses" : key === "postgresQueryMultiplierUsed" ? "Postgres query multiplier" : key === "postgresQueryPlannerProfileUsed" ? "Postgres query profile" : key === "postgresQueryCandidateLimitUsed" ? "Postgres candidate limit" : key === "postgresQueryMaxBackfillsUsed" ? "Postgres max backfills" : key === "postgresQueryMinResultsUsed" ? "Postgres min results" : key === "postgresQueryFillPolicyUsed" ? "Postgres fill policy" : key === "sqliteQueryJsRemainderRatio" ? "SQLite JS remainder share" : key === "postgresQueryJsRemainderRatio" ? "Postgres JS remainder share" : key === "sqliteQueryFilteredCandidates" ? "SQLite filtered candidates" : key === "postgresQueryFilteredCandidates" ? "Postgres filtered candidates" : key === "sqliteQueryInitialSearchK" ? "SQLite initial searchK" : key === "postgresQueryInitialSearchK" ? "Postgres initial searchK" : key === "sqliteQueryFinalSearchK" ? "SQLite final searchK" : key === "postgresQueryFinalSearchK" ? "Postgres final searchK" : key === "sqliteQuerySearchExpansionRatio" ? "SQLite search expansion" : key === "postgresQuerySearchExpansionRatio" ? "Postgres search expansion" : key === "sqliteQueryBackfillCount" ? "SQLite backfill count" : key === "sqliteQueryBackfillLimitReached" ? "SQLite backfill limit reached" : key === "sqliteQueryMinResultsSatisfied" ? "SQLite min results satisfied" : key === "postgresQueryBackfillCount" ? "Postgres backfill count" : key === "postgresQueryBackfillLimitReached" ? "Postgres backfill limit reached" : key === "postgresQueryMinResultsSatisfied" ? "Postgres min results satisfied" : key === "sqliteQueryReturnedCount" ? "SQLite returned hits" : key === "postgresQueryReturnedCount" ? "Postgres returned hits" : key === "sqliteQueryCandidateYieldRatio" ? "SQLite candidate yield" : key === "postgresQueryCandidateYieldRatio" ? "Postgres candidate yield" : key === "sqliteQueryTopKFillRatio" ? "SQLite topK fill rate" : key === "postgresQueryTopKFillRatio" ? "Postgres topK fill rate" : key === "sqliteQueryUnderfilledTopK" ? "SQLite underfilled topK" : key === "postgresQueryUnderfilledTopK" ? "Postgres underfilled topK" : key === "sqliteQueryCandidateBudgetExhausted" ? "SQLite candidate budget exhausted" : key === "postgresQueryCandidateBudgetExhausted" ? "Postgres candidate budget exhausted" : key === "sqliteQueryCandidateCoverage" ? "SQLite candidate coverage" : key === "postgresQueryCandidateCoverage" ? "Postgres candidate coverage" : key === "leadSpeakerCue" ? "Lead speaker cue" : key === "leadSpeakerAttributionCue" ? "Lead speaker attribution" : key === "leadChannelAttributionCue" ? "Lead channel attribution" : key === "leadChannelCue" ? "Lead channel cue" : key === "leadContinuityCue" ? "Lead continuity cue" : key,
753
753
  value: key === "sourceAwareChunkReason" ? formatSourceAwareChunkReason(value) ?? formatRAGTraceValue(value) : key === "leadSpeakerAttributionCue" ? formatLeadSpeakerAttributionCue(value) ?? formatRAGTraceValue(value) : key === "leadChannelAttributionCue" ? formatLeadChannelAttributionCue(value) ?? formatRAGTraceValue(value) : key === "leadContinuityCue" ? formatLeadContinuityCue(value) ?? formatRAGTraceValue(value) : formatRAGTraceValue(value)
754
754
  });
755
755
  var buildRAGRetrievalTracePresentation = (trace) => {
@@ -2521,6 +2521,7 @@ var formatSQLitePlannerCueSummary = (input) => {
2521
2521
  typeof input?.sqliteQueryPushdownClauseCount === "number" ? `clauses ${input.sqliteQueryPushdownClauseCount}` : undefined,
2522
2522
  typeof input?.sqliteQueryPushdownCoverageRatio === "number" ? `pushdown ${(input.sqliteQueryPushdownCoverageRatio * 100).toFixed(0)}%` : undefined,
2523
2523
  typeof input?.sqliteQueryJsRemainderClauseCount === "number" ? `js remainder ${input.sqliteQueryJsRemainderClauseCount}` : undefined,
2524
+ input?.sqliteQueryPlannerProfileUsed ? `profile ${input.sqliteQueryPlannerProfileUsed}` : undefined,
2524
2525
  typeof input?.sqliteQueryMultiplierUsed === "number" ? `x${input.sqliteQueryMultiplierUsed}` : undefined,
2525
2526
  typeof input?.sqliteQueryCandidateLimitUsed === "number" ? `cap ${input.sqliteQueryCandidateLimitUsed}` : undefined,
2526
2527
  typeof input?.sqliteQueryMaxBackfillsUsed === "number" ? `backfills ${input.sqliteQueryMaxBackfillsUsed}` : undefined,
@@ -2553,6 +2554,7 @@ var formatPostgresPlannerCueSummary = (input) => {
2553
2554
  typeof input?.postgresQueryPushdownClauseCount === "number" ? `clauses ${input.postgresQueryPushdownClauseCount}` : undefined,
2554
2555
  typeof input?.postgresQueryPushdownCoverageRatio === "number" ? `pushdown ${(input.postgresQueryPushdownCoverageRatio * 100).toFixed(0)}%` : undefined,
2555
2556
  typeof input?.postgresQueryJsRemainderClauseCount === "number" ? `js remainder ${input.postgresQueryJsRemainderClauseCount}` : undefined,
2557
+ input?.postgresQueryPlannerProfileUsed ? `profile ${input.postgresQueryPlannerProfileUsed}` : undefined,
2556
2558
  typeof input?.postgresQueryMultiplierUsed === "number" ? `x${input.postgresQueryMultiplierUsed}` : undefined,
2557
2559
  typeof input?.postgresQueryCandidateLimitUsed === "number" ? `cap ${input.postgresQueryCandidateLimitUsed}` : undefined,
2558
2560
  typeof input?.postgresQueryMaxBackfillsUsed === "number" ? `backfills ${input.postgresQueryMaxBackfillsUsed}` : undefined,
@@ -16662,6 +16664,37 @@ var prepareRAGDirectoryDocuments = async (input) => prepareRAGDocuments(await lo
16662
16664
 
16663
16665
  // src/ai/rag/collection.ts
16664
16666
  var DEFAULT_TOP_K2 = 6;
16667
+ var resolveNativeQueryProfile = (input) => {
16668
+ if (!input.profile) {
16669
+ return;
16670
+ }
16671
+ if (input.profile === "latency") {
16672
+ return {
16673
+ candidateLimit: Math.max(1, Math.min(input.candidateTopK, input.topK)),
16674
+ fillPolicy: "satisfy_min_results",
16675
+ maxBackfills: 0,
16676
+ minResults: 1,
16677
+ plannerProfile: input.profile,
16678
+ queryMultiplier: 1
16679
+ };
16680
+ }
16681
+ if (input.profile === "recall") {
16682
+ return {
16683
+ fillPolicy: "strict_topk",
16684
+ maxBackfills: 4,
16685
+ minResults: input.topK,
16686
+ plannerProfile: input.profile,
16687
+ queryMultiplier: 8
16688
+ };
16689
+ }
16690
+ return {
16691
+ fillPolicy: "satisfy_min_results",
16692
+ maxBackfills: 1,
16693
+ minResults: Math.max(1, Math.min(input.topK, Math.ceil(input.topK / 2))),
16694
+ plannerProfile: input.profile,
16695
+ queryMultiplier: 4
16696
+ };
16697
+ };
16665
16698
  var VARIANT_RESULT_WEIGHT = 0.92;
16666
16699
  var normalizeTraceCueText = (value) => value.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim().replace(/\s+/g, " ");
16667
16700
  var queryIncludesTraceCue = (query, value) => {
@@ -16991,6 +17024,7 @@ var buildStoreQueryPlanTraceMetadata = (store) => {
16991
17024
  sqliteQueryTotalFilterClauseCount: sqliteNativePlan.totalFilterClauseCount,
16992
17025
  sqliteQueryJsRemainderClauseCount: sqliteNativePlan.jsRemainderClauseCount,
16993
17026
  sqliteQueryMultiplierUsed: sqliteNativePlan.queryMultiplierUsed ?? null,
17027
+ sqliteQueryPlannerProfileUsed: sqliteNativePlan.plannerProfileUsed ?? null,
16994
17028
  sqliteQueryCandidateLimitUsed: sqliteNativePlan.candidateLimitUsed ?? null,
16995
17029
  sqliteQueryMaxBackfillsUsed: sqliteNativePlan.maxBackfillsUsed ?? null,
16996
17030
  sqliteQueryMinResultsUsed: sqliteNativePlan.minResultsUsed ?? null,
@@ -17024,6 +17058,7 @@ var buildStoreQueryPlanTraceMetadata = (store) => {
17024
17058
  postgresQueryTotalFilterClauseCount: postgresNativePlan.totalFilterClauseCount,
17025
17059
  postgresQueryJsRemainderClauseCount: postgresNativePlan.jsRemainderClauseCount,
17026
17060
  postgresQueryMultiplierUsed: postgresNativePlan.queryMultiplierUsed ?? null,
17061
+ postgresQueryPlannerProfileUsed: postgresNativePlan.plannerProfileUsed ?? null,
17027
17062
  postgresQueryCandidateLimitUsed: postgresNativePlan.candidateLimitUsed ?? null,
17028
17063
  postgresQueryMaxBackfillsUsed: postgresNativePlan.maxBackfillsUsed ?? null,
17029
17064
  postgresQueryMinResultsUsed: postgresNativePlan.minResultsUsed ?? null,
@@ -17154,6 +17189,11 @@ var createRAGCollection = (options) => {
17154
17189
  });
17155
17190
  }
17156
17191
  const resultGroups = await Promise.all(searchQueries.map(async (query, queryIndex) => {
17192
+ const nativeQueryProfile = resolveNativeQueryProfile({
17193
+ candidateTopK,
17194
+ profile: input.nativeQueryProfile,
17195
+ topK
17196
+ });
17157
17197
  const [vectorResults2, lexicalResults2] = await Promise.all([
17158
17198
  runVector ? embed({
17159
17199
  model,
@@ -17161,11 +17201,12 @@ var createRAGCollection = (options) => {
17161
17201
  text: query
17162
17202
  }, "query").then((nextQueryVector) => options.store.query({
17163
17203
  filter: input.filter,
17164
- candidateLimit: input.nativeCandidateLimit,
17165
- fillPolicy: input.nativeFillPolicy,
17166
- maxBackfills: input.nativeMaxBackfills,
17167
- minResults: input.nativeMinResults,
17168
- queryMultiplier: input.nativeQueryMultiplier,
17204
+ candidateLimit: input.nativeCandidateLimit ?? nativeQueryProfile?.candidateLimit,
17205
+ fillPolicy: input.nativeFillPolicy ?? nativeQueryProfile?.fillPolicy,
17206
+ maxBackfills: input.nativeMaxBackfills ?? nativeQueryProfile?.maxBackfills,
17207
+ minResults: input.nativeMinResults ?? nativeQueryProfile?.minResults,
17208
+ plannerProfile: nativeQueryProfile?.plannerProfile,
17209
+ queryMultiplier: input.nativeQueryMultiplier ?? nativeQueryProfile?.queryMultiplier,
17169
17210
  queryVector: nextQueryVector,
17170
17211
  topK: candidateTopK
17171
17212
  })) : Promise.resolve([]),
@@ -22155,6 +22196,7 @@ var ragChat = (config) => {
22155
22196
  }
22156
22197
  const input = {
22157
22198
  filter: getObjectProperty(body, "filter"),
22199
+ nativeQueryProfile: body.nativeQueryProfile === "latency" || body.nativeQueryProfile === "balanced" || body.nativeQueryProfile === "recall" ? body.nativeQueryProfile : undefined,
22158
22200
  nativeCandidateLimit: typeof body.nativeCandidateLimit === "number" ? body.nativeCandidateLimit : undefined,
22159
22201
  nativeMaxBackfills: typeof body.nativeMaxBackfills === "number" ? body.nativeMaxBackfills : undefined,
22160
22202
  nativeMinResults: typeof body.nativeMinResults === "number" ? body.nativeMinResults : undefined,
@@ -29216,6 +29258,7 @@ var updatePostgresLastQueryPlan = (input) => {
29216
29258
  maxBackfillsUsed: input.maxBackfillsUsed,
29217
29259
  minResultsUsed: input.minResultsUsed,
29218
29260
  fillPolicyUsed: input.fillPolicyUsed,
29261
+ plannerProfileUsed: input.plannerProfileUsed,
29219
29262
  jsRemainderClauseCount: pushdown.jsRemainderClauseCount,
29220
29263
  queryMultiplierUsed: input.queryMultiplierUsed,
29221
29264
  jsRemainderRatio: pushdown.jsRemainderRatio,
@@ -29404,6 +29447,7 @@ var createPostgresRAGStore = (options = {}) => {
29404
29447
  maxBackfillsUsed: maxBackfills,
29405
29448
  minResultsUsed: minResults,
29406
29449
  fillPolicyUsed: fillTarget.fillPolicy,
29450
+ plannerProfileUsed: input.plannerProfile,
29407
29451
  filter: input.filter,
29408
29452
  pushdownFilter,
29409
29453
  queryMultiplierUsed: queryMultiplier2,
@@ -30225,6 +30269,7 @@ var updateSQLiteLastQueryPlan = (input) => {
30225
30269
  initialSearchK: input.initialSearchK,
30226
30270
  searchExpansionRatio: typeof input.initialSearchK === "number" && typeof input.finalSearchK === "number" && input.initialSearchK > 0 ? input.finalSearchK / input.initialSearchK : undefined,
30227
30271
  jsRemainderClauseCount: pushdown.jsRemainderClauseCount,
30272
+ plannerProfileUsed: input.plannerProfileUsed,
30228
30273
  candidateLimitUsed: input.candidateLimitUsed,
30229
30274
  maxBackfillsUsed: input.maxBackfillsUsed,
30230
30275
  minResultsUsed: input.minResultsUsed,
@@ -30376,6 +30421,7 @@ var createSQLiteRAGStore = (options = {}) => {
30376
30421
  initialSearchK: rawRows.length,
30377
30422
  nativeDiagnostics,
30378
30423
  pushdownFilter,
30424
+ plannerProfileUsed: input.plannerProfile,
30379
30425
  queryMultiplierUsed: input.queryMultiplier,
30380
30426
  queryMode: "json_fallback",
30381
30427
  returnedCount: limited.length,
@@ -30482,6 +30528,7 @@ var createSQLiteRAGStore = (options = {}) => {
30482
30528
  initialSearchK: searchK,
30483
30529
  nativeDiagnostics,
30484
30530
  pushdownFilter,
30531
+ plannerProfileUsed: input.plannerProfile,
30485
30532
  candidateLimitUsed: candidateLimit,
30486
30533
  maxBackfillsUsed: maxBackfills,
30487
30534
  minResultsUsed: minResults,
@@ -32657,5 +32704,5 @@ export {
32657
32704
  addRAGEvaluationSuiteCase
32658
32705
  };
32659
32706
 
32660
- //# debugId=690A2FC8A2432BC964756E2164756E21
32707
+ //# debugId=BF014C168CA3DA5064756E2164756E21
32661
32708
  //# sourceMappingURL=index.js.map