@anvia/neo4j 1.1.6 → 1.1.8

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/index.d.ts CHANGED
@@ -1,347 +1,333 @@
1
- import { Driver, QueryResult, ManagedTransaction } from 'neo4j-driver';
2
- import { GraphRetrieveOptions, GraphContext, GraphExploreOptions, GraphExploreResult } from '@anvia/graph';
3
- export { GraphFactConflictError } from '@anvia/graph';
4
- import * as _anvia_core_embeddings from '@anvia/core/embeddings';
5
- import { EmbeddedDocument } from '@anvia/core/embeddings';
6
- import * as _anvia_core from '@anvia/core';
7
- import { CompletionModel, RetrySetting, Usage } from '@anvia/core';
8
- import { z } from 'zod';
9
-
1
+ import { Driver, ManagedTransaction, QueryResult } from "neo4j-driver";
2
+ import { z } from "zod";
3
+ import { GraphContext, GraphExploreOptions, GraphExploreResult, GraphFactConflictError, GraphRetrieveOptions } from "@anvia/graph";
4
+ import { EmbeddedDocument } from "@anvia/core/embeddings";
5
+ import { CompletionModel, RetrySetting, Usage } from "@anvia/core";
10
6
  type Neo4jPropertyPrimitive = string | number | boolean;
11
7
  type Neo4jPropertyValue = Neo4jPropertyPrimitive | readonly string[] | readonly number[] | readonly boolean[];
12
8
  type Neo4jProperties = Readonly<Record<string, Neo4jPropertyValue>>;
13
9
  type Neo4jNodeIdentity = Readonly<Record<string, Neo4jPropertyPrimitive>>;
14
10
  type Neo4jNodeDefinition = Readonly<{
15
- description: string;
16
- identity: readonly string[];
17
- properties: z.ZodObject<z.ZodRawShape>;
11
+ description: string;
12
+ identity: readonly string[];
13
+ properties: z.ZodObject<z.ZodRawShape>;
18
14
  }>;
19
15
  type Neo4jRelationshipDefinition = Readonly<{
20
- description: string;
21
- from: string;
22
- to: string;
23
- identity?: readonly string[] | undefined;
24
- properties: z.ZodObject<z.ZodRawShape>;
16
+ description: string;
17
+ from: string;
18
+ to: string;
19
+ identity?: readonly string[] | undefined;
20
+ properties: z.ZodObject<z.ZodRawShape>;
25
21
  }>;
26
22
  type Neo4jGraphSchemaOptions = Readonly<{
27
- nodes: Readonly<Record<string, Neo4jNodeDefinition>>;
28
- relationships: Readonly<Record<string, Neo4jRelationshipDefinition>>;
23
+ nodes: Readonly<Record<string, Neo4jNodeDefinition>>;
24
+ relationships: Readonly<Record<string, Neo4jRelationshipDefinition>>;
29
25
  }>;
30
26
  type Neo4jGraphSchema<Options extends Neo4jGraphSchemaOptions = Neo4jGraphSchemaOptions> = Readonly<Options & {
31
- kind: "neo4j-graph-schema" | "graph-schema";
27
+ kind: "neo4j-graph-schema" | "graph-schema";
32
28
  }>;
33
29
  type NodeDefinitions<Schema extends Neo4jGraphSchema> = Schema["nodes"];
34
30
  type RelationshipDefinitions<Schema extends Neo4jGraphSchema> = Schema["relationships"];
35
- type Neo4jGraphEntity<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = {
36
- [Type in keyof NodeDefinitions<Schema> & string]: Readonly<{
37
- key: string;
38
- type: Type;
39
- identity: Neo4jNodeIdentity;
40
- properties: z.output<NodeDefinitions<Schema>[Type]["properties"]> & Neo4jProperties;
41
- sourceChunkIds: readonly string[];
42
- }>;
43
- }[keyof NodeDefinitions<Schema> & string];
44
- type Neo4jGraphRelationship<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = {
45
- [Type in keyof RelationshipDefinitions<Schema> & string]: Readonly<{
46
- key: string;
47
- type: Type;
48
- from: string;
49
- to: string;
50
- properties: z.output<RelationshipDefinitions<Schema>[Type]["properties"]> & Neo4jProperties;
51
- sourceChunkIds: readonly string[];
52
- }>;
53
- }[keyof RelationshipDefinitions<Schema> & string];
31
+ type Neo4jGraphEntity<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = { [Type in keyof NodeDefinitions<Schema> & string]: Readonly<{
32
+ key: string;
33
+ type: Type;
34
+ identity: Neo4jNodeIdentity;
35
+ properties: z.output<NodeDefinitions<Schema>[Type]["properties"]> & Neo4jProperties;
36
+ sourceChunkIds: readonly string[];
37
+ }>; }[keyof NodeDefinitions<Schema> & string];
38
+ type Neo4jGraphRelationship<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = { [Type in keyof RelationshipDefinitions<Schema> & string]: Readonly<{
39
+ key: string;
40
+ type: Type;
41
+ from: string;
42
+ to: string;
43
+ properties: z.output<RelationshipDefinitions<Schema>[Type]["properties"]> & Neo4jProperties;
44
+ sourceChunkIds: readonly string[];
45
+ }>; }[keyof RelationshipDefinitions<Schema> & string];
54
46
  type Neo4jGraphMention = Readonly<{
55
- chunkId: string;
56
- entityKey: string;
47
+ chunkId: string;
48
+ entityKey: string;
57
49
  }>;
58
50
  type Neo4jGraphFacts<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = Readonly<{
59
- entities: readonly Neo4jGraphEntity<Schema>[];
60
- relationships: readonly Neo4jGraphRelationship<Schema>[];
61
- mentions: readonly Neo4jGraphMention[];
51
+ entities: readonly Neo4jGraphEntity<Schema>[];
52
+ relationships: readonly Neo4jGraphRelationship<Schema>[];
53
+ mentions: readonly Neo4jGraphMention[];
62
54
  }>;
63
55
  type Neo4jGraphChunk<Metadata extends Neo4jProperties = Neo4jProperties> = Readonly<{
64
- id: string;
65
- documentId: string;
66
- index: number;
67
- text: string;
68
- metadata?: Metadata | undefined;
56
+ id: string;
57
+ documentId: string;
58
+ index: number;
59
+ text: string;
60
+ metadata?: Metadata | undefined;
69
61
  }>;
70
62
  type Neo4jGraphDocument<Properties extends Neo4jProperties = Neo4jProperties> = Readonly<{
71
- id: string;
72
- properties?: Properties | undefined;
63
+ id: string;
64
+ properties?: Properties | undefined;
73
65
  }>;
74
66
  type ExtractGraphFactsOptions<Schema extends Neo4jGraphSchema, Model extends CompletionModel> = Readonly<{
75
- model: Model;
76
- schema: Schema;
77
- chunks: readonly Neo4jGraphChunk[];
78
- instructions?: string | undefined;
79
- retries?: RetrySetting | undefined;
80
- concurrency?: number | undefined;
81
- abortSignal?: AbortSignal | undefined;
67
+ model: Model;
68
+ schema: Schema;
69
+ chunks: readonly Neo4jGraphChunk[];
70
+ instructions?: string | undefined;
71
+ retries?: RetrySetting | undefined;
72
+ concurrency?: number | undefined;
73
+ abortSignal?: AbortSignal | undefined;
82
74
  }>;
83
75
  type ExtractGraphFactsResult<Schema extends Neo4jGraphSchema> = Readonly<{
84
- output: Neo4jGraphFacts<Schema>;
85
- usage: Usage;
76
+ output: Neo4jGraphFacts<Schema>;
77
+ usage: Usage;
86
78
  }>;
87
79
  type Neo4jVectorIndex = Readonly<{
88
- name: string;
89
- dimensions: number;
90
- similarity: "cosine" | "euclidean";
80
+ name: string;
81
+ dimensions: number;
82
+ similarity: "cosine" | "euclidean";
91
83
  }>;
92
84
  type Neo4jFulltextIndex = Readonly<{
93
- name: string;
94
- properties?: readonly string[] | undefined;
85
+ name: string;
86
+ properties?: readonly string[] | undefined;
95
87
  }>;
96
88
  type ManagedNeo4jKnowledgeGraphOptions<Schema extends Neo4jGraphSchema> = Readonly<{
97
- name: string;
98
- schema: Schema;
99
- resources: {
100
- labels: {
101
- document: string;
102
- chunk: string;
103
- entity: string;
104
- };
105
- indexes: {
106
- chunks: {
107
- vector: Neo4jVectorIndex;
108
- fulltext?: Neo4jFulltextIndex | undefined;
109
- };
110
- entities: {
111
- vector: Neo4jVectorIndex;
112
- fulltext?: Neo4jFulltextIndex | undefined;
113
- };
114
- };
89
+ name: string;
90
+ schema: Schema;
91
+ resources: {
92
+ labels: {
93
+ document: string;
94
+ chunk: string;
95
+ entity: string;
115
96
  };
97
+ indexes: {
98
+ chunks: {
99
+ vector: Neo4jVectorIndex;
100
+ fulltext?: Neo4jFulltextIndex | undefined;
101
+ };
102
+ entities: {
103
+ vector: Neo4jVectorIndex;
104
+ fulltext?: Neo4jFulltextIndex | undefined;
105
+ };
106
+ };
107
+ };
116
108
  }>;
117
109
  type ExistingNeo4jSeed = Readonly<{
118
- nodeTypes: readonly string[];
119
- vectorIndex: Neo4jVectorIndex & Readonly<{
120
- property: string;
121
- }>;
122
- fulltextIndex?: (Neo4jFulltextIndex & Readonly<{
123
- properties: readonly string[];
124
- }>) | undefined;
110
+ nodeTypes: readonly string[];
111
+ vectorIndex: Neo4jVectorIndex & Readonly<{
112
+ property: string;
113
+ }>;
114
+ fulltextIndex?: (Neo4jFulltextIndex & Readonly<{
115
+ properties: readonly string[];
116
+ }>) | undefined;
125
117
  }>;
126
118
  type Neo4jKnowledgeGraphOptions<Schema extends Neo4jGraphSchema> = Readonly<{
127
- schema: Schema;
128
- seeds: Readonly<Record<string, ExistingNeo4jSeed>>;
119
+ schema: Schema;
120
+ seeds: Readonly<Record<string, ExistingNeo4jSeed>>;
129
121
  }>;
130
122
  type Neo4jClientOptions = Readonly<{
131
- uri: string;
132
- auth: {
133
- username: string;
134
- password: string;
135
- };
136
- database?: string | undefined;
137
- driver?: never;
123
+ uri: string;
124
+ auth: {
125
+ username: string;
126
+ password: string;
127
+ };
128
+ database?: string | undefined;
129
+ driver?: never;
138
130
  }> | Readonly<{
139
- driver: Driver;
140
- database?: string | undefined;
141
- uri?: never;
142
- auth?: never;
131
+ driver: Driver;
132
+ database?: string | undefined;
133
+ uri?: never;
134
+ auth?: never;
143
135
  }>;
144
136
  type Neo4jGraphValidateOptions = Readonly<{
145
- abortSignal?: AbortSignal | undefined;
137
+ abortSignal?: AbortSignal | undefined;
146
138
  }>;
147
139
  type Neo4jGraphEnsureOptions = Readonly<{
148
- indexTimeoutMs: number;
149
- abortSignal?: AbortSignal | undefined;
140
+ indexTimeoutMs: number;
141
+ abortSignal?: AbortSignal | undefined;
150
142
  }>;
151
143
  type Neo4jGraphConflict = "error" | "overwrite" | "keep-existing";
152
144
  type Neo4jOrphanEntityPolicy = "delete" | "keep";
153
145
  type ReplaceNeo4jDocumentsOptions<Schema extends Neo4jGraphSchema> = Readonly<{
154
- documents: readonly Neo4jGraphDocument[];
155
- chunks: readonly EmbeddedDocument<Neo4jGraphChunk>[];
156
- entities: readonly EmbeddedDocument<Neo4jGraphEntity<Schema>>[];
157
- relationships: readonly Neo4jGraphRelationship<Schema>[];
158
- mentions: readonly Neo4jGraphMention[];
159
- conflict: Neo4jGraphConflict;
160
- orphanEntities: Neo4jOrphanEntityPolicy;
161
- abortSignal?: AbortSignal | undefined;
146
+ documents: readonly Neo4jGraphDocument[];
147
+ chunks: readonly EmbeddedDocument<Neo4jGraphChunk>[];
148
+ entities: readonly EmbeddedDocument<Neo4jGraphEntity<Schema>>[];
149
+ relationships: readonly Neo4jGraphRelationship<Schema>[];
150
+ mentions: readonly Neo4jGraphMention[];
151
+ conflict: Neo4jGraphConflict;
152
+ orphanEntities: Neo4jOrphanEntityPolicy;
153
+ abortSignal?: AbortSignal | undefined;
162
154
  }>;
163
155
  type DeleteNeo4jDocumentsOptions = Readonly<{
164
- documentIds: readonly string[];
165
- orphanEntities: Neo4jOrphanEntityPolicy;
166
- abortSignal?: AbortSignal | undefined;
156
+ documentIds: readonly string[];
157
+ orphanEntities: Neo4jOrphanEntityPolicy;
158
+ abortSignal?: AbortSignal | undefined;
167
159
  }>;
168
160
  type Neo4jVectorSearchOptions = Readonly<{
169
- type: "vector";
170
- seeds: readonly string[];
171
- topK: number;
172
- minScore?: number | undefined;
161
+ type: "vector";
162
+ seeds: readonly string[];
163
+ topK: number;
164
+ minScore?: number | undefined;
173
165
  }>;
174
166
  type Neo4jHybridSearchOptions = Readonly<{
175
- type: "hybrid";
176
- seeds: readonly string[];
177
- topK: number;
178
- candidatesPerSeed: number;
179
- rrfK: number;
167
+ type: "hybrid";
168
+ seeds: readonly string[];
169
+ topK: number;
170
+ candidatesPerSeed: number;
171
+ rrfK: number;
180
172
  }>;
181
173
  type Neo4jGraphSearchOptions = Neo4jVectorSearchOptions | Neo4jHybridSearchOptions;
182
174
  type Neo4jGraphEvidenceOptions = Readonly<{
183
- type: "none";
175
+ type: "none";
184
176
  }> | Readonly<{
185
- type: "chunks";
186
- maxChunks: number;
177
+ type: "chunks";
178
+ maxChunks: number;
187
179
  }>;
188
180
  type Neo4jGraphEvidence = Readonly<{
189
- chunkId: string;
190
- documentId: string;
191
- index: number;
192
- text: string;
193
- metadata: Neo4jProperties;
181
+ chunkId: string;
182
+ documentId: string;
183
+ index: number;
184
+ text: string;
185
+ metadata: Neo4jProperties;
194
186
  }>;
195
187
  type Neo4jGraphTraversalOptions<Schema extends Neo4jGraphSchema = Neo4jGraphSchema> = Readonly<{
196
- relationships: readonly (keyof Schema["relationships"] & string)[];
197
- direction: "outgoing" | "incoming" | "both";
198
- maxDepth: number;
199
- maxNodes: number;
200
- maxRelationships: number;
188
+ relationships: readonly (keyof Schema["relationships"] & string)[];
189
+ direction: "outgoing" | "incoming" | "both";
190
+ maxDepth: number;
191
+ maxNodes: number;
192
+ maxRelationships: number;
201
193
  }>;
202
194
  type Neo4jGraphContextSeed = Readonly<{
203
- key: string;
204
- type: string;
205
- score: number;
206
- properties: Neo4jProperties;
207
- sourceChunkIds: readonly string[];
195
+ key: string;
196
+ type: string;
197
+ score: number;
198
+ properties: Neo4jProperties;
199
+ sourceChunkIds: readonly string[];
208
200
  }>;
209
201
  type Neo4jGraphContextNode = Readonly<{
210
- key: string;
211
- type: string;
212
- identity: Neo4jNodeIdentity;
213
- properties: Neo4jProperties;
214
- sourceChunkIds: readonly string[];
202
+ key: string;
203
+ type: string;
204
+ identity: Neo4jNodeIdentity;
205
+ properties: Neo4jProperties;
206
+ sourceChunkIds: readonly string[];
215
207
  }>;
216
208
  type Neo4jGraphContextRelationship = Readonly<{
217
- key: string;
218
- type: string;
219
- from: string;
220
- to: string;
221
- properties: Neo4jProperties;
222
- sourceChunkIds: readonly string[];
209
+ key: string;
210
+ type: string;
211
+ from: string;
212
+ to: string;
213
+ properties: Neo4jProperties;
214
+ sourceChunkIds: readonly string[];
223
215
  }>;
224
216
  type Neo4jGraphContext = Readonly<{
225
- seeds: readonly Neo4jGraphContextSeed[];
226
- nodes: readonly Neo4jGraphContextNode[];
227
- relationships: readonly Neo4jGraphContextRelationship[];
228
- evidence: readonly Neo4jGraphEvidence[];
217
+ seeds: readonly Neo4jGraphContextSeed[];
218
+ nodes: readonly Neo4jGraphContextNode[];
219
+ relationships: readonly Neo4jGraphContextRelationship[];
220
+ evidence: readonly Neo4jGraphEvidence[];
229
221
  }>;
230
222
  type Neo4jGraphEvidenceCapability = "none" | "chunks";
231
223
  type AnyNeo4jKnowledgeGraph<Schema extends Neo4jGraphSchema> = Neo4jKnowledgeGraph<Schema> | ManagedNeo4jKnowledgeGraph<Schema>;
232
224
  type RetrieveGraphContextBase<Schema extends Neo4jGraphSchema> = Readonly<{
233
- model: _anvia_core_embeddings.EmbeddingModel;
234
- query: string;
235
- search: Neo4jGraphSearchOptions;
236
- traversal: Neo4jGraphTraversalOptions<Schema>;
237
- retries?: RetrySetting | undefined;
238
- abortSignal?: AbortSignal | undefined;
225
+ model: import("@anvia/core/embeddings").EmbeddingModel;
226
+ query: string;
227
+ search: Neo4jGraphSearchOptions;
228
+ traversal: Neo4jGraphTraversalOptions<Schema>;
229
+ retries?: RetrySetting | undefined;
230
+ abortSignal?: AbortSignal | undefined;
239
231
  }>;
240
232
  type RetrieveGraphContextOptions<Schema extends Neo4jGraphSchema> = (RetrieveGraphContextBase<Schema> & Readonly<{
241
- graph: AnyNeo4jKnowledgeGraph<Schema>;
242
- evidence: Readonly<{
243
- type: "none";
244
- }>;
233
+ graph: AnyNeo4jKnowledgeGraph<Schema>;
234
+ evidence: Readonly<{
235
+ type: "none";
236
+ }>;
245
237
  }>) | (RetrieveGraphContextBase<Schema> & Readonly<{
246
- graph: ManagedNeo4jKnowledgeGraph<Schema>;
247
- evidence: Readonly<{
248
- type: "chunks";
249
- maxChunks: number;
250
- }>;
238
+ graph: ManagedNeo4jKnowledgeGraph<Schema>;
239
+ evidence: Readonly<{
240
+ type: "chunks";
241
+ maxChunks: number;
242
+ }>;
251
243
  }>);
252
244
  type Neo4jGraphChangeCounts = Readonly<{
253
- created: number;
254
- updated: number;
255
- deleted: number;
256
- unchanged: number;
245
+ created: number;
246
+ updated: number;
247
+ deleted: number;
248
+ unchanged: number;
257
249
  }>;
258
250
  type Neo4jGraphWriteResult = Readonly<{
259
- documents: Neo4jGraphChangeCounts;
260
- chunks: Neo4jGraphChangeCounts;
261
- entities: Neo4jGraphChangeCounts;
262
- relationships: Neo4jGraphChangeCounts;
263
- mentions: Neo4jGraphChangeCounts;
251
+ documents: Neo4jGraphChangeCounts;
252
+ chunks: Neo4jGraphChangeCounts;
253
+ entities: Neo4jGraphChangeCounts;
254
+ relationships: Neo4jGraphChangeCounts;
255
+ mentions: Neo4jGraphChangeCounts;
264
256
  }>;
265
-
266
257
  type SeedRegistration = Readonly<{
267
- labels: readonly string[];
268
- vectorIndex: Neo4jVectorIndex & Readonly<{
269
- property: string;
270
- }>;
271
- vectorFilterProperties?: readonly string[] | undefined;
272
- fulltextIndex?: (Neo4jFulltextIndex & Readonly<{
273
- properties: readonly string[];
274
- }>) | undefined;
275
- entryRelationshipType?: string | undefined;
258
+ labels: readonly string[];
259
+ vectorIndex: Neo4jVectorIndex & Readonly<{
260
+ property: string;
261
+ }>;
262
+ vectorFilterProperties?: readonly string[] | undefined;
263
+ fulltextIndex?: (Neo4jFulltextIndex & Readonly<{
264
+ properties: readonly string[];
265
+ }>) | undefined;
266
+ entryRelationshipType?: string | undefined;
276
267
  }>;
277
268
  type GraphTransaction = Pick<ManagedTransaction, "run">;
278
269
  declare const tenantScopeBrand: unique symbol;
279
270
  type Neo4jTenantScope = Readonly<{
280
- namespace: string;
281
- [tenantScopeBrand]: true;
271
+ namespace: string;
272
+ [tenantScopeBrand]: true;
282
273
  }>;
283
274
  declare abstract class Neo4jKnowledgeGraphBase<Schema extends Neo4jGraphSchema = Neo4jGraphSchema, Evidence extends Neo4jGraphEvidenceCapability = Neo4jGraphEvidenceCapability> {
284
- protected readonly owner: Neo4jClient;
285
- readonly schema: Schema;
286
- readonly namespace?: string | undefined;
287
- abstract readonly seeds: Readonly<Record<string, SeedRegistration>>;
288
- abstract readonly evidenceCapability: Evidence;
289
- protected constructor(owner: Neo4jClient, schema: Schema, namespace?: string | undefined);
290
- validate(options?: Neo4jGraphValidateOptions): Promise<void>;
291
- query(text: string, parameters: Record<string, unknown>, abortSignal?: AbortSignal, access?: "read" | "write"): Promise<QueryResult>;
292
- retrieve(options: GraphRetrieveOptions<Schema, Evidence>): Promise<GraphContext>;
293
- explore(options: GraphExploreOptions<Schema>): Promise<GraphExploreResult>;
294
- seed(name: string): SeedRegistration;
295
- protected transaction<T>(abortSignal: AbortSignal | undefined, run: (transaction: GraphTransaction) => Promise<T>): Promise<T>;
296
- private runTransaction;
297
- private assertSupportedVersion;
275
+ protected readonly owner: Neo4jClient;
276
+ readonly schema: Schema;
277
+ readonly namespace?: string | undefined;
278
+ abstract readonly seeds: Readonly<Record<string, SeedRegistration>>;
279
+ abstract readonly evidenceCapability: Evidence;
280
+ protected constructor(owner: Neo4jClient, schema: Schema, namespace?: string | undefined);
281
+ validate(options?: Neo4jGraphValidateOptions): Promise<void>;
282
+ query(text: string, parameters: Record<string, unknown>, abortSignal?: AbortSignal, access?: "read" | "write"): Promise<QueryResult>;
283
+ retrieve(options: GraphRetrieveOptions<Schema, Evidence>): Promise<GraphContext>;
284
+ explore(options: GraphExploreOptions<Schema>): Promise<GraphExploreResult>;
285
+ seed(name: string): SeedRegistration;
286
+ protected transaction<T>(abortSignal: AbortSignal | undefined, run: (transaction: GraphTransaction) => Promise<T>): Promise<T>;
287
+ private runTransaction;
288
+ private assertSupportedVersion;
298
289
  }
299
- declare class Neo4jKnowledgeGraph<Schema extends Neo4jGraphSchema> extends Neo4jKnowledgeGraphBase<Schema, "none"> {
300
- readonly evidenceCapability: "none";
301
- readonly seeds: Readonly<Record<string, SeedRegistration>>;
302
- constructor(owner: Neo4jClient, options: Neo4jKnowledgeGraphOptions<Schema>);
290
+ export declare class Neo4jKnowledgeGraph<Schema extends Neo4jGraphSchema> extends Neo4jKnowledgeGraphBase<Schema, "none"> {
291
+ readonly evidenceCapability: "none";
292
+ readonly seeds: Readonly<Record<string, SeedRegistration>>;
293
+ constructor(owner: Neo4jClient, options: Neo4jKnowledgeGraphOptions<Schema>);
303
294
  }
304
- declare class ManagedNeo4jKnowledgeGraph<Schema extends Neo4jGraphSchema> extends Neo4jKnowledgeGraphBase<Schema, "chunks"> {
305
- readonly evidenceCapability: "chunks";
306
- readonly seeds: Readonly<Record<string, SeedRegistration>>;
307
- readonly resources: ManagedNeo4jKnowledgeGraphOptions<Schema>["resources"];
308
- readonly name: string;
309
- constructor(owner: Neo4jClient, options: ManagedNeo4jKnowledgeGraphOptions<Schema>, tenantScope?: Neo4jTenantScope);
310
- ensure(options: Neo4jGraphEnsureOptions): Promise<void>;
311
- validate(options?: Neo4jGraphValidateOptions): Promise<void>;
312
- replaceDocuments(options: ReplaceNeo4jDocumentsOptions<Schema>): Promise<Neo4jGraphWriteResult>;
313
- deleteDocuments(options: DeleteNeo4jDocumentsOptions): Promise<Neo4jGraphWriteResult>;
314
- private expectedConstraints;
295
+ export declare class ManagedNeo4jKnowledgeGraph<Schema extends Neo4jGraphSchema> extends Neo4jKnowledgeGraphBase<Schema, "chunks"> {
296
+ readonly evidenceCapability: "chunks";
297
+ readonly seeds: Readonly<Record<string, SeedRegistration>>;
298
+ readonly resources: ManagedNeo4jKnowledgeGraphOptions<Schema>["resources"];
299
+ readonly name: string;
300
+ constructor(owner: Neo4jClient, options: ManagedNeo4jKnowledgeGraphOptions<Schema>, tenantScope?: Neo4jTenantScope);
301
+ ensure(options: Neo4jGraphEnsureOptions): Promise<void>;
302
+ validate(options?: Neo4jGraphValidateOptions): Promise<void>;
303
+ replaceDocuments(options: ReplaceNeo4jDocumentsOptions<Schema>): Promise<Neo4jGraphWriteResult>;
304
+ deleteDocuments(options: DeleteNeo4jDocumentsOptions): Promise<Neo4jGraphWriteResult>;
305
+ private expectedConstraints;
315
306
  }
316
-
317
- declare class Neo4jClient {
318
- private readonly driver;
319
- private readonly ownsDriver;
320
- private closed;
321
- readonly database: string | undefined;
322
- constructor(options: Neo4jClientOptions);
323
- managedKnowledgeGraph<Schema extends Neo4jGraphSchema>(options: ManagedNeo4jKnowledgeGraphOptions<Schema>): ManagedNeo4jKnowledgeGraph<Schema>;
324
- tenant(tenantId: string): Neo4jTenant;
325
- knowledgeGraph<Schema extends Neo4jGraphSchema>(options: Neo4jKnowledgeGraphOptions<Schema>): Neo4jKnowledgeGraph<Schema>;
326
- nativeDriver(): Driver;
327
- close(): Promise<void>;
328
- [Symbol.asyncDispose](): Promise<void>;
329
- private assertOpen;
307
+ export declare class Neo4jClient {
308
+ private readonly driver;
309
+ private readonly ownsDriver;
310
+ private closed;
311
+ readonly database: string | undefined;
312
+ constructor(options: Neo4jClientOptions);
313
+ managedKnowledgeGraph<Schema extends Neo4jGraphSchema>(options: ManagedNeo4jKnowledgeGraphOptions<Schema>): ManagedNeo4jKnowledgeGraph<Schema>;
314
+ tenant(tenantId: string): Neo4jTenant;
315
+ knowledgeGraph<Schema extends Neo4jGraphSchema>(options: Neo4jKnowledgeGraphOptions<Schema>): Neo4jKnowledgeGraph<Schema>;
316
+ nativeDriver(): Driver;
317
+ close(): Promise<void>;
318
+ [Symbol.asyncDispose](): Promise<void>;
319
+ private assertOpen;
330
320
  }
331
- declare class Neo4jTenant {
332
- private readonly owner;
333
- private readonly scope;
334
- constructor(owner: Neo4jClient, scope: Neo4jTenantScope);
335
- get namespace(): string;
336
- managedKnowledgeGraph<Schema extends Neo4jGraphSchema>(options: ManagedNeo4jKnowledgeGraphOptions<Schema>): ManagedNeo4jKnowledgeGraph<Schema>;
321
+ export declare class Neo4jTenant {
322
+ private readonly owner;
323
+ private readonly scope;
324
+ constructor(owner: Neo4jClient, scope: Neo4jTenantScope);
325
+ get namespace(): string;
326
+ managedKnowledgeGraph<Schema extends Neo4jGraphSchema>(options: ManagedNeo4jKnowledgeGraphOptions<Schema>): ManagedNeo4jKnowledgeGraph<Schema>;
337
327
  }
338
-
339
- declare function exploreGraph<Schema extends Neo4jGraphSchema>(graph: Neo4jKnowledgeGraphBase<Schema>, options: GraphExploreOptions<Schema>): Promise<GraphExploreResult>;
340
-
341
- declare function extractGraphFacts<Schema extends Neo4jGraphSchema, Model extends _anvia_core.CompletionModel>(options: ExtractGraphFactsOptions<Schema, Model>): Promise<ExtractGraphFactsResult<Schema>>;
342
-
343
- declare function retrieveGraphContext<Schema extends Neo4jGraphSchema>(options: RetrieveGraphContextOptions<Schema>): Promise<Neo4jGraphContext>;
344
-
345
- declare function defineNeo4jGraphSchema<const Options extends Neo4jGraphSchemaOptions>(options: Options): Neo4jGraphSchema<Options>;
346
-
347
- export { type DeleteNeo4jDocumentsOptions, type ExistingNeo4jSeed, type ExtractGraphFactsOptions, type ExtractGraphFactsResult, ManagedNeo4jKnowledgeGraph, type ManagedNeo4jKnowledgeGraphOptions, Neo4jClient, type Neo4jClientOptions, type Neo4jFulltextIndex, type Neo4jGraphChangeCounts, type Neo4jGraphChunk, type Neo4jGraphConflict, type Neo4jGraphContext, type Neo4jGraphContextNode, type Neo4jGraphContextRelationship, type Neo4jGraphContextSeed, type Neo4jGraphDocument, type Neo4jGraphEnsureOptions, type Neo4jGraphEntity, type Neo4jGraphEvidence, type Neo4jGraphEvidenceCapability, type Neo4jGraphEvidenceOptions, type Neo4jGraphFacts, type Neo4jGraphMention, type Neo4jGraphRelationship, type Neo4jGraphSchema, type Neo4jGraphSchemaOptions, type Neo4jGraphSearchOptions, type Neo4jGraphTraversalOptions, type Neo4jGraphValidateOptions, type Neo4jGraphWriteResult, type Neo4jHybridSearchOptions, Neo4jKnowledgeGraph, type Neo4jKnowledgeGraphOptions, type Neo4jNodeDefinition, type Neo4jNodeIdentity, type Neo4jOrphanEntityPolicy, type Neo4jProperties, type Neo4jPropertyPrimitive, type Neo4jPropertyValue, type Neo4jRelationshipDefinition, Neo4jTenant, type Neo4jVectorIndex, type Neo4jVectorSearchOptions, type ReplaceNeo4jDocumentsOptions, type RetrieveGraphContextOptions, defineNeo4jGraphSchema, exploreGraph, extractGraphFacts, retrieveGraphContext };
328
+ export declare function exploreGraph<Schema extends Neo4jGraphSchema>(graph: Neo4jKnowledgeGraphBase<Schema>, options: GraphExploreOptions<Schema>): Promise<GraphExploreResult>;
329
+ export declare function extractGraphFacts<Schema extends Neo4jGraphSchema, Model extends import("@anvia/core").CompletionModel>(options: ExtractGraphFactsOptions<Schema, Model>): Promise<ExtractGraphFactsResult<Schema>>;
330
+ export declare function retrieveGraphContext<Schema extends Neo4jGraphSchema>(options: RetrieveGraphContextOptions<Schema>): Promise<Neo4jGraphContext>;
331
+ export declare function defineNeo4jGraphSchema<const Options extends Neo4jGraphSchemaOptions>(options: Options): Neo4jGraphSchema<Options>;
332
+ export { type DeleteNeo4jDocumentsOptions, type ExistingNeo4jSeed, type ExtractGraphFactsOptions, type ExtractGraphFactsResult, GraphFactConflictError, type ManagedNeo4jKnowledgeGraphOptions, type Neo4jClientOptions, type Neo4jFulltextIndex, type Neo4jGraphChangeCounts, type Neo4jGraphChunk, type Neo4jGraphConflict, type Neo4jGraphContext, type Neo4jGraphContextNode, type Neo4jGraphContextRelationship, type Neo4jGraphContextSeed, type Neo4jGraphDocument, type Neo4jGraphEnsureOptions, type Neo4jGraphEntity, type Neo4jGraphEvidence, type Neo4jGraphEvidenceCapability, type Neo4jGraphEvidenceOptions, type Neo4jGraphFacts, type Neo4jGraphMention, type Neo4jGraphRelationship, type Neo4jGraphSchema, type Neo4jGraphSchemaOptions, type Neo4jGraphSearchOptions, type Neo4jGraphTraversalOptions, type Neo4jGraphValidateOptions, type Neo4jGraphWriteResult, type Neo4jHybridSearchOptions, type Neo4jKnowledgeGraphOptions, type Neo4jNodeDefinition, type Neo4jNodeIdentity, type Neo4jOrphanEntityPolicy, type Neo4jProperties, type Neo4jPropertyPrimitive, type Neo4jPropertyValue, type Neo4jRelationshipDefinition, type Neo4jVectorIndex, type Neo4jVectorSearchOptions, type ReplaceNeo4jDocumentsOptions, type RetrieveGraphContextOptions };
333
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/graph.ts","../src/client.ts","../src/explore.ts","../src/extract.ts","../src/retrieve.ts","../src/schema.ts"],"mappings":";;;;;KAMY;KACA,qBACR;KAIQ,kBAAkB,SAAS,eAAe;KAC1C,oBAAoB,SAAS,eAAe;KAE5C,sBAAsB;EAChC;EACA;EACA,YAAY,EAAE,UAAU,EAAE;;KAGhB,8BAA8B;EACxC;EACA;EACA;EACA;EACA,YAAY,EAAE,UAAU,EAAE;;KAGhB,0BAA0B;EACpC,OAAO,SAAS,eAAe;EAC/B,eAAe,SAAS,eAAe;;KAG7B,iBAAiB,gBAAgB,0BAA0B,2BACrE,SAAS;EAAY;;KAElB,gBAAgB,eAAe,oBAAoB;KACnD,wBAAwB,eAAe,oBAAoB;KAEpD,iBAAiB,eAAe,mBAAmB,uBAC5D,cAAc,gBAAgB,mBAAmB;EAChD;EACA,MAAM;EACN,UAAU;EACV,YAAY,EAAE,OAAO,gBAAgB,QAAQ,uBAAuB;EACpE;YAEI,gBAAgB;KAEZ,uBAAuB,eAAe,mBAAmB,uBAClE,cAAc,wBAAwB,mBAAmB;EACxD;EACA,MAAM;EACN;EACA;EACA,YAAY,EAAE,OAAO,wBAAwB,QAAQ,uBAAuB;EAC5E;YAEI,wBAAwB;KAEpB,oBAAoB;EAC9B;EACA;;KAGU,gBAAgB,eAAe,mBAAmB,oBAAoB;EAChF,mBAAmB,iBAAiB;EACpC,wBAAwB,uBAAuB;EAC/C,mBAAmB;;KAGT,gBAAgB,iBAAiB,kBAAkB,mBAAmB;EAChF;EACA;EACA;EACA;EACA,WAAW;;KAGD,mBAAmB,mBAAmB,kBAAkB,mBAAmB;EACrF;EACA,aAAa;;KAGH,yBACV,eAAe,kBACf,cAAc,mBACZ;EACF,OAAO;EACP,QAAQ;EACR,iBAAiB;EACjB;EACA,UAAU;EACV;EACA,cAAc;;KAGJ,wBAAwB,eAAe,oBAAoB;EACrE,QAAQ,gBAAgB;EACxB,OAAO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