@retrivora-ai/rag-engine 0.1.2 → 0.1.3

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.
@@ -1022,9 +1022,12 @@ var RAGPipeline = class {
1022
1022
  const ns = namespace != null ? namespace : this.config.projectId;
1023
1023
  const topK = (_b = (_a = this.config.rag) == null ? void 0 : _a.topK) != null ? _b : 5;
1024
1024
  const scoreThreshold = (_d = (_c = this.config.rag) == null ? void 0 : _c.scoreThreshold) != null ? _d : 0;
1025
+ console.log(`[RAGPipeline] Searching Pinecone (Namespace: "${ns}", TopK: ${topK})...`);
1025
1026
  const queryVector = await this.embeddingProvider.embed(question);
1026
1027
  const rawMatches = await this.vectorDB.query(queryVector, topK, ns);
1028
+ console.log(`[RAGPipeline] Found ${rawMatches.length} raw matches in Pinecone.`);
1027
1029
  const sources = rawMatches.filter((m) => m.score >= scoreThreshold);
1030
+ console.log(`[RAGPipeline] ${sources.length} sources remaining after threshold filter (min: ${scoreThreshold}).`);
1028
1031
  const context = sources.length ? sources.map((m, i) => `[Source ${i + 1}]
1029
1032
  ${m.content}`).join("\n\n---\n\n") : "No relevant context found.";
1030
1033
  const messages = [
@@ -1097,9 +1097,12 @@ var RAGPipeline = class {
1097
1097
  const ns = namespace != null ? namespace : this.config.projectId;
1098
1098
  const topK = (_b = (_a = this.config.rag) == null ? void 0 : _a.topK) != null ? _b : 5;
1099
1099
  const scoreThreshold = (_d = (_c = this.config.rag) == null ? void 0 : _c.scoreThreshold) != null ? _d : 0;
1100
+ console.log(`[RAGPipeline] Searching Pinecone (Namespace: "${ns}", TopK: ${topK})...`);
1100
1101
  const queryVector = await this.embeddingProvider.embed(question);
1101
1102
  const rawMatches = await this.vectorDB.query(queryVector, topK, ns);
1103
+ console.log(`[RAGPipeline] Found ${rawMatches.length} raw matches in Pinecone.`);
1102
1104
  const sources = rawMatches.filter((m) => m.score >= scoreThreshold);
1105
+ console.log(`[RAGPipeline] ${sources.length} sources remaining after threshold filter (min: ${scoreThreshold}).`);
1103
1106
  const context = sources.length ? sources.map((m, i) => `[Source ${i + 1}]
1104
1107
  ${m.content}`).join("\n\n---\n\n") : "No relevant context found.";
1105
1108
  const messages = [
@@ -3,7 +3,7 @@ import {
3
3
  createHealthHandler,
4
4
  createIngestHandler,
5
5
  createUploadHandler
6
- } from "../chunk-W57OWMJK.mjs";
6
+ } from "../chunk-NVOMLHXW.mjs";
7
7
  import "../chunk-ZPXLQR5Q.mjs";
8
8
  export {
9
9
  createChatHandler,
package/dist/server.js CHANGED
@@ -1107,9 +1107,12 @@ var RAGPipeline = class {
1107
1107
  const ns = namespace != null ? namespace : this.config.projectId;
1108
1108
  const topK = (_b = (_a = this.config.rag) == null ? void 0 : _a.topK) != null ? _b : 5;
1109
1109
  const scoreThreshold = (_d = (_c = this.config.rag) == null ? void 0 : _c.scoreThreshold) != null ? _d : 0;
1110
+ console.log(`[RAGPipeline] Searching Pinecone (Namespace: "${ns}", TopK: ${topK})...`);
1110
1111
  const queryVector = await this.embeddingProvider.embed(question);
1111
1112
  const rawMatches = await this.vectorDB.query(queryVector, topK, ns);
1113
+ console.log(`[RAGPipeline] Found ${rawMatches.length} raw matches in Pinecone.`);
1112
1114
  const sources = rawMatches.filter((m) => m.score >= scoreThreshold);
1115
+ console.log(`[RAGPipeline] ${sources.length} sources remaining after threshold filter (min: ${scoreThreshold}).`);
1113
1116
  const context = sources.length ? sources.map((m, i) => `[Source ${i + 1}]
1114
1117
  ${m.content}`).join("\n\n---\n\n") : "No relevant context found.";
1115
1118
  const messages = [
package/dist/server.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  createHealthHandler,
14
14
  createIngestHandler,
15
15
  createUploadHandler
16
- } from "./chunk-W57OWMJK.mjs";
16
+ } from "./chunk-NVOMLHXW.mjs";
17
17
  import "./chunk-ZPXLQR5Q.mjs";
18
18
 
19
19
  // src/config/serverConfig.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retrivora-ai/rag-engine",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",
@@ -140,14 +140,18 @@ export class RAGPipeline {
140
140
  const topK = this.config.rag?.topK ?? 5;
141
141
  const scoreThreshold = this.config.rag?.scoreThreshold ?? 0.0;
142
142
 
143
+ console.log(`[RAGPipeline] Searching Pinecone (Namespace: "${ns}", TopK: ${topK})...`);
144
+
143
145
  // 1. Embed the question
144
146
  const queryVector = await this.embeddingProvider.embed(question);
145
147
 
146
148
  // 2. Retrieve relevant chunks
147
149
  const rawMatches = await this.vectorDB.query(queryVector, topK, ns);
150
+ console.log(`[RAGPipeline] Found ${rawMatches.length} raw matches in Pinecone.`);
148
151
 
149
152
  // 3. Apply score threshold filter
150
153
  const sources = rawMatches.filter((m) => m.score >= scoreThreshold);
154
+ console.log(`[RAGPipeline] ${sources.length} sources remaining after threshold filter (min: ${scoreThreshold}).`);
151
155
 
152
156
  // 4. Build context
153
157
  const context = sources.length