@etohq/search-trieve 0.0.0-stage → 2.0.5
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/LICENSE +21 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/services/trieve-search.d.ts +129 -0
- package/dist/services/trieve-search.d.ts.map +1 -0
- package/dist/services/trieve-search.js +413 -0
- package/dist/services/trieve-search.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +40 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Etohq
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,mBAAmB,EAAE,CAAA;;AAI9B,wBAEE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrieveSearchService = void 0;
|
|
4
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
5
|
+
const trieve_search_1 = require("./services/trieve-search");
|
|
6
|
+
Object.defineProperty(exports, "TrieveSearchService", { enumerable: true, get: function () { return trieve_search_1.TrieveSearchService; } });
|
|
7
|
+
const services = [trieve_search_1.TrieveSearchService];
|
|
8
|
+
exports.default = (0, utils_1.ModuleProvider)(utils_1.Modules.SEARCH_LEGACY, {
|
|
9
|
+
services,
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgE;AAEhE,4DAA8D;AAErD,oGAFA,mCAAmB,OAEA;AAE5B,MAAM,QAAQ,GAAG,CAAC,mCAAmB,CAAC,CAAA;AAEtC,kBAAe,IAAA,sBAAc,EAAC,eAAO,CAAC,aAAa,EAAE;IACnD,QAAQ;CACT,CAAC,CAAA"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { AbstractLegacySearchService, type LegacySearchCondition, type LegacySearchIndexDocument, type LegacySearchIndexGroup, type LegacySearchQuery, type LegacySearchResult } from "@etohq/framework/utils";
|
|
2
|
+
type TrieveSearchOptions = {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
datasetId: string;
|
|
6
|
+
/** The Trieve API base URL used for dataset-scoped operations. */
|
|
7
|
+
datasetUrl?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieval policy. Kept in configuration rather than hardcoded so the
|
|
10
|
+
* ranking strategy can change without touching code.
|
|
11
|
+
*/
|
|
12
|
+
searchType?: "hybrid" | "semantic" | "fulltext";
|
|
13
|
+
defaultLimit?: number;
|
|
14
|
+
/** Bounded retries/timeout around each provider call. */
|
|
15
|
+
retry?: RetryPolicy;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Trieve search provider.
|
|
19
|
+
*
|
|
20
|
+
* Trieve natively models a dataset as groups (chunk_groups) and documents
|
|
21
|
+
* (chunks), so it implements the group/document capability of
|
|
22
|
+
* {@link AbstractLegacySearchService}. Domain projections (marketplace listings,
|
|
23
|
+
* community posts, …) produce {@link LegacySearchIndexGroup}/{@link LegacySearchIndexDocument}
|
|
24
|
+
* values that this provider indexes and searches.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Failure taxonomy, mirroring the shared search errors so callers can decide
|
|
28
|
+
* between retrying and repairing the request.
|
|
29
|
+
*/
|
|
30
|
+
export type TrieveErrorKind = "timeout" | "unavailable" | "bad_request" | "unknown";
|
|
31
|
+
export declare class TrieveSearchError extends Error {
|
|
32
|
+
readonly kind: TrieveErrorKind;
|
|
33
|
+
readonly cause?: unknown | undefined;
|
|
34
|
+
constructor(kind: TrieveErrorKind, message: string, cause?: unknown | undefined);
|
|
35
|
+
get isRetryable(): boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Maps a transport/SDK failure onto the taxonomy. */
|
|
38
|
+
export declare function mapTrieveError(error: unknown): TrieveSearchError;
|
|
39
|
+
export type RetryPolicy = {
|
|
40
|
+
attempts?: number;
|
|
41
|
+
baseDelayMs?: number;
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
};
|
|
44
|
+
/** Bounded retries with exponential backoff around one provider call. */
|
|
45
|
+
export declare function withPolicy<T>(fn: () => Promise<T>, policy?: RetryPolicy): Promise<T>;
|
|
46
|
+
export type TrieveRequest = {
|
|
47
|
+
endpoint: "search" | "recommend";
|
|
48
|
+
payload: Record<string, unknown>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Builds the Trieve request for a search query — pure, so the mapping is
|
|
52
|
+
* testable without a Trieve instance.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildTrieveRequest(query: LegacySearchQuery, options?: {
|
|
55
|
+
defaultSearchType?: "hybrid" | "semantic" | "fulltext";
|
|
56
|
+
defaultLimit?: number;
|
|
57
|
+
page?: number;
|
|
58
|
+
}): TrieveRequest;
|
|
59
|
+
export declare class TrieveSearchService extends AbstractLegacySearchService {
|
|
60
|
+
static identifier: string;
|
|
61
|
+
readonly isDefault = false;
|
|
62
|
+
readonly supportsGroups = true;
|
|
63
|
+
readonly supportsDocuments = true;
|
|
64
|
+
protected readonly config_: TrieveSearchOptions;
|
|
65
|
+
private trievePromise_?;
|
|
66
|
+
constructor(container: Record<string, unknown>, options: TrieveSearchOptions);
|
|
67
|
+
/**
|
|
68
|
+
* `trieve-ts-sdk` is ESM-only, so it is loaded lazily instead of a static
|
|
69
|
+
* require (which Node16 module resolution rejects from a CJS build).
|
|
70
|
+
*/
|
|
71
|
+
private trieve_;
|
|
72
|
+
upsertGroup(group: LegacySearchIndexGroup): Promise<void>;
|
|
73
|
+
deleteGroup(trackingId: string): Promise<void>;
|
|
74
|
+
upsertDocuments(documents: LegacySearchIndexDocument[]): Promise<void>;
|
|
75
|
+
deleteDocuments(trackingIds: string[]): Promise<void>;
|
|
76
|
+
searchDocuments(query: LegacySearchQuery): Promise<LegacySearchResult>;
|
|
77
|
+
private indexApiUnsupported_;
|
|
78
|
+
createIndex(): never;
|
|
79
|
+
getIndex(): never;
|
|
80
|
+
addDocuments(): never;
|
|
81
|
+
replaceDocuments(): never;
|
|
82
|
+
deleteDocument(): never;
|
|
83
|
+
deleteAllDocuments(): never;
|
|
84
|
+
search(): never;
|
|
85
|
+
updateSettings(): never;
|
|
86
|
+
}
|
|
87
|
+
export default TrieveSearchService;
|
|
88
|
+
/**
|
|
89
|
+
* Trieve filter condition. `field` selects the indexed attribute (`metadata`,
|
|
90
|
+
* `tag_set`, …) and `match` carries exact values; `range` carries comparisons.
|
|
91
|
+
*/
|
|
92
|
+
export type TrieveCondition = {
|
|
93
|
+
field: string;
|
|
94
|
+
match?: {
|
|
95
|
+
field: string;
|
|
96
|
+
value: string | number | boolean | (string | number | boolean)[];
|
|
97
|
+
}[];
|
|
98
|
+
range?: {
|
|
99
|
+
gt?: number;
|
|
100
|
+
gte?: number;
|
|
101
|
+
lt?: number;
|
|
102
|
+
lte?: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
/** Maps a single condition group onto Trieve's condition list. */
|
|
106
|
+
export declare function toTrieveConditions(condition: LegacySearchCondition | undefined): TrieveCondition[];
|
|
107
|
+
/**
|
|
108
|
+
* Maps the semantic filters onto Trieve's request filters: tags and the
|
|
109
|
+
* `type:<type>` tag convention, the group scope, AND conditions (`filters`),
|
|
110
|
+
* OR groups (`filters_any`) and exclusions (`filters_not`).
|
|
111
|
+
*/
|
|
112
|
+
export declare function buildTrieveFilters(query: Pick<LegacySearchQuery, "tag_set" | "type" | "group_tracking_id" | "filters" | "filters_any" | "filters_not">): Record<string, unknown> | undefined;
|
|
113
|
+
/** Retrieval mode, from the query when set, else the provider's configured default. */
|
|
114
|
+
export declare function searchTypeFor(query: Pick<LegacySearchQuery, "mode">, fallback?: "hybrid" | "semantic" | "fulltext"): "hybrid" | "semantic" | "fulltext";
|
|
115
|
+
/** The first non-relevance sort clause, as Trieve's `sort_by`. */
|
|
116
|
+
export declare function buildTrieveSort(query: Pick<LegacySearchQuery, "sort">): {
|
|
117
|
+
field: string;
|
|
118
|
+
direction: "asc" | "desc";
|
|
119
|
+
} | undefined;
|
|
120
|
+
/** Strips the `<kind>:` prefix (first colon only, so ids may contain colons). */
|
|
121
|
+
export declare function trackingIdToId(trackingId: string): string;
|
|
122
|
+
/** Trieve pages rather than offsets. */
|
|
123
|
+
export declare function offsetToPage(offset?: number, limit?: number): number;
|
|
124
|
+
/**
|
|
125
|
+
* Normalises a Trieve search response. Accepts both `chunks` and `score_chunks`
|
|
126
|
+
* and derives a real total from `total_pages` when present.
|
|
127
|
+
*/
|
|
128
|
+
export declare function toSearchResult(response: unknown, pageSize: number): LegacySearchResult;
|
|
129
|
+
//# sourceMappingURL=trieve-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trieve-search.d.ts","sourceRoot":"","sources":["../../src/services/trieve-search.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,KAAK,qBAAqB,EAE1B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAA;AAgB/B,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAA;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yDAAyD;IACzD,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAA;AAID;;;;;;;;GAQG;AACH;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,aAAa,GACb,aAAa,GACb,SAAS,CAAA;AAEb,qBAAa,iBAAkB,SAAQ,KAAK;IAExC,QAAQ,CAAC,IAAI,EAAE,eAAe;IAE9B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;gBAFf,IAAI,EAAE,eAAe,E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AChC,KAAK,EAAE,IAAI,CACT,iBAAiB,EACf,SAAS,GACT,MAAM,GACN,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,aAAa,CAChB,GACA,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAiCrC;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,EACtC,QAAQ,GAAE,QAAQ,GAAG,UAAU,GAAG,UAAqB,GACtD,QAAQ,GAAG,UAAU,GAAG,UAAU,CAWpC;AAED,kEAAkE;AAClE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,GAAG,SAAS,CAQ1D;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,GACf,kBAAkB,CA0CpB"}
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrieveSearchService = exports.TrieveSearchError = void 0;
|
|
4
|
+
exports.mapTrieveError = mapTrieveError;
|
|
5
|
+
exports.withPolicy = withPolicy;
|
|
6
|
+
exports.buildTrieveRequest = buildTrieveRequest;
|
|
7
|
+
exports.toTrieveConditions = toTrieveConditions;
|
|
8
|
+
exports.buildTrieveFilters = buildTrieveFilters;
|
|
9
|
+
exports.searchTypeFor = searchTypeFor;
|
|
10
|
+
exports.buildTrieveSort = buildTrieveSort;
|
|
11
|
+
exports.trackingIdToId = trackingIdToId;
|
|
12
|
+
exports.offsetToPage = offsetToPage;
|
|
13
|
+
exports.toSearchResult = toSearchResult;
|
|
14
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
15
|
+
const CHUNK_BATCH_LIMIT = 120;
|
|
16
|
+
class TrieveSearchError extends Error {
|
|
17
|
+
constructor(kind, message, cause) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.kind = kind;
|
|
20
|
+
this.cause = cause;
|
|
21
|
+
this.name = "TrieveSearchError";
|
|
22
|
+
}
|
|
23
|
+
get isRetryable() {
|
|
24
|
+
return this.kind === "timeout" || this.kind === "unavailable";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.TrieveSearchError = TrieveSearchError;
|
|
28
|
+
/** Maps a transport/SDK failure onto the taxonomy. */
|
|
29
|
+
function mapTrieveError(error) {
|
|
30
|
+
if (error instanceof TrieveSearchError) {
|
|
31
|
+
return error;
|
|
32
|
+
}
|
|
33
|
+
const message = error?.message ?? "unknown error";
|
|
34
|
+
const status = error?.status ??
|
|
35
|
+
error?.statusCode;
|
|
36
|
+
const name = error?.name;
|
|
37
|
+
if (name === "AbortError" || /timed? ?out/i.test(message)) {
|
|
38
|
+
return new TrieveSearchError("timeout", message, error);
|
|
39
|
+
}
|
|
40
|
+
if (status && status >= 400 && status < 500) {
|
|
41
|
+
return new TrieveSearchError("bad_request", message, error);
|
|
42
|
+
}
|
|
43
|
+
if (status && status >= 500) {
|
|
44
|
+
return new TrieveSearchError("unavailable", message, error);
|
|
45
|
+
}
|
|
46
|
+
if (/fetch failed|ECONNREFUSED|ENOTFOUND|socket hang up/i.test(message)) {
|
|
47
|
+
return new TrieveSearchError("unavailable", message, error);
|
|
48
|
+
}
|
|
49
|
+
return new TrieveSearchError("unknown", message, error);
|
|
50
|
+
}
|
|
51
|
+
/** Bounded retries with exponential backoff around one provider call. */
|
|
52
|
+
async function withPolicy(fn, policy = {}) {
|
|
53
|
+
const attempts = policy.attempts ?? 3;
|
|
54
|
+
const baseDelayMs = policy.baseDelayMs ?? 100;
|
|
55
|
+
const timeoutMs = policy.timeoutMs ?? 5000;
|
|
56
|
+
let lastError;
|
|
57
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
58
|
+
try {
|
|
59
|
+
return await withTimeout(fn(), timeoutMs);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
lastError = mapTrieveError(error);
|
|
63
|
+
if (!lastError.isRetryable || attempt === attempts - 1) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
await delay(baseDelayMs * 2 ** attempt);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
throw lastError ?? new TrieveSearchError("unknown", "no attempt was made");
|
|
70
|
+
}
|
|
71
|
+
function withTimeout(promise, ms) {
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
const timer = setTimeout(() => reject(new TrieveSearchError("timeout", `timed out after ${ms}ms`)), ms);
|
|
74
|
+
promise.then((value) => {
|
|
75
|
+
clearTimeout(timer);
|
|
76
|
+
resolve(value);
|
|
77
|
+
}, (error) => {
|
|
78
|
+
clearTimeout(timer);
|
|
79
|
+
reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
84
|
+
/**
|
|
85
|
+
* Builds the Trieve request for a search query — pure, so the mapping is
|
|
86
|
+
* testable without a Trieve instance.
|
|
87
|
+
*/
|
|
88
|
+
function buildTrieveRequest(query, options = {}) {
|
|
89
|
+
const page = options.page ?? 1;
|
|
90
|
+
const limit = query.limit ?? options.defaultLimit ?? 10;
|
|
91
|
+
const filters = buildTrieveFilters(query);
|
|
92
|
+
const positive = query.similar_to?.positive;
|
|
93
|
+
if (positive?.length) {
|
|
94
|
+
return {
|
|
95
|
+
endpoint: "recommend",
|
|
96
|
+
payload: {
|
|
97
|
+
positive_chunk_ids: positive,
|
|
98
|
+
...(query.similar_to?.negative?.length && {
|
|
99
|
+
negative_chunk_ids: query.similar_to.negative,
|
|
100
|
+
}),
|
|
101
|
+
page,
|
|
102
|
+
page_size: limit,
|
|
103
|
+
...(filters && { filters }),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const sort = buildTrieveSort(query);
|
|
108
|
+
return {
|
|
109
|
+
endpoint: "search",
|
|
110
|
+
payload: {
|
|
111
|
+
query: query.query ?? "",
|
|
112
|
+
search_type: searchTypeFor(query, options.defaultSearchType),
|
|
113
|
+
page,
|
|
114
|
+
page_size: limit,
|
|
115
|
+
...(filters && { filters }),
|
|
116
|
+
...(query.ranking?.recency?.weight !== undefined && {
|
|
117
|
+
recency_bias: query.ranking.recency.weight,
|
|
118
|
+
}),
|
|
119
|
+
...(query.include?.highlights && { highlight_results: true }),
|
|
120
|
+
...(sort && { sort_by: sort }),
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
class TrieveSearchService extends utils_1.AbstractLegacySearchService {
|
|
125
|
+
constructor(container, options) {
|
|
126
|
+
// @ts-expect-error prefer-rest-params
|
|
127
|
+
super(...arguments);
|
|
128
|
+
this.isDefault = false;
|
|
129
|
+
this.supportsGroups = true;
|
|
130
|
+
this.supportsDocuments = true;
|
|
131
|
+
this.config_ = options;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* `trieve-ts-sdk` is ESM-only, so it is loaded lazily instead of a static
|
|
135
|
+
* require (which Node16 module resolution rejects from a CJS build).
|
|
136
|
+
*/
|
|
137
|
+
async trieve_() {
|
|
138
|
+
if (!this.trievePromise_) {
|
|
139
|
+
this.trievePromise_ = import("trieve-ts-sdk").then((sdk) => new sdk.TrieveSDK({
|
|
140
|
+
apiKey: this.config_.apiKey,
|
|
141
|
+
baseUrl: this.config_.baseUrl,
|
|
142
|
+
datasetId: this.config_.datasetId,
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
return this.trievePromise_;
|
|
146
|
+
}
|
|
147
|
+
// ---- group / document capability ----
|
|
148
|
+
async upsertGroup(group) {
|
|
149
|
+
await (await this.trieve_()).createChunkGroup({
|
|
150
|
+
name: group.name,
|
|
151
|
+
description: group.description ?? "",
|
|
152
|
+
tracking_id: group.tracking_id,
|
|
153
|
+
tag_set: group.tag_set,
|
|
154
|
+
metadata: group.metadata,
|
|
155
|
+
upsert_by_tracking_id: true,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async deleteGroup(trackingId) {
|
|
159
|
+
await (await this.trieve_()).deleteGroupByTrackingId({
|
|
160
|
+
tracking_id: trackingId,
|
|
161
|
+
trackingId,
|
|
162
|
+
deleteChunks: true,
|
|
163
|
+
trDataset: this.config_.datasetId,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
async upsertDocuments(documents) {
|
|
167
|
+
for (let i = 0; i < documents.length; i += CHUNK_BATCH_LIMIT) {
|
|
168
|
+
const batch = documents.slice(i, i + CHUNK_BATCH_LIMIT);
|
|
169
|
+
await (await this.trieve_()).createChunk(batch.map((document) => ({
|
|
170
|
+
chunk_html: document.content ?? undefined,
|
|
171
|
+
semantic_content: document.content ?? undefined,
|
|
172
|
+
fulltext_content: document.content ?? undefined,
|
|
173
|
+
tag_set: document.tag_set,
|
|
174
|
+
metadata: document.metadata,
|
|
175
|
+
group_tracking_ids: document.group_tracking_ids,
|
|
176
|
+
tracking_id: document.tracking_id,
|
|
177
|
+
upsert_by_tracking_id: true,
|
|
178
|
+
})));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async deleteDocuments(trackingIds) {
|
|
182
|
+
for (const trackingId of trackingIds) {
|
|
183
|
+
await (await this.trieve_()).deleteChunkByTrackingId({ trackingId });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async searchDocuments(query) {
|
|
187
|
+
const limit = query.limit ?? this.config_.defaultLimit ?? 10;
|
|
188
|
+
const page = query.cursor
|
|
189
|
+
? Math.max(1, Number(query.cursor) || 1)
|
|
190
|
+
: offsetToPage(query.offset, limit);
|
|
191
|
+
const client = await this.trieve_();
|
|
192
|
+
const request = buildTrieveRequest(query, {
|
|
193
|
+
defaultSearchType: this.config_.searchType,
|
|
194
|
+
defaultLimit: this.config_.defaultLimit,
|
|
195
|
+
page,
|
|
196
|
+
});
|
|
197
|
+
let response;
|
|
198
|
+
try {
|
|
199
|
+
response = await withPolicy(() => request.endpoint === "recommend" && client.recommendChunks
|
|
200
|
+
? client.recommendChunks(request.payload)
|
|
201
|
+
: client.search(request.payload), this.config_.retry);
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
// Failures surface as typed errors so callers can retry, degrade or fix
|
|
205
|
+
// the request — never as a silent empty feed.
|
|
206
|
+
throw mapTrieveError(error);
|
|
207
|
+
}
|
|
208
|
+
const result = toSearchResult(response, limit);
|
|
209
|
+
return {
|
|
210
|
+
...result,
|
|
211
|
+
cursor: result.hits.length === limit ? String(page + 1) : undefined,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
// ---- index-based API is not how Trieve is addressed ----
|
|
215
|
+
indexApiUnsupported_(method) {
|
|
216
|
+
return new Error(`TrieveSearchService.${method} is not supported; Trieve is addressed through the group/document capability (supportsGroups = true).`);
|
|
217
|
+
}
|
|
218
|
+
createIndex() {
|
|
219
|
+
throw this.indexApiUnsupported_("createIndex");
|
|
220
|
+
}
|
|
221
|
+
getIndex() {
|
|
222
|
+
throw this.indexApiUnsupported_("getIndex");
|
|
223
|
+
}
|
|
224
|
+
addDocuments() {
|
|
225
|
+
throw this.indexApiUnsupported_("addDocuments");
|
|
226
|
+
}
|
|
227
|
+
replaceDocuments() {
|
|
228
|
+
throw this.indexApiUnsupported_("replaceDocuments");
|
|
229
|
+
}
|
|
230
|
+
deleteDocument() {
|
|
231
|
+
throw this.indexApiUnsupported_("deleteDocument");
|
|
232
|
+
}
|
|
233
|
+
deleteAllDocuments() {
|
|
234
|
+
throw this.indexApiUnsupported_("deleteAllDocuments");
|
|
235
|
+
}
|
|
236
|
+
search() {
|
|
237
|
+
throw this.indexApiUnsupported_("search");
|
|
238
|
+
}
|
|
239
|
+
updateSettings() {
|
|
240
|
+
throw this.indexApiUnsupported_("updateSettings");
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.TrieveSearchService = TrieveSearchService;
|
|
244
|
+
TrieveSearchService.identifier = "trieve";
|
|
245
|
+
exports.default = TrieveSearchService;
|
|
246
|
+
const OPERATOR_KEYS = new Set([
|
|
247
|
+
"$eq",
|
|
248
|
+
"$ne",
|
|
249
|
+
"$in",
|
|
250
|
+
"$nin",
|
|
251
|
+
"$gt",
|
|
252
|
+
"$gte",
|
|
253
|
+
"$lt",
|
|
254
|
+
"$lte",
|
|
255
|
+
"$like",
|
|
256
|
+
"$prefix",
|
|
257
|
+
"$exists",
|
|
258
|
+
]);
|
|
259
|
+
const scalar = (value) => typeof value === "number" || typeof value === "boolean"
|
|
260
|
+
? value
|
|
261
|
+
: String(value);
|
|
262
|
+
/** Maps a single condition group onto Trieve's condition list. */
|
|
263
|
+
function toTrieveConditions(condition) {
|
|
264
|
+
const conditions = [];
|
|
265
|
+
for (const [field, raw] of Object.entries(condition ?? {})) {
|
|
266
|
+
if (raw === null || raw === undefined) {
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (typeof raw === "object" && !Array.isArray(raw)) {
|
|
270
|
+
const operators = raw;
|
|
271
|
+
const range = {};
|
|
272
|
+
for (const [op, value] of Object.entries(operators)) {
|
|
273
|
+
if (value === undefined || !OPERATOR_KEYS.has(op)) {
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
if (op === "$eq") {
|
|
277
|
+
conditions.push({
|
|
278
|
+
field: "metadata",
|
|
279
|
+
match: [{ field, value: scalar(value) }],
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
else if (op === "$in") {
|
|
283
|
+
const list = (Array.isArray(value) ? value : [value]).map(scalar);
|
|
284
|
+
conditions.push({
|
|
285
|
+
field: "metadata",
|
|
286
|
+
match: [{ field, value: list }],
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
else if (op === "$ne" || op === "$nin") {
|
|
290
|
+
// Trieve expresses exclusions at the filter level, not per condition;
|
|
291
|
+
// callers see them applied through `filters_not`.
|
|
292
|
+
}
|
|
293
|
+
else if (op === "$gt" ||
|
|
294
|
+
op === "$gte" ||
|
|
295
|
+
op === "$lt" ||
|
|
296
|
+
op === "$lte") {
|
|
297
|
+
const numeric = Number(value);
|
|
298
|
+
if (!Number.isNaN(numeric)) {
|
|
299
|
+
range[op.slice(1)] = numeric;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
// `$like`/`$prefix`/`$exists` have no Trieve equivalent and are ignored.
|
|
303
|
+
}
|
|
304
|
+
if (Object.keys(range).length) {
|
|
305
|
+
conditions.push({ field: "metadata", range });
|
|
306
|
+
}
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
conditions.push({
|
|
310
|
+
field: "metadata",
|
|
311
|
+
match: [
|
|
312
|
+
{
|
|
313
|
+
field,
|
|
314
|
+
value: Array.isArray(raw) ? raw.map(scalar) : scalar(raw),
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
return conditions;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Maps the semantic filters onto Trieve's request filters: tags and the
|
|
323
|
+
* `type:<type>` tag convention, the group scope, AND conditions (`filters`),
|
|
324
|
+
* OR groups (`filters_any`) and exclusions (`filters_not`).
|
|
325
|
+
*/
|
|
326
|
+
function buildTrieveFilters(query) {
|
|
327
|
+
const tagSet = [...(query.tag_set ?? [])];
|
|
328
|
+
if (query.type) {
|
|
329
|
+
tagSet.push(`type:${query.type}`);
|
|
330
|
+
}
|
|
331
|
+
const filters = {};
|
|
332
|
+
if (tagSet.length) {
|
|
333
|
+
filters.tag_set = tagSet;
|
|
334
|
+
}
|
|
335
|
+
if (query.group_tracking_id) {
|
|
336
|
+
filters.group_tracking_ids = [query.group_tracking_id];
|
|
337
|
+
}
|
|
338
|
+
const must = toTrieveConditions(query.filters);
|
|
339
|
+
if (must.length) {
|
|
340
|
+
filters.must = must;
|
|
341
|
+
}
|
|
342
|
+
// Trieve ORs `should` conditions, so any-of groups flatten into it.
|
|
343
|
+
const should = (query.filters_any ?? []).flatMap((condition) => toTrieveConditions(condition));
|
|
344
|
+
if (should.length) {
|
|
345
|
+
filters.should = should;
|
|
346
|
+
}
|
|
347
|
+
const mustNot = toTrieveConditions(query.filters_not);
|
|
348
|
+
if (mustNot.length) {
|
|
349
|
+
filters.must_not = mustNot;
|
|
350
|
+
}
|
|
351
|
+
return Object.keys(filters).length ? filters : undefined;
|
|
352
|
+
}
|
|
353
|
+
/** Retrieval mode, from the query when set, else the provider's configured default. */
|
|
354
|
+
function searchTypeFor(query, fallback = "hybrid") {
|
|
355
|
+
switch (query.mode) {
|
|
356
|
+
case "semantic":
|
|
357
|
+
return "semantic";
|
|
358
|
+
case "keyword":
|
|
359
|
+
return "fulltext";
|
|
360
|
+
case "hybrid":
|
|
361
|
+
return "hybrid";
|
|
362
|
+
default:
|
|
363
|
+
return fallback;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/** The first non-relevance sort clause, as Trieve's `sort_by`. */
|
|
367
|
+
function buildTrieveSort(query) {
|
|
368
|
+
const clause = (query.sort ?? []).find((sort) => sort.field && sort.field !== "relevance");
|
|
369
|
+
if (!clause) {
|
|
370
|
+
return undefined;
|
|
371
|
+
}
|
|
372
|
+
return { field: clause.field, direction: clause.direction ?? "desc" };
|
|
373
|
+
}
|
|
374
|
+
/** Strips the `<kind>:` prefix (first colon only, so ids may contain colons). */
|
|
375
|
+
function trackingIdToId(trackingId) {
|
|
376
|
+
const separator = trackingId.indexOf(":");
|
|
377
|
+
return separator === -1 ? trackingId : trackingId.slice(separator + 1);
|
|
378
|
+
}
|
|
379
|
+
/** Trieve pages rather than offsets. */
|
|
380
|
+
function offsetToPage(offset, limit) {
|
|
381
|
+
if (!offset || !limit || limit <= 0) {
|
|
382
|
+
return 1;
|
|
383
|
+
}
|
|
384
|
+
return Math.floor(offset / limit) + 1;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Normalises a Trieve search response. Accepts both `chunks` and `score_chunks`
|
|
388
|
+
* and derives a real total from `total_pages` when present.
|
|
389
|
+
*/
|
|
390
|
+
function toSearchResult(response, pageSize) {
|
|
391
|
+
const body = (response ?? {});
|
|
392
|
+
const chunks = body.chunks ?? body.score_chunks ?? [];
|
|
393
|
+
const hits = [];
|
|
394
|
+
for (const hit of chunks) {
|
|
395
|
+
const tracking = hit.chunk?.tracking_id ?? hit.tracking_id;
|
|
396
|
+
if (typeof tracking !== "string") {
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
const metadata = hit.chunk?.metadata ?? hit.metadata ?? undefined;
|
|
400
|
+
const highlights = hit.chunk?.highlight ?? undefined;
|
|
401
|
+
hits.push({
|
|
402
|
+
id: trackingIdToId(tracking),
|
|
403
|
+
score: hit.score,
|
|
404
|
+
...(metadata ? { metadata } : {}),
|
|
405
|
+
...(highlights ? { highlights } : {}),
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
const total = typeof body.total_pages === "number"
|
|
409
|
+
? body.total_pages * pageSize
|
|
410
|
+
: hits.length;
|
|
411
|
+
return { hits, total };
|
|
412
|
+
}
|
|
413
|
+
//# sourceMappingURL=trieve-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trieve-search.js","sourceRoot":"","sources":["../../src/services/trieve-search.ts"],"names":[],"mappings":";;;AA6EA,wCAuBC;AASD,gCAuBC;AAgCD,gDA4CC;AAsMD,gDA4DC;AAOD,gDA2CC;AAGD,sCAcC;AAGD,0CAUC;AAGD,wCAGC;AAGD,oCAKC;AAMD,wCA6CC;AAnm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CAAC,EAAE,CAAC;YACjC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,KAAK,GACT,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ;QAClC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,QAAQ;QAC7B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAA;IAEjB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/services/trieve-search.ts","../src/services/__tests__/trieve-search.integration.spec.ts","../src/services/__tests__/trieve-search.spec.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etohq/search-trieve",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"description": "Trieve search provider for Eto",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/__tests__",
|
|
10
|
+
"!dist/**/__mocks__",
|
|
11
|
+
"!dist/**/__fixtures__"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"author": "Eto",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"trieve-ts-sdk": "0.0.124"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@etohq/framework": "2.0.5",
|
|
26
|
+
"@swc/core": "1.7.28",
|
|
27
|
+
"@swc/jest": "0.2.36",
|
|
28
|
+
"@types/jest": "29.5.14",
|
|
29
|
+
"jest": "29.7.0",
|
|
30
|
+
"rimraf": "5.0.2",
|
|
31
|
+
"tsc-alias": "1.8.6",
|
|
32
|
+
"typescript": "5.8.3"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@etohq/framework": "2.0.5"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"watch": "tsc --build --watch",
|
|
39
|
+
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
|
40
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
|
41
|
+
"test": "jest --silent --bail --forceExit"
|
|
42
|
+
}
|
|
6
43
|
}
|
package/README.md
DELETED