@retrivora-ai/rag-engine 0.3.0 → 0.3.1
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/server.js
CHANGED
|
@@ -3911,6 +3911,8 @@ var MultiTablePostgresProvider = class extends BaseVectorProvider {
|
|
|
3911
3911
|
const entityHints = Array.isArray(_filter == null ? void 0 : _filter.__entityHints) ? _filter.__entityHints.filter(
|
|
3912
3912
|
(hint) => typeof hint === "object" && hint !== null && typeof hint.value === "string"
|
|
3913
3913
|
).map((hint) => hint.value.trim().toLowerCase()).filter(Boolean) : [];
|
|
3914
|
+
console.log(`[MultiTablePostgresProvider] queryText: "${queryText}"`);
|
|
3915
|
+
console.log(`[MultiTablePostgresProvider] entityHints: [${entityHints.join(", ")}]`);
|
|
3914
3916
|
const queryPromises = this.tables.map(async (table) => {
|
|
3915
3917
|
try {
|
|
3916
3918
|
let sqlQuery = "";
|
|
@@ -3928,8 +3930,8 @@ var MultiTablePostgresProvider = class extends BaseVectorProvider {
|
|
|
3928
3930
|
sqlQuery = `
|
|
3929
3931
|
SELECT *,
|
|
3930
3932
|
(1 - (embedding <=> $1::vector)) AS vector_score,
|
|
3931
|
-
COALESCE(ts_rank(to_tsvector('english', t
|
|
3932
|
-
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', t
|
|
3933
|
+
COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) AS keyword_score,
|
|
3934
|
+
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) * 2.0) ${exactNameScoreExpr}) AS hybrid_score
|
|
3933
3935
|
FROM "${table}" t
|
|
3934
3936
|
ORDER BY hybrid_score DESC
|
|
3935
3937
|
LIMIT 50
|
package/dist/server.mjs
CHANGED
|
@@ -419,6 +419,8 @@ var MultiTablePostgresProvider = class extends BaseVectorProvider {
|
|
|
419
419
|
const entityHints = Array.isArray(_filter == null ? void 0 : _filter.__entityHints) ? _filter.__entityHints.filter(
|
|
420
420
|
(hint) => typeof hint === "object" && hint !== null && typeof hint.value === "string"
|
|
421
421
|
).map((hint) => hint.value.trim().toLowerCase()).filter(Boolean) : [];
|
|
422
|
+
console.log(`[MultiTablePostgresProvider] queryText: "${queryText}"`);
|
|
423
|
+
console.log(`[MultiTablePostgresProvider] entityHints: [${entityHints.join(", ")}]`);
|
|
422
424
|
const queryPromises = this.tables.map(async (table) => {
|
|
423
425
|
try {
|
|
424
426
|
let sqlQuery = "";
|
|
@@ -436,8 +438,8 @@ var MultiTablePostgresProvider = class extends BaseVectorProvider {
|
|
|
436
438
|
sqlQuery = `
|
|
437
439
|
SELECT *,
|
|
438
440
|
(1 - (embedding <=> $1::vector)) AS vector_score,
|
|
439
|
-
COALESCE(ts_rank(to_tsvector('english', t
|
|
440
|
-
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', t
|
|
441
|
+
COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) AS keyword_score,
|
|
442
|
+
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) * 2.0) ${exactNameScoreExpr}) AS hybrid_score
|
|
441
443
|
FROM "${table}" t
|
|
442
444
|
ORDER BY hybrid_score DESC
|
|
443
445
|
LIMIT 50
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retrivora-ai/rag-engine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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",
|
|
@@ -148,6 +148,9 @@ export class MultiTablePostgresProvider extends BaseVectorProvider {
|
|
|
148
148
|
.filter(Boolean)
|
|
149
149
|
: [];
|
|
150
150
|
|
|
151
|
+
console.log(`[MultiTablePostgresProvider] queryText: "${queryText}"`);
|
|
152
|
+
console.log(`[MultiTablePostgresProvider] entityHints: [${entityHints.join(', ')}]`);
|
|
153
|
+
|
|
151
154
|
const queryPromises = this.tables.map(async (table) => {
|
|
152
155
|
try {
|
|
153
156
|
let sqlQuery = '';
|
|
@@ -170,8 +173,8 @@ export class MultiTablePostgresProvider extends BaseVectorProvider {
|
|
|
170
173
|
sqlQuery = `
|
|
171
174
|
SELECT *,
|
|
172
175
|
(1 - (embedding <=> $1::vector)) AS vector_score,
|
|
173
|
-
COALESCE(ts_rank(to_tsvector('english', t
|
|
174
|
-
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', t
|
|
176
|
+
COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) AS keyword_score,
|
|
177
|
+
((1 - (embedding <=> $1::vector)) + (COALESCE(ts_rank(to_tsvector('english', (to_jsonb(t) - 'embedding')::text), NULLIF(REPLACE(plainto_tsquery('english', $2)::text, '&', '|'), '')::tsquery), 0) * 2.0) ${exactNameScoreExpr}) AS hybrid_score
|
|
175
178
|
FROM "${table}" t
|
|
176
179
|
ORDER BY hybrid_score DESC
|
|
177
180
|
LIMIT 50
|