@retrivora-ai/rag-engine 0.3.7 → 0.3.9

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MongoDBProvider
3
- } from "./chunk-DESUAKF3.mjs";
3
+ } from "./chunk-DMXS64U2.mjs";
4
4
  import "./chunk-IMP6FUCY.mjs";
5
5
  import "./chunk-FWCSY2DS.mjs";
6
6
  export {
@@ -1079,7 +1079,6 @@ ${context}`;
1079
1079
  }
1080
1080
  async batchEmbed(texts, options) {
1081
1081
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1082
- const vectors = [];
1083
1082
  const model = this.sanitizeModel(
1084
1083
  (_c = (_b = options == null ? void 0 : options.model) != null ? _b : (_a = this.embeddingConfig) == null ? void 0 : _a.model) != null ? _c : "text-embedding-004"
1085
1084
  );
@@ -1379,7 +1378,7 @@ var ProviderRegistry = class {
1379
1378
  return new PostgreSQLProvider(config);
1380
1379
  }
1381
1380
  case "mongodb": {
1382
- const { MongoDBProvider } = await import("./MongoDBProvider-6X5F5YZS.mjs");
1381
+ const { MongoDBProvider } = await import("./MongoDBProvider-AJYTFXQA.mjs");
1383
1382
  return new MongoDBProvider(config);
1384
1383
  }
1385
1384
  case "milvus": {
@@ -56,7 +56,7 @@ var MongoDBProvider = class extends BaseVectorProvider {
56
56
  const pipeline = [
57
57
  {
58
58
  $vectorSearch: __spreadValues({
59
- index: this.config.options.indexName || "vector_index",
59
+ index: this.config.indexName || "vector_index",
60
60
  path: this.embeddingKey,
61
61
  queryVector: vector,
62
62
  numCandidates: Math.max(topK * 10, 100),
@@ -94,6 +94,7 @@ var MongoDBProvider = class extends BaseVectorProvider {
94
94
  const sanitized = super.sanitizeFilter(filter);
95
95
  const mongoFilter = {};
96
96
  for (const [key, value] of Object.entries(sanitized)) {
97
+ if (key.startsWith("__")) continue;
97
98
  if (key === "namespace") {
98
99
  mongoFilter[key] = value;
99
100
  } else {
@@ -424,7 +424,7 @@ var init_MongoDBProvider = __esm({
424
424
  const pipeline = [
425
425
  {
426
426
  $vectorSearch: __spreadValues({
427
- index: this.config.options.indexName || "vector_index",
427
+ index: this.config.indexName || "vector_index",
428
428
  path: this.embeddingKey,
429
429
  queryVector: vector,
430
430
  numCandidates: Math.max(topK * 10, 100),
@@ -462,6 +462,7 @@ var init_MongoDBProvider = __esm({
462
462
  const sanitized = super.sanitizeFilter(filter);
463
463
  const mongoFilter = {};
464
464
  for (const [key, value] of Object.entries(sanitized)) {
465
+ if (key.startsWith("__")) continue;
465
466
  if (key === "namespace") {
466
467
  mongoFilter[key] = value;
467
468
  } else {
@@ -2273,7 +2274,6 @@ ${context}`;
2273
2274
  }
2274
2275
  async batchEmbed(texts, options) {
2275
2276
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2276
- const vectors = [];
2277
2277
  const model = this.sanitizeModel(
2278
2278
  (_c = (_b = options == null ? void 0 : options.model) != null ? _b : (_a = this.embeddingConfig) == null ? void 0 : _a.model) != null ? _c : "text-embedding-004"
2279
2279
  );
@@ -3,7 +3,7 @@ import {
3
3
  createHealthHandler,
4
4
  createIngestHandler,
5
5
  createUploadHandler
6
- } from "../chunk-TYZC74CO.mjs";
6
+ } from "../chunk-3DU2ASYU.mjs";
7
7
  import "../chunk-EDLTMSNY.mjs";
8
8
  import "../chunk-FWCSY2DS.mjs";
9
9
  export {
package/dist/server.js CHANGED
@@ -436,7 +436,7 @@ var init_MongoDBProvider = __esm({
436
436
  const pipeline = [
437
437
  {
438
438
  $vectorSearch: __spreadValues({
439
- index: this.config.options.indexName || "vector_index",
439
+ index: this.config.indexName || "vector_index",
440
440
  path: this.embeddingKey,
441
441
  queryVector: vector,
442
442
  numCandidates: Math.max(topK * 10, 100),
@@ -474,6 +474,7 @@ var init_MongoDBProvider = __esm({
474
474
  const sanitized = super.sanitizeFilter(filter);
475
475
  const mongoFilter = {};
476
476
  for (const [key, value] of Object.entries(sanitized)) {
477
+ if (key.startsWith("__")) continue;
477
478
  if (key === "namespace") {
478
479
  mongoFilter[key] = value;
479
480
  } else {
@@ -2317,7 +2318,6 @@ ${context}`;
2317
2318
  }
2318
2319
  async batchEmbed(texts, options) {
2319
2320
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2320
- const vectors = [];
2321
2321
  const model = this.sanitizeModel(
2322
2322
  (_c = (_b = options == null ? void 0 : options.model) != null ? _b : (_a = this.embeddingConfig) == null ? void 0 : _a.model) != null ? _c : "text-embedding-004"
2323
2323
  );
package/dist/server.mjs CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  createIngestHandler,
35
35
  createUploadHandler,
36
36
  getRagConfig
37
- } from "./chunk-TYZC74CO.mjs";
37
+ } from "./chunk-3DU2ASYU.mjs";
38
38
  import "./chunk-EDLTMSNY.mjs";
39
39
  import {
40
40
  PineconeProvider
@@ -44,7 +44,7 @@ import {
44
44
  } from "./chunk-LJWWPTWE.mjs";
45
45
  import {
46
46
  MongoDBProvider
47
- } from "./chunk-DESUAKF3.mjs";
47
+ } from "./chunk-DMXS64U2.mjs";
48
48
  import {
49
49
  MilvusProvider
50
50
  } from "./chunk-3QWAK3RZ.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
5
5
  "author": "Abhinav Alkuchi",
6
6
  "license": "MIT",
@@ -512,7 +512,7 @@ export class ConfigValidator {
512
512
  }
513
513
 
514
514
  if (config.borderRadius) {
515
- if (!UI_BORDER_RADIUS_OPTIONS.includes(config.borderRadius as any)) {
515
+ if (!UI_BORDER_RADIUS_OPTIONS.includes(config.borderRadius as (typeof UI_BORDER_RADIUS_OPTIONS)[number])) {
516
516
  errors.push({
517
517
  field: 'ui.borderRadius',
518
518
  message: `borderRadius must be one of: ${UI_BORDER_RADIUS_OPTIONS.join(', ')}`,
@@ -522,7 +522,7 @@ export class ConfigValidator {
522
522
  }
523
523
 
524
524
  if (config.visualStyle) {
525
- if (!UI_VISUAL_STYLES.includes(config.visualStyle as any)) {
525
+ if (!UI_VISUAL_STYLES.includes(config.visualStyle as (typeof UI_VISUAL_STYLES)[number])) {
526
526
  errors.push({
527
527
  field: 'ui.visualStyle',
528
528
  message: `visualStyle must be one of: ${UI_VISUAL_STYLES.join(', ')}`,
@@ -120,7 +120,6 @@ export class GeminiProvider implements ILLMProvider {
120
120
  }
121
121
 
122
122
  async batchEmbed(texts: string[], options?: EmbedOptions): Promise<number[][]> {
123
- const vectors: number[][] = [];
124
123
  // Sequential fallback for Gemini (API doesn't have a direct batch endpoint in the same way, though you can pass multiple contents.
125
124
  // For simplicity and to match the other providers' structure, we'll iterate or pass array.
126
125
  // The new SDK supports an array of contents.
@@ -71,7 +71,7 @@ export class MongoDBProvider extends BaseVectorProvider {
71
71
  const pipeline: Record<string, unknown>[] = [
72
72
  {
73
73
  $vectorSearch: {
74
- index: this.config.options.indexName || 'vector_index',
74
+ index: this.config.indexName || 'vector_index',
75
75
  path: this.embeddingKey,
76
76
  queryVector: vector,
77
77
  numCandidates: Math.max(topK * 10, 100),
@@ -116,7 +116,10 @@ export class MongoDBProvider extends BaseVectorProvider {
116
116
  const mongoFilter: Record<string, unknown> = {};
117
117
 
118
118
  for (const [key, value] of Object.entries(sanitized)) {
119
- // If the key is already a metadata field or special key, keep it (e.g. namespace)
119
+ // Skip internal engine fields
120
+ if (key.startsWith('__')) continue;
121
+
122
+ // If the key is already a special key, keep it (e.g. namespace)
120
123
  if (key === 'namespace') {
121
124
  mongoFilter[key] = value;
122
125
  } else {
@@ -71,7 +71,7 @@ export class PineconeProvider extends BaseVectorProvider {
71
71
  vector,
72
72
  topK,
73
73
  includeMetadata: true,
74
- ...(Object.keys(pineconeFilter).length > 0 ? { filter: pineconeFilter as any } : {}),
74
+ ...(Object.keys(pineconeFilter).length > 0 ? { filter: pineconeFilter as Record<string, string | number | boolean | string[] | number[]> } : {}),
75
75
  });
76
76
  return (result.matches ?? []).map((m) => ({
77
77
  id: m.id,