convex-agent-knowledge 0.0.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/LICENSE +73 -0
- package/README.md +156 -0
- package/dist/client/chunking.d.ts +7 -0
- package/dist/client/chunking.d.ts.map +1 -0
- package/dist/client/chunking.js +36 -0
- package/dist/client/chunking.js.map +1 -0
- package/dist/client/extraction.d.ts +9 -0
- package/dist/client/extraction.d.ts.map +1 -0
- package/dist/client/extraction.js +88 -0
- package/dist/client/extraction.js.map +1 -0
- package/dist/client/hash.d.ts +3 -0
- package/dist/client/hash.d.ts.map +1 -0
- package/dist/client/hash.js +17 -0
- package/dist/client/hash.js.map +1 -0
- package/dist/client/index.d.ts +99 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +194 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.d.ts +126 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +40 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +277 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/actions.d.ts +12 -0
- package/dist/component/actions.d.ts.map +1 -0
- package/dist/component/actions.js +42 -0
- package/dist/component/actions.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +4 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/mutations.d.ts +85 -0
- package/dist/component/mutations.d.ts.map +1 -0
- package/dist/component/mutations.js +407 -0
- package/dist/component/mutations.js.map +1 -0
- package/dist/component/queries.d.ts +95 -0
- package/dist/component/queries.d.ts.map +1 -0
- package/dist/component/queries.js +181 -0
- package/dist/component/queries.js.map +1 -0
- package/dist/component/schema.d.ts +442 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +140 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/validators.d.ts +158 -0
- package/dist/component/validators.d.ts.map +1 -0
- package/dist/component/validators.js +90 -0
- package/dist/component/validators.js.map +1 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +2 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/neo4j.d.ts +5 -0
- package/dist/node/neo4j.d.ts.map +1 -0
- package/dist/node/neo4j.js +147 -0
- package/dist/node/neo4j.js.map +1 -0
- package/dist/shared/ranking.d.ts +17 -0
- package/dist/shared/ranking.d.ts.map +1 -0
- package/dist/shared/ranking.js +44 -0
- package/dist/shared/ranking.js.map +1 -0
- package/package.json +84 -0
- package/src/client/chunking.test.ts +25 -0
- package/src/client/chunking.ts +45 -0
- package/src/client/extraction.test.ts +15 -0
- package/src/client/extraction.ts +108 -0
- package/src/client/hash.test.ts +17 -0
- package/src/client/hash.ts +17 -0
- package/src/client/index.ts +307 -0
- package/src/client/types.ts +141 -0
- package/src/component/_generated/api.ts +56 -0
- package/src/component/_generated/component.ts +310 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/actions.ts +47 -0
- package/src/component/convex.config.ts +5 -0
- package/src/component/mutations.ts +445 -0
- package/src/component/queries.ts +202 -0
- package/src/component/schema.ts +161 -0
- package/src/component/validators.ts +104 -0
- package/src/node/index.ts +2 -0
- package/src/node/neo4j.ts +210 -0
- package/src/shared/ranking.test.ts +30 -0
- package/src/shared/ranking.ts +64 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export type SearchType = "semantic" | "graph" | "hybrid";
|
|
2
|
+
|
|
3
|
+
export type MemorySource = {
|
|
4
|
+
type: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ExtractedEntity = {
|
|
11
|
+
externalId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
aliases?: string[];
|
|
16
|
+
confidence?: number;
|
|
17
|
+
metadata?: unknown;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type ExtractedRelationship = {
|
|
21
|
+
fromEntityExternalId: string;
|
|
22
|
+
toEntityExternalId: string;
|
|
23
|
+
type: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
confidence?: number;
|
|
26
|
+
weight?: number;
|
|
27
|
+
metadata?: unknown;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ExtractedKnowledge = {
|
|
31
|
+
entities: ExtractedEntity[];
|
|
32
|
+
relationships: ExtractedRelationship[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ChunkInput = {
|
|
36
|
+
text: string;
|
|
37
|
+
summary?: string;
|
|
38
|
+
tokenCount?: number;
|
|
39
|
+
metadata?: unknown;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type EmbeddedChunkInput = ChunkInput & {
|
|
43
|
+
embedding: number[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type Neo4jConfig = {
|
|
47
|
+
uri: string;
|
|
48
|
+
user: string;
|
|
49
|
+
password: string;
|
|
50
|
+
database?: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type GraphSyncJob = {
|
|
54
|
+
jobId: string;
|
|
55
|
+
namespace: string;
|
|
56
|
+
operation: "upsert_memory" | "delete_memory" | "promote_memory";
|
|
57
|
+
attempts: number;
|
|
58
|
+
payload: unknown;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type GraphMemoryScore = {
|
|
62
|
+
memoryId: string;
|
|
63
|
+
graphScore: number;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type GraphExpandInput = {
|
|
67
|
+
namespace: string;
|
|
68
|
+
seedMemoryIds: string[];
|
|
69
|
+
entityHints?: string[];
|
|
70
|
+
hops?: number;
|
|
71
|
+
limit?: number;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type GraphStore = {
|
|
75
|
+
syncJob: (job: GraphSyncJob) => Promise<void>;
|
|
76
|
+
expand: (input: GraphExpandInput) => Promise<GraphMemoryScore[]>;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type MemoryCard = {
|
|
80
|
+
memoryId: string;
|
|
81
|
+
namespace: string;
|
|
82
|
+
key?: string;
|
|
83
|
+
agentId?: string;
|
|
84
|
+
text: string;
|
|
85
|
+
score: number;
|
|
86
|
+
semanticScore?: number;
|
|
87
|
+
graphScore?: number;
|
|
88
|
+
importance: number;
|
|
89
|
+
source?: MemorySource;
|
|
90
|
+
metadata?: unknown;
|
|
91
|
+
entities: Array<{
|
|
92
|
+
externalId: string;
|
|
93
|
+
name: string;
|
|
94
|
+
type: string;
|
|
95
|
+
description?: string;
|
|
96
|
+
confidence: number;
|
|
97
|
+
}>;
|
|
98
|
+
relationships: Array<{
|
|
99
|
+
fromEntityExternalId: string;
|
|
100
|
+
toEntityExternalId: string;
|
|
101
|
+
type: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
confidence: number;
|
|
104
|
+
weight: number;
|
|
105
|
+
}>;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type AgentKnowledgeComponent = {
|
|
109
|
+
actions: {
|
|
110
|
+
recall: unknown;
|
|
111
|
+
};
|
|
112
|
+
mutations: {
|
|
113
|
+
remember: unknown;
|
|
114
|
+
observe: unknown;
|
|
115
|
+
promote: unknown;
|
|
116
|
+
deleteByKey: unknown;
|
|
117
|
+
markGraphSyncJobRunning: unknown;
|
|
118
|
+
markGraphSyncJobSucceeded: unknown;
|
|
119
|
+
markGraphSyncJobFailed: unknown;
|
|
120
|
+
};
|
|
121
|
+
queries: {
|
|
122
|
+
getMemory: unknown;
|
|
123
|
+
listMemories: unknown;
|
|
124
|
+
fetchMemoryCards: unknown;
|
|
125
|
+
listPendingGraphSyncJobs: unknown;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export type ConvexActionCtx = {
|
|
130
|
+
runAction: (functionReference: unknown, args: Record<string, unknown>) => Promise<any>;
|
|
131
|
+
runMutation: (functionReference: unknown, args: Record<string, unknown>) => Promise<any>;
|
|
132
|
+
runQuery: (functionReference: unknown, args: Record<string, unknown>) => Promise<any>;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export type ConvexMutationCtx = {
|
|
136
|
+
runMutation: (functionReference: unknown, args: Record<string, unknown>) => Promise<any>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export type ConvexQueryCtx = {
|
|
140
|
+
runQuery: (functionReference: unknown, args: Record<string, unknown>) => Promise<any>;
|
|
141
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type * as actions from "../actions.js";
|
|
12
|
+
import type * as mutations from "../mutations.js";
|
|
13
|
+
import type * as queries from "../queries.js";
|
|
14
|
+
import type * as validators from "../validators.js";
|
|
15
|
+
|
|
16
|
+
import type {
|
|
17
|
+
ApiFromModules,
|
|
18
|
+
FilterApi,
|
|
19
|
+
FunctionReference,
|
|
20
|
+
} from "convex/server";
|
|
21
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
22
|
+
|
|
23
|
+
const fullApi: ApiFromModules<{
|
|
24
|
+
actions: typeof actions;
|
|
25
|
+
mutations: typeof mutations;
|
|
26
|
+
queries: typeof queries;
|
|
27
|
+
validators: typeof validators;
|
|
28
|
+
}> = anyApi as any;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
32
|
+
*
|
|
33
|
+
* Usage:
|
|
34
|
+
* ```js
|
|
35
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export const api: FilterApi<
|
|
39
|
+
typeof fullApi,
|
|
40
|
+
FunctionReference<any, "public">
|
|
41
|
+
> = anyApi as any;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
45
|
+
*
|
|
46
|
+
* Usage:
|
|
47
|
+
* ```js
|
|
48
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export const internal: FilterApi<
|
|
52
|
+
typeof fullApi,
|
|
53
|
+
FunctionReference<any, "internal">
|
|
54
|
+
> = anyApi as any;
|
|
55
|
+
|
|
56
|
+
export const components = componentsGeneric() as unknown as {};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `ComponentApi` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { FunctionReference } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing a Convex component's exposed API.
|
|
15
|
+
*
|
|
16
|
+
* Useful when expecting a parameter like `components.myComponent`.
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
20
|
+
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
25
|
+
{
|
|
26
|
+
actions: {
|
|
27
|
+
recall: FunctionReference<
|
|
28
|
+
"action",
|
|
29
|
+
"internal",
|
|
30
|
+
{
|
|
31
|
+
agentId?: string;
|
|
32
|
+
embeddingDimension: number;
|
|
33
|
+
limit?: number;
|
|
34
|
+
namespace: string;
|
|
35
|
+
query: string;
|
|
36
|
+
queryEmbedding?: Array<number>;
|
|
37
|
+
searchType?: "semantic" | "graph" | "hybrid";
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
results: Array<{
|
|
41
|
+
agentId?: string;
|
|
42
|
+
entities: Array<{
|
|
43
|
+
confidence: number;
|
|
44
|
+
description?: string;
|
|
45
|
+
externalId: string;
|
|
46
|
+
name: string;
|
|
47
|
+
type: string;
|
|
48
|
+
}>;
|
|
49
|
+
graphScore?: number;
|
|
50
|
+
importance: number;
|
|
51
|
+
key?: string;
|
|
52
|
+
memoryId: string;
|
|
53
|
+
metadata?: any;
|
|
54
|
+
namespace: string;
|
|
55
|
+
relationships: Array<{
|
|
56
|
+
confidence: number;
|
|
57
|
+
description?: string;
|
|
58
|
+
fromEntityExternalId: string;
|
|
59
|
+
toEntityExternalId: string;
|
|
60
|
+
type: string;
|
|
61
|
+
weight: number;
|
|
62
|
+
}>;
|
|
63
|
+
score: number;
|
|
64
|
+
semanticScore?: number;
|
|
65
|
+
source?: {
|
|
66
|
+
id?: string;
|
|
67
|
+
title?: string;
|
|
68
|
+
type: string;
|
|
69
|
+
url?: string;
|
|
70
|
+
};
|
|
71
|
+
text: string;
|
|
72
|
+
}>;
|
|
73
|
+
},
|
|
74
|
+
Name
|
|
75
|
+
>;
|
|
76
|
+
};
|
|
77
|
+
mutations: {
|
|
78
|
+
deleteByKey: FunctionReference<
|
|
79
|
+
"mutation",
|
|
80
|
+
"internal",
|
|
81
|
+
{ key: string; namespace: string },
|
|
82
|
+
{ deleted: boolean; graphSyncJobId?: string; memoryId?: string },
|
|
83
|
+
Name
|
|
84
|
+
>;
|
|
85
|
+
markGraphSyncJobFailed: FunctionReference<
|
|
86
|
+
"mutation",
|
|
87
|
+
"internal",
|
|
88
|
+
{ error: string; jobId: string },
|
|
89
|
+
null,
|
|
90
|
+
Name
|
|
91
|
+
>;
|
|
92
|
+
markGraphSyncJobRunning: FunctionReference<
|
|
93
|
+
"mutation",
|
|
94
|
+
"internal",
|
|
95
|
+
{ jobId: string },
|
|
96
|
+
null,
|
|
97
|
+
Name
|
|
98
|
+
>;
|
|
99
|
+
markGraphSyncJobSucceeded: FunctionReference<
|
|
100
|
+
"mutation",
|
|
101
|
+
"internal",
|
|
102
|
+
{ jobId: string },
|
|
103
|
+
null,
|
|
104
|
+
Name
|
|
105
|
+
>;
|
|
106
|
+
observe: FunctionReference<
|
|
107
|
+
"mutation",
|
|
108
|
+
"internal",
|
|
109
|
+
{
|
|
110
|
+
feedback?: string;
|
|
111
|
+
memoryId: string;
|
|
112
|
+
metadata?: any;
|
|
113
|
+
namespace: string;
|
|
114
|
+
outcome: "helpful" | "not_helpful" | "neutral";
|
|
115
|
+
query: string;
|
|
116
|
+
},
|
|
117
|
+
null,
|
|
118
|
+
Name
|
|
119
|
+
>;
|
|
120
|
+
promote: FunctionReference<
|
|
121
|
+
"mutation",
|
|
122
|
+
"internal",
|
|
123
|
+
{ limit?: number; namespace: string },
|
|
124
|
+
{ promoted: number },
|
|
125
|
+
Name
|
|
126
|
+
>;
|
|
127
|
+
remember: FunctionReference<
|
|
128
|
+
"mutation",
|
|
129
|
+
"internal",
|
|
130
|
+
{
|
|
131
|
+
agentId?: string;
|
|
132
|
+
chunks: Array<{
|
|
133
|
+
embedding: Array<number>;
|
|
134
|
+
metadata?: any;
|
|
135
|
+
summary?: string;
|
|
136
|
+
text: string;
|
|
137
|
+
tokenCount?: number;
|
|
138
|
+
}>;
|
|
139
|
+
contentHash: string;
|
|
140
|
+
embeddingDimension: number;
|
|
141
|
+
entities: Array<{
|
|
142
|
+
aliases?: Array<string>;
|
|
143
|
+
confidence?: number;
|
|
144
|
+
description?: string;
|
|
145
|
+
externalId: string;
|
|
146
|
+
metadata?: any;
|
|
147
|
+
name: string;
|
|
148
|
+
type: string;
|
|
149
|
+
}>;
|
|
150
|
+
importance?: number;
|
|
151
|
+
key?: string;
|
|
152
|
+
metadata?: any;
|
|
153
|
+
namespace: string;
|
|
154
|
+
relationships: Array<{
|
|
155
|
+
confidence?: number;
|
|
156
|
+
description?: string;
|
|
157
|
+
fromEntityExternalId: string;
|
|
158
|
+
metadata?: any;
|
|
159
|
+
toEntityExternalId: string;
|
|
160
|
+
type: string;
|
|
161
|
+
weight?: number;
|
|
162
|
+
}>;
|
|
163
|
+
source?: { id?: string; title?: string; type: string; url?: string };
|
|
164
|
+
text: string;
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
chunkCount: number;
|
|
168
|
+
entityCount: number;
|
|
169
|
+
graphSyncJobId: string;
|
|
170
|
+
memoryId: string;
|
|
171
|
+
relationshipCount: number;
|
|
172
|
+
replacedMemoryId?: string;
|
|
173
|
+
},
|
|
174
|
+
Name
|
|
175
|
+
>;
|
|
176
|
+
};
|
|
177
|
+
queries: {
|
|
178
|
+
fetchMemoryCards: FunctionReference<
|
|
179
|
+
"query",
|
|
180
|
+
"internal",
|
|
181
|
+
{
|
|
182
|
+
matches: Array<{
|
|
183
|
+
graphScore?: number;
|
|
184
|
+
memoryId: string;
|
|
185
|
+
score: number;
|
|
186
|
+
semanticScore?: number;
|
|
187
|
+
}>;
|
|
188
|
+
},
|
|
189
|
+
Array<{
|
|
190
|
+
agentId?: string;
|
|
191
|
+
entities: Array<{
|
|
192
|
+
confidence: number;
|
|
193
|
+
description?: string;
|
|
194
|
+
externalId: string;
|
|
195
|
+
name: string;
|
|
196
|
+
type: string;
|
|
197
|
+
}>;
|
|
198
|
+
graphScore?: number;
|
|
199
|
+
importance: number;
|
|
200
|
+
key?: string;
|
|
201
|
+
memoryId: string;
|
|
202
|
+
metadata?: any;
|
|
203
|
+
namespace: string;
|
|
204
|
+
relationships: Array<{
|
|
205
|
+
confidence: number;
|
|
206
|
+
description?: string;
|
|
207
|
+
fromEntityExternalId: string;
|
|
208
|
+
toEntityExternalId: string;
|
|
209
|
+
type: string;
|
|
210
|
+
weight: number;
|
|
211
|
+
}>;
|
|
212
|
+
score: number;
|
|
213
|
+
semanticScore?: number;
|
|
214
|
+
source?: { id?: string; title?: string; type: string; url?: string };
|
|
215
|
+
text: string;
|
|
216
|
+
}>,
|
|
217
|
+
Name
|
|
218
|
+
>;
|
|
219
|
+
getMemory: FunctionReference<
|
|
220
|
+
"query",
|
|
221
|
+
"internal",
|
|
222
|
+
{ memoryId: string },
|
|
223
|
+
{
|
|
224
|
+
agentId?: string;
|
|
225
|
+
entities: Array<{
|
|
226
|
+
confidence: number;
|
|
227
|
+
description?: string;
|
|
228
|
+
externalId: string;
|
|
229
|
+
name: string;
|
|
230
|
+
type: string;
|
|
231
|
+
}>;
|
|
232
|
+
graphScore?: number;
|
|
233
|
+
importance: number;
|
|
234
|
+
key?: string;
|
|
235
|
+
memoryId: string;
|
|
236
|
+
metadata?: any;
|
|
237
|
+
namespace: string;
|
|
238
|
+
relationships: Array<{
|
|
239
|
+
confidence: number;
|
|
240
|
+
description?: string;
|
|
241
|
+
fromEntityExternalId: string;
|
|
242
|
+
toEntityExternalId: string;
|
|
243
|
+
type: string;
|
|
244
|
+
weight: number;
|
|
245
|
+
}>;
|
|
246
|
+
score: number;
|
|
247
|
+
semanticScore?: number;
|
|
248
|
+
source?: { id?: string; title?: string; type: string; url?: string };
|
|
249
|
+
text: string;
|
|
250
|
+
} | null,
|
|
251
|
+
Name
|
|
252
|
+
>;
|
|
253
|
+
listMemories: FunctionReference<
|
|
254
|
+
"query",
|
|
255
|
+
"internal",
|
|
256
|
+
{ cursor?: string; limit?: number; namespace: string },
|
|
257
|
+
{
|
|
258
|
+
continueCursor: string | null;
|
|
259
|
+
isDone: boolean;
|
|
260
|
+
page: Array<{
|
|
261
|
+
agentId?: string;
|
|
262
|
+
entities: Array<{
|
|
263
|
+
confidence: number;
|
|
264
|
+
description?: string;
|
|
265
|
+
externalId: string;
|
|
266
|
+
name: string;
|
|
267
|
+
type: string;
|
|
268
|
+
}>;
|
|
269
|
+
graphScore?: number;
|
|
270
|
+
importance: number;
|
|
271
|
+
key?: string;
|
|
272
|
+
memoryId: string;
|
|
273
|
+
metadata?: any;
|
|
274
|
+
namespace: string;
|
|
275
|
+
relationships: Array<{
|
|
276
|
+
confidence: number;
|
|
277
|
+
description?: string;
|
|
278
|
+
fromEntityExternalId: string;
|
|
279
|
+
toEntityExternalId: string;
|
|
280
|
+
type: string;
|
|
281
|
+
weight: number;
|
|
282
|
+
}>;
|
|
283
|
+
score: number;
|
|
284
|
+
semanticScore?: number;
|
|
285
|
+
source?: {
|
|
286
|
+
id?: string;
|
|
287
|
+
title?: string;
|
|
288
|
+
type: string;
|
|
289
|
+
url?: string;
|
|
290
|
+
};
|
|
291
|
+
text: string;
|
|
292
|
+
}>;
|
|
293
|
+
},
|
|
294
|
+
Name
|
|
295
|
+
>;
|
|
296
|
+
listPendingGraphSyncJobs: FunctionReference<
|
|
297
|
+
"query",
|
|
298
|
+
"internal",
|
|
299
|
+
{ limit: number },
|
|
300
|
+
Array<{
|
|
301
|
+
attempts: number;
|
|
302
|
+
jobId: string;
|
|
303
|
+
namespace: string;
|
|
304
|
+
operation: string;
|
|
305
|
+
payload: any;
|
|
306
|
+
}>,
|
|
307
|
+
Name
|
|
308
|
+
>;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated data model types.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
DataModelFromSchemaDefinition,
|
|
13
|
+
DocumentByName,
|
|
14
|
+
TableNamesInDataModel,
|
|
15
|
+
SystemTableNames,
|
|
16
|
+
} from "convex/server";
|
|
17
|
+
import type { GenericId } from "convex/values";
|
|
18
|
+
import schema from "../schema.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The names of all of your Convex tables.
|
|
22
|
+
*/
|
|
23
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The type of a document stored in Convex.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
29
|
+
*/
|
|
30
|
+
export type Doc<TableName extends TableNames> = DocumentByName<
|
|
31
|
+
DataModel,
|
|
32
|
+
TableName
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An identifier for a document in Convex.
|
|
37
|
+
*
|
|
38
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
39
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
40
|
+
*
|
|
41
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
42
|
+
*
|
|
43
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
44
|
+
* strings when type checking.
|
|
45
|
+
*
|
|
46
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
47
|
+
*/
|
|
48
|
+
export type Id<TableName extends TableNames | SystemTableNames> =
|
|
49
|
+
GenericId<TableName>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A type describing your Convex data model.
|
|
53
|
+
*
|
|
54
|
+
* This type includes information about what tables you have, the type of
|
|
55
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
56
|
+
*
|
|
57
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
58
|
+
* `mutationGeneric` to make them type-safe.
|
|
59
|
+
*/
|
|
60
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|