@usecortex_ai/node 0.3.4 → 0.3.6
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/api/resources/search/client/Client.d.ts +1 -1
- package/dist/api/resources/search/client/requests/SearchRequest.d.ts +7 -0
- package/dist/api/resources/sources/client/Client.d.ts +26 -0
- package/dist/api/resources/sources/client/Client.js +91 -0
- package/dist/api/resources/sources/client/requests/SourcesGetGraphRelationsByIdRequest.d.ts +18 -0
- package/dist/api/resources/sources/client/requests/index.d.ts +1 -0
- package/dist/api/resources/upload/client/Client.d.ts +83 -0
- package/dist/api/resources/upload/client/Client.js +278 -0
- package/dist/api/resources/{userMemory/client/requests/GenerateUserMemoryRequest.d.ts → upload/client/requests/UploadBatchScrapeWebpageRequest.d.ts} +7 -7
- package/dist/api/resources/upload/client/requests/UploadBatchUploadMarkdownRequest.d.ts +22 -0
- package/dist/api/resources/upload/client/requests/UploadBatchUploadMarkdownRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/UploadBatchUploadTextRequest.d.ts +22 -0
- package/dist/api/resources/upload/client/requests/UploadBatchUploadTextRequest.js +5 -0
- package/dist/api/resources/upload/client/requests/index.d.ts +3 -0
- package/dist/api/resources/userMemory/client/Client.d.ts +13 -45
- package/dist/api/resources/userMemory/client/Client.js +13 -110
- package/dist/api/resources/userMemory/client/requests/AddUserMemoryRequest.d.ts +12 -4
- package/dist/api/resources/userMemory/client/requests/index.d.ts +0 -1
- package/dist/api/types/AddUserMemoryResponse.d.ts +3 -1
- package/dist/api/types/ChunkGraphRelationsResponse.d.ts +13 -0
- package/dist/api/types/ChunkGraphRelationsResponse.js +5 -0
- package/dist/api/types/Entity.d.ts +15 -0
- package/dist/api/types/Entity.js +5 -0
- package/dist/api/types/ExtendedContext.d.ts +0 -2
- package/dist/api/types/GraphRelationsResponse.d.ts +12 -0
- package/dist/api/types/GraphRelationsResponse.js +5 -0
- package/dist/api/types/PathTriplet.d.ts +15 -0
- package/dist/api/types/PathTriplet.js +5 -0
- package/dist/api/types/RelationEvidence.d.ts +19 -0
- package/dist/api/types/RelationEvidence.js +5 -0
- package/dist/api/types/RetrieveMode.d.ts +8 -0
- package/dist/api/types/RetrieveMode.js +10 -0
- package/dist/api/types/RetrieveResponse.d.ts +12 -0
- package/dist/api/types/RetrieveResponse.js +5 -0
- package/dist/api/types/RetrieveUserMemoryResponse.d.ts +2 -0
- package/dist/api/types/ScoredPathResponse.d.ts +18 -0
- package/dist/api/types/ScoredPathResponse.js +5 -0
- package/dist/api/types/ScoredTripletResponse.d.ts +17 -0
- package/dist/api/types/ScoredTripletResponse.js +5 -0
- package/dist/api/types/SearchChunk.d.ts +5 -0
- package/dist/api/types/TripleWithEvidence.d.ts +12 -0
- package/dist/api/types/TripleWithEvidence.js +5 -0
- package/dist/api/types/UserAssistantPair.d.ts +9 -0
- package/dist/api/types/UserAssistantPair.js +5 -0
- package/dist/api/types/WebpageScrapeRequest.d.ts +9 -0
- package/dist/api/types/WebpageScrapeRequest.js +5 -0
- package/dist/api/types/index.d.ts +12 -1
- package/dist/api/types/index.js +12 -1
- package/package.json +1 -1
- package/dist/api/types/GenerateUserMemoryResponse.d.ts +0 -13
- /package/dist/api/resources/{userMemory/client/requests/GenerateUserMemoryRequest.js → sources/client/requests/SourcesGetGraphRelationsByIdRequest.js} +0 -0
- /package/dist/api/{types/GenerateUserMemoryResponse.js → resources/upload/client/requests/UploadBatchScrapeWebpageRequest.js} +0 -0
|
@@ -7,8 +7,11 @@ export { type UploadUploadMarkdownRequest } from "./UploadUploadMarkdownRequest.
|
|
|
7
7
|
export { type UploadUploadTextRequest } from "./UploadUploadTextRequest.js";
|
|
8
8
|
export { type UploadUpdateMarkdownRequest } from "./UploadUpdateMarkdownRequest.js";
|
|
9
9
|
export { type UploadUpdateTextRequest } from "./UploadUpdateTextRequest.js";
|
|
10
|
+
export { type UploadBatchUploadMarkdownRequest } from "./UploadBatchUploadMarkdownRequest.js";
|
|
11
|
+
export { type UploadBatchUploadTextRequest } from "./UploadBatchUploadTextRequest.js";
|
|
10
12
|
export { type EmbeddingsUploadRequest } from "./EmbeddingsUploadRequest.js";
|
|
11
13
|
export { type EmbeddingsUpdateRequest } from "./EmbeddingsUpdateRequest.js";
|
|
12
14
|
export { type UploadScrapeWebpageRequest } from "./UploadScrapeWebpageRequest.js";
|
|
13
15
|
export { type UploadUpdateWebpageRequest } from "./UploadUpdateWebpageRequest.js";
|
|
16
|
+
export { type UploadBatchScrapeWebpageRequest } from "./UploadBatchScrapeWebpageRequest.js";
|
|
14
17
|
export { type UploadVerifyProcessingRequest } from "./UploadVerifyProcessingRequest.js";
|
|
@@ -87,14 +87,14 @@ export declare class UserMemory {
|
|
|
87
87
|
deleteUserMemory(request: CortexAI.UserMemoryDeleteUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<CortexAI.DeleteUserMemoryResponse>;
|
|
88
88
|
private __deleteUserMemory;
|
|
89
89
|
/**
|
|
90
|
-
* Find relevant user memories using semantic search.
|
|
90
|
+
* Find relevant user memories using semantic search and knowledge graph.
|
|
91
91
|
*
|
|
92
|
-
* This endpoint performs
|
|
93
|
-
*
|
|
94
|
-
*
|
|
92
|
+
* This endpoint performs parallel searches:
|
|
93
|
+
* 1. Semantic search in Weaviate across all stored user memories
|
|
94
|
+
* 2. Entity-based search in the knowledge graph for memory entities
|
|
95
95
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
96
|
+
* Results from both sources are combined and ranked by relevance to provide
|
|
97
|
+
* comprehensive memory retrieval.
|
|
98
98
|
*
|
|
99
99
|
* @param {CortexAI.RetrieveUserMemoryRequest} request
|
|
100
100
|
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -118,45 +118,14 @@ export declare class UserMemory {
|
|
|
118
118
|
retrieveUserMemory(request: CortexAI.RetrieveUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<CortexAI.RetrieveUserMemoryResponse>;
|
|
119
119
|
private __retrieveUserMemory;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* Store new user memories for future reference.
|
|
122
122
|
*
|
|
123
|
-
* This endpoint
|
|
124
|
-
*
|
|
125
|
-
*
|
|
123
|
+
* This endpoint allows you to add memories in two formats:
|
|
124
|
+
* 1. Raw text string - A single text-based memory
|
|
125
|
+
* 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
|
|
126
126
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* @param {CortexAI.GenerateUserMemoryRequest} request
|
|
131
|
-
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
-
*
|
|
133
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
134
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
135
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
136
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
137
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
138
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
139
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* await client.userMemory.generateUserMemory({
|
|
143
|
-
* tenant_id: "tenant_1234",
|
|
144
|
-
* sub_tenant_id: "sub_tenant_4567",
|
|
145
|
-
* user_message: "I prefer detailed technical explanations and works in the Pacific timezone",
|
|
146
|
-
* user_name: "John Doe"
|
|
147
|
-
* })
|
|
148
|
-
*/
|
|
149
|
-
generateUserMemory(request: CortexAI.GenerateUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<CortexAI.GenerateUserMemoryResponse>;
|
|
150
|
-
private __generateUserMemory;
|
|
151
|
-
/**
|
|
152
|
-
* Store a new user memory for future reference.
|
|
153
|
-
*
|
|
154
|
-
* This endpoint allows you to manually add a memory that will be stored and
|
|
155
|
-
* can be retrieved later through memory search. Use this to save important
|
|
156
|
-
* preferences, context, or information that you want the system to remember.
|
|
157
|
-
*
|
|
158
|
-
* The stored memory will be indexed and available for semantic search, making
|
|
159
|
-
* it accessible when relevant to future queries or interactions.
|
|
127
|
+
* The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
|
|
128
|
+
* and made available for semantic search and graph-based retrieval.
|
|
160
129
|
*
|
|
161
130
|
* @param {CortexAI.AddUserMemoryRequest} request
|
|
162
131
|
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -172,8 +141,7 @@ export declare class UserMemory {
|
|
|
172
141
|
* @example
|
|
173
142
|
* await client.userMemory.addUserMemory({
|
|
174
143
|
* tenant_id: "tenant_1234",
|
|
175
|
-
* sub_tenant_id: "sub_tenant_4567"
|
|
176
|
-
* user_memory: "I prefer detailed technical explanations and works in the Pacific timezone"
|
|
144
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
177
145
|
* })
|
|
178
146
|
*/
|
|
179
147
|
addUserMemory(request: CortexAI.AddUserMemoryRequest, requestOptions?: UserMemory.RequestOptions): core.HttpResponsePromise<CortexAI.AddUserMemoryResponse>;
|
|
@@ -230,14 +230,14 @@ class UserMemory {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
233
|
-
* Find relevant user memories using semantic search.
|
|
233
|
+
* Find relevant user memories using semantic search and knowledge graph.
|
|
234
234
|
*
|
|
235
|
-
* This endpoint performs
|
|
236
|
-
*
|
|
237
|
-
*
|
|
235
|
+
* This endpoint performs parallel searches:
|
|
236
|
+
* 1. Semantic search in Weaviate across all stored user memories
|
|
237
|
+
* 2. Entity-based search in the knowledge graph for memory entities
|
|
238
238
|
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
239
|
+
* Results from both sources are combined and ranked by relevance to provide
|
|
240
|
+
* comprehensive memory retrieval.
|
|
241
241
|
*
|
|
242
242
|
* @param {CortexAI.RetrieveUserMemoryRequest} request
|
|
243
243
|
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -329,110 +329,14 @@ class UserMemory {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
/**
|
|
332
|
-
*
|
|
332
|
+
* Store new user memories for future reference.
|
|
333
333
|
*
|
|
334
|
-
* This endpoint
|
|
335
|
-
*
|
|
336
|
-
*
|
|
334
|
+
* This endpoint allows you to add memories in two formats:
|
|
335
|
+
* 1. Raw text string - A single text-based memory
|
|
336
|
+
* 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
|
|
337
337
|
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* @param {CortexAI.GenerateUserMemoryRequest} request
|
|
342
|
-
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
343
|
-
*
|
|
344
|
-
* @throws {@link CortexAI.BadRequestError}
|
|
345
|
-
* @throws {@link CortexAI.UnauthorizedError}
|
|
346
|
-
* @throws {@link CortexAI.ForbiddenError}
|
|
347
|
-
* @throws {@link CortexAI.NotFoundError}
|
|
348
|
-
* @throws {@link CortexAI.UnprocessableEntityError}
|
|
349
|
-
* @throws {@link CortexAI.InternalServerError}
|
|
350
|
-
* @throws {@link CortexAI.ServiceUnavailableError}
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* await client.userMemory.generateUserMemory({
|
|
354
|
-
* tenant_id: "tenant_1234",
|
|
355
|
-
* sub_tenant_id: "sub_tenant_4567",
|
|
356
|
-
* user_message: "I prefer detailed technical explanations and works in the Pacific timezone",
|
|
357
|
-
* user_name: "John Doe"
|
|
358
|
-
* })
|
|
359
|
-
*/
|
|
360
|
-
generateUserMemory(request, requestOptions) {
|
|
361
|
-
return core.HttpResponsePromise.fromPromise(this.__generateUserMemory(request, requestOptions));
|
|
362
|
-
}
|
|
363
|
-
async __generateUserMemory(request, requestOptions) {
|
|
364
|
-
var _a, _b, _c;
|
|
365
|
-
const { tenant_id: tenantId, sub_tenant_id: subTenantId } = request, _body = __rest(request, ["tenant_id", "sub_tenant_id"]);
|
|
366
|
-
const _queryParams = {};
|
|
367
|
-
_queryParams["tenant_id"] = tenantId;
|
|
368
|
-
if (subTenantId != null) {
|
|
369
|
-
_queryParams["sub_tenant_id"] = subTenantId;
|
|
370
|
-
}
|
|
371
|
-
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
372
|
-
const _response = await core.fetcher({
|
|
373
|
-
url: core.url.join((_c = (_b = (await core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (await core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CortexAIEnvironment.CortexProd, "user_memory/generate_user_memory"),
|
|
374
|
-
method: "POST",
|
|
375
|
-
headers: _headers,
|
|
376
|
-
contentType: "application/json",
|
|
377
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
378
|
-
requestType: "json",
|
|
379
|
-
body: _body,
|
|
380
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
381
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
382
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
383
|
-
});
|
|
384
|
-
if (_response.ok) {
|
|
385
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
386
|
-
}
|
|
387
|
-
if (_response.error.reason === "status-code") {
|
|
388
|
-
switch (_response.error.statusCode) {
|
|
389
|
-
case 400:
|
|
390
|
-
throw new CortexAI.BadRequestError(_response.error.body, _response.rawResponse);
|
|
391
|
-
case 401:
|
|
392
|
-
throw new CortexAI.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
393
|
-
case 403:
|
|
394
|
-
throw new CortexAI.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
395
|
-
case 404:
|
|
396
|
-
throw new CortexAI.NotFoundError(_response.error.body, _response.rawResponse);
|
|
397
|
-
case 422:
|
|
398
|
-
throw new CortexAI.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
399
|
-
case 500:
|
|
400
|
-
throw new CortexAI.InternalServerError(_response.error.body, _response.rawResponse);
|
|
401
|
-
case 503:
|
|
402
|
-
throw new CortexAI.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
403
|
-
default:
|
|
404
|
-
throw new errors.CortexAIError({
|
|
405
|
-
statusCode: _response.error.statusCode,
|
|
406
|
-
body: _response.error.body,
|
|
407
|
-
rawResponse: _response.rawResponse,
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
switch (_response.error.reason) {
|
|
412
|
-
case "non-json":
|
|
413
|
-
throw new errors.CortexAIError({
|
|
414
|
-
statusCode: _response.error.statusCode,
|
|
415
|
-
body: _response.error.rawBody,
|
|
416
|
-
rawResponse: _response.rawResponse,
|
|
417
|
-
});
|
|
418
|
-
case "timeout":
|
|
419
|
-
throw new errors.CortexAITimeoutError("Timeout exceeded when calling POST /user_memory/generate_user_memory.");
|
|
420
|
-
case "unknown":
|
|
421
|
-
throw new errors.CortexAIError({
|
|
422
|
-
message: _response.error.errorMessage,
|
|
423
|
-
rawResponse: _response.rawResponse,
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Store a new user memory for future reference.
|
|
429
|
-
*
|
|
430
|
-
* This endpoint allows you to manually add a memory that will be stored and
|
|
431
|
-
* can be retrieved later through memory search. Use this to save important
|
|
432
|
-
* preferences, context, or information that you want the system to remember.
|
|
433
|
-
*
|
|
434
|
-
* The stored memory will be indexed and available for semantic search, making
|
|
435
|
-
* it accessible when relevant to future queries or interactions.
|
|
338
|
+
* The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
|
|
339
|
+
* and made available for semantic search and graph-based retrieval.
|
|
436
340
|
*
|
|
437
341
|
* @param {CortexAI.AddUserMemoryRequest} request
|
|
438
342
|
* @param {UserMemory.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -448,8 +352,7 @@ class UserMemory {
|
|
|
448
352
|
* @example
|
|
449
353
|
* await client.userMemory.addUserMemory({
|
|
450
354
|
* tenant_id: "tenant_1234",
|
|
451
|
-
* sub_tenant_id: "sub_tenant_4567"
|
|
452
|
-
* user_memory: "I prefer detailed technical explanations and works in the Pacific timezone"
|
|
355
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
453
356
|
* })
|
|
454
357
|
*/
|
|
455
358
|
addUserMemory(request, requestOptions) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as CortexAI from "../../../../index.js";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
7
8
|
* tenant_id: "tenant_1234",
|
|
8
|
-
* sub_tenant_id: "sub_tenant_4567"
|
|
9
|
-
* user_memory: "I prefer detailed technical explanations and works in the Pacific timezone"
|
|
9
|
+
* sub_tenant_id: "sub_tenant_4567"
|
|
10
10
|
* }
|
|
11
11
|
*/
|
|
12
12
|
export interface AddUserMemoryRequest {
|
|
@@ -14,6 +14,14 @@ export interface AddUserMemoryRequest {
|
|
|
14
14
|
tenant_id: string;
|
|
15
15
|
/** Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used. */
|
|
16
16
|
sub_tenant_id?: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Single raw text memory to store. If both raw_text and user_assistant_pairs are provided, raw_text will be used. */
|
|
18
|
+
raw_text?: string;
|
|
19
|
+
/** Array of user/assistant conversation pairs to store as a single memory */
|
|
20
|
+
user_assistant_pairs?: CortexAI.UserAssistantPair[];
|
|
21
|
+
/** Expiry time in seconds for the memory (optional) */
|
|
22
|
+
expiry_time?: number;
|
|
23
|
+
/** If true, process and compress chunks into inferred representations before indexing (default: False) */
|
|
24
|
+
infer?: boolean;
|
|
25
|
+
/** Custom instructions to guide cortex */
|
|
26
|
+
custom_instructions?: string;
|
|
19
27
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { type UserMemoryListUserMemoriesRequest } from "./UserMemoryListUserMemoriesRequest.js";
|
|
2
2
|
export { type UserMemoryDeleteUserMemoryRequest } from "./UserMemoryDeleteUserMemoryRequest.js";
|
|
3
3
|
export { type RetrieveUserMemoryRequest } from "./RetrieveUserMemoryRequest.js";
|
|
4
|
-
export { type GenerateUserMemoryRequest } from "./GenerateUserMemoryRequest.js";
|
|
5
4
|
export { type AddUserMemoryRequest } from "./AddUserMemoryRequest.js";
|
|
@@ -10,5 +10,7 @@ export interface AddUserMemoryResponse {
|
|
|
10
10
|
/** Confirms whether the memory was successfully stored in the system */
|
|
11
11
|
user_memory_added: boolean;
|
|
12
12
|
/** Unique identifier assigned to the newly created memory */
|
|
13
|
-
memory_id
|
|
13
|
+
memory_id: string;
|
|
14
|
+
/** Total number of chunks created from the memory */
|
|
15
|
+
chunks_created?: number;
|
|
14
16
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Graph relations with group_id -> triplet mapping
|
|
7
|
+
*/
|
|
8
|
+
export interface ChunkGraphRelationsResponse {
|
|
9
|
+
/** Multi-hop paths connecting entities from the query, reranked by relevance. Each path is a chain of connected triplets. */
|
|
10
|
+
entity_paths?: CortexAI.ScoredPathResponse[];
|
|
11
|
+
/** Mapping of group_id to scored triplet. Use chunk.graph_triplet_ids to find which groups belong to a chunk. */
|
|
12
|
+
chunk_triplets?: Record<string, CortexAI.ScoredTripletResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface Entity {
|
|
5
|
+
/** Normalized entity name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** PERSON, ORGANIZATION, PROJECT, PRODUCT, ERROR_CODE, etc. */
|
|
8
|
+
type: string;
|
|
9
|
+
/** Context category like 'employees', 'projects' */
|
|
10
|
+
namespace?: string;
|
|
11
|
+
/** Unique ID like email, employee_id, URL */
|
|
12
|
+
identifier?: string;
|
|
13
|
+
/** Internal unique entity ID from graph database */
|
|
14
|
+
entity_id?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
export interface GraphRelationsResponse {
|
|
6
|
+
/** List of relations retrieved */
|
|
7
|
+
relations: (CortexAI.TripleWithEvidence | undefined)[];
|
|
8
|
+
/** Indicates whether the request was successful */
|
|
9
|
+
success?: boolean;
|
|
10
|
+
/** Response message describing the operation result */
|
|
11
|
+
message?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Single triplet within a path (without score, as the path is scored as a whole)
|
|
7
|
+
*/
|
|
8
|
+
export interface PathTriplet {
|
|
9
|
+
/** Source entity */
|
|
10
|
+
source: CortexAI.Entity;
|
|
11
|
+
/** Target entity */
|
|
12
|
+
target: CortexAI.Entity;
|
|
13
|
+
/** Relation between entities */
|
|
14
|
+
relation: CortexAI.RelationEvidence;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface RelationEvidence {
|
|
5
|
+
/** Unique identifier for this specific relationship edge in the graph. The combination of source entity, target entity, and relationship_id allows disambiguation between multiple relations between the same source and target entities. */
|
|
6
|
+
relationship_id?: string;
|
|
7
|
+
/** Relationship phrase like 'works for', 'reports to' */
|
|
8
|
+
canonical_predicate: string;
|
|
9
|
+
/** Original predicate from text */
|
|
10
|
+
raw_predicate: string;
|
|
11
|
+
/** Rich contextual description of the relationship with surrounding information, details about how/why/when, and any relevant background. Should be comprehensive enough to understand the relationship without referring back to source. */
|
|
12
|
+
context: string;
|
|
13
|
+
/** Temporal timing information extracted from text (e.g., 'last week', 'in 2023', 'yesterday') */
|
|
14
|
+
temporal_details?: string;
|
|
15
|
+
/** The chunk_id this relation came from */
|
|
16
|
+
chunk_id?: string;
|
|
17
|
+
/** Timestamp when this relation was introduced */
|
|
18
|
+
timestamp?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RetrieveMode = void 0;
|
|
7
|
+
exports.RetrieveMode = {
|
|
8
|
+
Fast: "fast",
|
|
9
|
+
Accurate: "accurate",
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
export interface RetrieveResponse {
|
|
6
|
+
/** Retrieved content chunks */
|
|
7
|
+
chunks?: CortexAI.SearchChunk[];
|
|
8
|
+
/** Graph relations with chunk_relations (by chunk_id) and entity_relations (top entity matches) */
|
|
9
|
+
graph_relations?: CortexAI.ChunkGraphRelationsResponse;
|
|
10
|
+
/** Additional metadata about the retrieval run */
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
}
|
|
@@ -10,4 +10,6 @@ export interface RetrieveUserMemoryResponse {
|
|
|
10
10
|
success: boolean;
|
|
11
11
|
/** Array of user memories ranked by relevance to your search query */
|
|
12
12
|
retrieved_user_memories?: CortexAI.UserMemory[];
|
|
13
|
+
/** Array of scored relations extracted from the user query via knowledge graph search */
|
|
14
|
+
relations?: CortexAI.ScoredPathResponse[];
|
|
13
15
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* A multi-hop path (chain of triplets) with a relevancy score.
|
|
7
|
+
*
|
|
8
|
+
* Represents connected paths like: A --rel1--> B --rel2--> C
|
|
9
|
+
* The triplets list preserves the chain order.
|
|
10
|
+
*/
|
|
11
|
+
export interface ScoredPathResponse {
|
|
12
|
+
/** Merged context from all triplets in the path */
|
|
13
|
+
combined_context?: string;
|
|
14
|
+
/** Ordered list of triplets forming the path chain */
|
|
15
|
+
triplets: CortexAI.PathTriplet[];
|
|
16
|
+
/** Relevancy score for the entire path */
|
|
17
|
+
relevancy_score?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Individual scored triplet for entity-based search results
|
|
7
|
+
*/
|
|
8
|
+
export interface ScoredTripletResponse {
|
|
9
|
+
/** Source entity */
|
|
10
|
+
source: CortexAI.Entity;
|
|
11
|
+
/** Target entity */
|
|
12
|
+
target: CortexAI.Entity;
|
|
13
|
+
/** Relation between entities */
|
|
14
|
+
relation: CortexAI.RelationEvidence;
|
|
15
|
+
/** Relevancy score from reranking */
|
|
16
|
+
relevancy_score?: number;
|
|
17
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
4
5
|
export interface SearchChunk {
|
|
5
6
|
/** Unique identifier for this content chunk */
|
|
6
7
|
chunk_uuid: string;
|
|
@@ -24,4 +25,8 @@ export interface SearchChunk {
|
|
|
24
25
|
document_metadata?: Record<string, unknown>;
|
|
25
26
|
/** Custom metadata associated with your tenant */
|
|
26
27
|
tenant_metadata?: Record<string, unknown>;
|
|
28
|
+
/** Additional context for this chunk */
|
|
29
|
+
extra_context?: CortexAI.ExtendedContext;
|
|
30
|
+
/** List of group IDs for triplets linked to this chunk. Lookup triplet data in graph_relations.chunk_relations[group_id] */
|
|
31
|
+
graph_triplet_ids?: string[];
|
|
27
32
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as CortexAI from "../index.js";
|
|
5
|
+
export interface TripleWithEvidence {
|
|
6
|
+
source: CortexAI.Entity;
|
|
7
|
+
target: CortexAI.Entity;
|
|
8
|
+
/** Array of relation evidences */
|
|
9
|
+
relations: CortexAI.RelationEvidence[];
|
|
10
|
+
/** The chunk_id these relations are associated with */
|
|
11
|
+
chunk_id: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface WebpageScrapeRequest {
|
|
5
|
+
/** The URL of the webpage to scrape and index */
|
|
6
|
+
web_url: string;
|
|
7
|
+
/** Optional custom file ID for the scraped content. If not provided, a unique ID will be generated */
|
|
8
|
+
file_id?: string;
|
|
9
|
+
}
|