@exulu/backend 1.48.1 → 1.49.0

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.
Files changed (165) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +353 -42
  3. package/dist/index.d.cts +422 -327
  4. package/dist/index.d.ts +422 -327
  5. package/dist/index.js +341 -38
  6. package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
  7. package/ee/python/README.md +295 -0
  8. package/ee/python/documents/processing/README.md +155 -0
  9. package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
  10. package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
  11. package/ee/python/setup.sh +180 -0
  12. package/package.json +17 -5
  13. package/scripts/postinstall.cjs +149 -0
  14. package/.agents/skills/mintlify/SKILL.md +0 -347
  15. package/.editorconfig +0 -15
  16. package/.eslintrc.json +0 -52
  17. package/.github/workflows/release-backend.yml +0 -38
  18. package/.husky/commit-msg +0 -1
  19. package/.jscpd.json +0 -18
  20. package/.mcp.json +0 -18
  21. package/.nvmrc +0 -1
  22. package/.prettierignore +0 -5
  23. package/.prettierrc.json +0 -12
  24. package/CHANGELOG.md +0 -6
  25. package/SECURITY.md +0 -5
  26. package/commitlint.config.js +0 -4
  27. package/devops/documentation/patch-older-releases.md +0 -42
  28. package/ee/documents/processing/build_pdf_processor.sh +0 -35
  29. package/ee/documents/processing/chunk_markdown.py +0 -263
  30. package/ee/documents/processing/pdf_processor.spec +0 -115
  31. package/eslint.config.js +0 -88
  32. package/jest.config.ts +0 -25
  33. package/mintlify-docs/.mintignore +0 -7
  34. package/mintlify-docs/AGENTS.md +0 -33
  35. package/mintlify-docs/CLAUDE.MD +0 -50
  36. package/mintlify-docs/CONTRIBUTING.md +0 -32
  37. package/mintlify-docs/LICENSE +0 -21
  38. package/mintlify-docs/README.md +0 -55
  39. package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
  40. package/mintlify-docs/ai-tools/cursor.mdx +0 -39
  41. package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
  42. package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
  43. package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
  44. package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
  45. package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
  46. package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
  47. package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
  48. package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
  49. package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
  50. package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
  51. package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
  52. package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
  53. package/mintlify-docs/api-reference/core-types.mdx +0 -585
  54. package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
  55. package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
  56. package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
  57. package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
  58. package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
  59. package/mintlify-docs/api-reference/introduction.mdx +0 -661
  60. package/mintlify-docs/api-reference/mutations.mdx +0 -1012
  61. package/mintlify-docs/api-reference/openapi.json +0 -217
  62. package/mintlify-docs/api-reference/queries.mdx +0 -1154
  63. package/mintlify-docs/backend/introduction.mdx +0 -218
  64. package/mintlify-docs/changelog.mdx +0 -387
  65. package/mintlify-docs/community-edition.mdx +0 -304
  66. package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
  67. package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
  68. package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
  69. package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
  70. package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
  71. package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
  72. package/mintlify-docs/core/exulu-authentication.mdx +0 -810
  73. package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
  74. package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
  75. package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
  76. package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
  77. package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
  78. package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
  79. package/mintlify-docs/core/exulu-database.mdx +0 -811
  80. package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
  81. package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
  82. package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
  83. package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
  84. package/mintlify-docs/core/exulu-logging.mdx +0 -464
  85. package/mintlify-docs/core/exulu-otel.mdx +0 -670
  86. package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
  87. package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
  88. package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
  89. package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
  90. package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
  91. package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
  92. package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
  93. package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
  94. package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
  95. package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
  96. package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
  97. package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
  98. package/mintlify-docs/development.mdx +0 -94
  99. package/mintlify-docs/docs.json +0 -248
  100. package/mintlify-docs/enterprise-edition.mdx +0 -538
  101. package/mintlify-docs/essentials/code.mdx +0 -35
  102. package/mintlify-docs/essentials/images.mdx +0 -59
  103. package/mintlify-docs/essentials/markdown.mdx +0 -88
  104. package/mintlify-docs/essentials/navigation.mdx +0 -87
  105. package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
  106. package/mintlify-docs/essentials/settings.mdx +0 -318
  107. package/mintlify-docs/favicon.svg +0 -3
  108. package/mintlify-docs/frontend/introduction.mdx +0 -39
  109. package/mintlify-docs/getting-started.mdx +0 -267
  110. package/mintlify-docs/guides/custom-agent.mdx +0 -608
  111. package/mintlify-docs/guides/first-agent.mdx +0 -315
  112. package/mintlify-docs/images/admin_ui.png +0 -0
  113. package/mintlify-docs/images/contexts.png +0 -0
  114. package/mintlify-docs/images/create_agents.png +0 -0
  115. package/mintlify-docs/images/evals.png +0 -0
  116. package/mintlify-docs/images/graphql.png +0 -0
  117. package/mintlify-docs/images/graphql_api.png +0 -0
  118. package/mintlify-docs/images/hero-dark.png +0 -0
  119. package/mintlify-docs/images/hero-light.png +0 -0
  120. package/mintlify-docs/images/hero.png +0 -0
  121. package/mintlify-docs/images/knowledge_sources.png +0 -0
  122. package/mintlify-docs/images/mcp.png +0 -0
  123. package/mintlify-docs/images/scaling.png +0 -0
  124. package/mintlify-docs/index.mdx +0 -411
  125. package/mintlify-docs/logo/dark.svg +0 -9
  126. package/mintlify-docs/logo/light.svg +0 -9
  127. package/mintlify-docs/partners.mdx +0 -558
  128. package/mintlify-docs/products.mdx +0 -77
  129. package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
  130. package/mintlify-docs/styles.css +0 -207
  131. package/ngrok.bash +0 -1
  132. package/ngrok.md +0 -6
  133. package/ngrok.yml +0 -10
  134. package/release.config.cjs +0 -15
  135. package/skills-lock.json +0 -10
  136. package/types/context-processor.ts +0 -45
  137. package/types/enums/eval-types.ts +0 -5
  138. package/types/enums/field-types.ts +0 -1
  139. package/types/enums/jobs.ts +0 -11
  140. package/types/enums/statistics.ts +0 -13
  141. package/types/exulu-table-definition.ts +0 -79
  142. package/types/file-types.ts +0 -18
  143. package/types/models/agent-session.ts +0 -27
  144. package/types/models/agent.ts +0 -68
  145. package/types/models/context.ts +0 -53
  146. package/types/models/embedding.ts +0 -17
  147. package/types/models/eval-run.ts +0 -40
  148. package/types/models/exulu-agent-tool-config.ts +0 -11
  149. package/types/models/item.ts +0 -21
  150. package/types/models/job.ts +0 -8
  151. package/types/models/project.ts +0 -16
  152. package/types/models/rate-limiter-rules.ts +0 -7
  153. package/types/models/test-case.ts +0 -25
  154. package/types/models/tool.ts +0 -9
  155. package/types/models/user-role.ts +0 -12
  156. package/types/models/user.ts +0 -20
  157. package/types/models/variable.ts +0 -8
  158. package/types/models/vector-methods.ts +0 -7
  159. package/types/provider-config.ts +0 -21
  160. package/types/queue-config.ts +0 -16
  161. package/types/rbac-rights-modes.ts +0 -1
  162. package/types/statistics.ts +0 -20
  163. package/types/workflow.ts +0 -31
  164. /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
  165. /package/ee/{documents/processing → python}/requirements.txt +0 -0
@@ -1,851 +0,0 @@
1
- ---
2
- title: 'Dynamic Types'
3
- description: 'Auto-generated GraphQL types from ExuluContext instances'
4
- ---
5
-
6
- ## Overview
7
-
8
- Dynamic types are **automatically generated** from your `ExuluContext` instances. Each context you define creates a complete set of GraphQL types, queries, and mutations tailored to your data structure.
9
-
10
- <Info>
11
- Dynamic types make Exulu IMP's GraphQL API adapt to your implementation without requiring manual schema updates.
12
- </Info>
13
-
14
- ## Type generation
15
-
16
- When you create an `ExuluContext`:
17
-
18
- ```typescript
19
- const documentationContext = new ExuluContext({
20
- id: "documentation",
21
- name: "Documentation",
22
- description: "Product documentation",
23
- tableName: "docs_items",
24
- fields: [
25
- { name: "title", type: "string", required: true },
26
- { name: "url", type: "string" },
27
- { name: "category", type: "string" }
28
- ],
29
- embedder: myEmbedder
30
- });
31
- ```
32
-
33
- Exulu IMP generates:
34
-
35
- 1. **Main type** - `documentation`
36
- 2. **Input type** - `documentationInput`
37
- 3. **Filter type** - `FilterDocumentation`
38
- 4. **Queries** - `documentationById`, `documentationPagination`, `documentationVectorSearch`, etc.
39
- 5. **Mutations** - `documentationCreateOne`, `documentationUpdateOne`, etc.
40
- 6. **Pagination result** - `DocumentationPaginationResult`
41
- 7. **Vector search types** - `documentationVectorSearchResult`, `documentationVectorSearchChunk`
42
-
43
- ## Generated types
44
-
45
- ### Main type
46
-
47
- The main resource type includes your custom fields plus standard fields:
48
-
49
- ```graphql
50
- type {contextId} {
51
- # Your custom fields
52
- {fieldName}: {fieldType}
53
-
54
- # Standard fields (always included)
55
- id: ID!
56
- createdAt: Date!
57
- updatedAt: Date!
58
-
59
- # Vector search fields (if embedder configured)
60
- averageRelevance: Float
61
- totalRelevance: Float
62
- chunks: [ItemChunks]
63
-
64
- # RBAC field (if enabled on context)
65
- RBAC: RBACData
66
- }
67
- ```
68
-
69
- **Example for documentation context:**
70
-
71
- ```graphql
72
- type documentation {
73
- # Custom fields
74
- title: String!
75
- url: String
76
- category: String
77
-
78
- # Standard fields
79
- id: ID!
80
- createdAt: Date!
81
- updatedAt: Date!
82
-
83
- # Vector search fields
84
- averageRelevance: Float
85
- totalRelevance: Float
86
- chunks: [ItemChunks]
87
- }
88
- ```
89
-
90
- ### Input type
91
-
92
- For creating and updating resources:
93
-
94
- ```graphql
95
- input {contextId}Input {
96
- {fieldName}: {fieldType}
97
- RBAC: RBACInput # If RBAC enabled
98
- }
99
- ```
100
-
101
- **Example:**
102
-
103
- ```graphql
104
- input documentationInput {
105
- title: String!
106
- url: String
107
- category: String
108
- RBAC: RBACInput
109
- }
110
- ```
111
-
112
- ### Filter type
113
-
114
- For filtering queries with operators:
115
-
116
- ```graphql
117
- input Filter{ContextId} {
118
- {fieldName}: FilterOperator{FieldType}
119
- }
120
- ```
121
-
122
- **Example:**
123
-
124
- ```graphql
125
- input FilterDocumentation {
126
- title: FilterOperatorString
127
- url: FilterOperatorString
128
- category: FilterOperatorString
129
- createdAt: FilterOperatorDate
130
- }
131
- ```
132
-
133
- ## Field type mapping
134
-
135
- ExuluContext fields are mapped to GraphQL types:
136
-
137
- | ExuluContext type | GraphQL type | Filter operators |
138
- |-------------------|--------------|------------------|
139
- | `string` | `String` | `eq`, `ne`, `in`, `contains`, `and`, `or` |
140
- | `number` | `Float` | `eq`, `ne`, `in`, `lte`, `gte`, `and`, `or` |
141
- | `boolean` | `Boolean` | `eq`, `ne`, `in`, `and`, `or` |
142
- | `date` | `Date` | `lte`, `gte`, `and`, `or` |
143
- | `json` | `JSON` | `eq`, `ne`, `in`, `contains` |
144
- | `enum` | `{fieldName}Enum` | `eq`, `ne`, `in`, `and`, `or` |
145
- | `file` | `String` | `eq`, `ne`, `in`, `contains`, `and`, `or` |
146
-
147
- ## Enum field types
148
-
149
- Enum fields generate dedicated enum types:
150
-
151
- ```typescript
152
- const ticketContext = new ExuluContext({
153
- id: "tickets",
154
- name: "Support Tickets",
155
- fields: [
156
- {
157
- name: "status",
158
- type: "enum",
159
- enumValues: ["open", "in-progress", "resolved", "closed"]
160
- },
161
- {
162
- name: "priority",
163
- type: "enum",
164
- enumValues: ["low", "medium", "high", "urgent"]
165
- }
166
- ]
167
- });
168
- ```
169
-
170
- **Generates:**
171
-
172
- ```graphql
173
- enum statusEnum {
174
- OPEN
175
- IN_PROGRESS
176
- RESOLVED
177
- CLOSED
178
- }
179
-
180
- enum priorityEnum {
181
- LOW
182
- MEDIUM
183
- HIGH
184
- URGENT
185
- }
186
-
187
- type tickets {
188
- status: statusEnum
189
- priority: priorityEnum
190
- # ...
191
- }
192
-
193
- input FilterTickets {
194
- status: FilterOperatorstatusEnum
195
- priority: FilterOperatorpriorityEnum
196
- }
197
- ```
198
-
199
- ## Generated queries
200
-
201
- Each context generates these queries:
202
-
203
- ### By ID
204
-
205
- ```graphql
206
- {contextId}ById(id: ID!): {contextId}
207
- ```
208
-
209
- **Example:**
210
-
211
- ```graphql
212
- query {
213
- documentationById(id: "doc-123") {
214
- id
215
- title
216
- url
217
- category
218
- }
219
- }
220
- ```
221
-
222
- ### By IDs (batch)
223
-
224
- ```graphql
225
- {contextId}ByIds(ids: [ID!]!): [{contextId}]!
226
- ```
227
-
228
- **Example:**
229
-
230
- ```graphql
231
- query {
232
- documentationByIds(ids: ["doc-1", "doc-2", "doc-3"]) {
233
- id
234
- title
235
- }
236
- }
237
- ```
238
-
239
- ### One (filtered)
240
-
241
- ```graphql
242
- {contextId}One(
243
- filters: [Filter{ContextId}]
244
- sort: SortBy
245
- ): {contextId}
246
- ```
247
-
248
- **Example:**
249
-
250
- ```graphql
251
- query {
252
- documentationOne(
253
- filters: [{ category: { eq: "getting-started" } }]
254
- sort: { field: "createdAt", direction: DESC }
255
- ) {
256
- id
257
- title
258
- }
259
- }
260
- ```
261
-
262
- ### Pagination
263
-
264
- ```graphql
265
- {contextPlural}Pagination(
266
- limit: Int
267
- page: Int
268
- filters: [Filter{ContextId}]
269
- sort: SortBy
270
- ): {ContextId}PaginationResult
271
- ```
272
-
273
- **Example:**
274
-
275
- ```graphql
276
- query {
277
- documentationPagination(
278
- limit: 20
279
- page: 1
280
- filters: [{ title: { contains: "install" } }]
281
- sort: { field: "createdAt", direction: DESC }
282
- ) {
283
- items {
284
- id
285
- title
286
- url
287
- }
288
- pageInfo {
289
- currentPage
290
- pageCount
291
- hasNextPage
292
- }
293
- }
294
- }
295
- ```
296
-
297
- ### Statistics
298
-
299
- ```graphql
300
- {contextPlural}Statistics(
301
- filters: [Filter{ContextId}]
302
- groupBy: String
303
- limit: Int
304
- ): [StatisticsResult]!
305
- ```
306
-
307
- **Example:**
308
-
309
- ```graphql
310
- query {
311
- documentationStatistics(
312
- groupBy: "category"
313
- limit: 10
314
- ) {
315
- group
316
- count
317
- }
318
- }
319
- ```
320
-
321
- ### Vector search (if embedder configured)
322
-
323
- ```graphql
324
- {contextPlural}VectorSearch(
325
- query: String!
326
- method: VectorMethodEnum!
327
- itemFilters: [Filter{ContextId}]
328
- cutoffs: SearchCutoffs
329
- expand: SearchExpand
330
- ): {contextId}VectorSearchResult
331
- ```
332
-
333
- **Example:**
334
-
335
- ```graphql
336
- query {
337
- documentationVectorSearch(
338
- query: "How do I deploy the application?"
339
- method: cosineDistance
340
- cutoffs: { cosineDistance: 0.7 }
341
- expand: { before: 1, after: 1 }
342
- ) {
343
- chunks {
344
- chunk_content
345
- chunk_cosine_distance
346
- item_name
347
- item_id
348
- }
349
- context {
350
- name
351
- embedder
352
- }
353
- }
354
- }
355
- ```
356
-
357
- ### Chunk by ID (if embedder configured)
358
-
359
- ```graphql
360
- {contextId}ChunkById(id: ID!): {contextId}VectorSearchChunk
361
- ```
362
-
363
- **Example:**
364
-
365
- ```graphql
366
- query {
367
- documentationChunkById(id: "chunk-123") {
368
- chunk_content
369
- chunk_index
370
- item_name
371
- item_id
372
- }
373
- }
374
- ```
375
-
376
- ## Generated mutations
377
-
378
- Each context generates these mutations:
379
-
380
- ### Create one
381
-
382
- ```graphql
383
- {contextPlural}CreateOne(
384
- input: {contextId}Input!
385
- upsert: Boolean
386
- ): {contextId}MutationPayload
387
- ```
388
-
389
- **Example:**
390
-
391
- ```graphql
392
- mutation {
393
- documentationCreateOne(
394
- input: {
395
- title: "Getting Started"
396
- url: "https://docs.example.com/start"
397
- category: "tutorials"
398
- }
399
- ) {
400
- item {
401
- id
402
- title
403
- }
404
- job # If embeddings are generated
405
- }
406
- }
407
- ```
408
-
409
- ### Copy one
410
-
411
- ```graphql
412
- {contextPlural}CopyOneById(id: ID!): {contextId}MutationPayload
413
- ```
414
-
415
- **Example:**
416
-
417
- ```graphql
418
- mutation {
419
- documentationCopyOneById(id: "doc-123") {
420
- item {
421
- id
422
- title # Will be "Original Title (Copy)"
423
- }
424
- }
425
- }
426
- ```
427
-
428
- ### Update one (by filter)
429
-
430
- ```graphql
431
- {contextPlural}UpdateOne(
432
- where: [Filter{ContextId}]
433
- input: {contextId}Input!
434
- ): {contextId}MutationPayload
435
- ```
436
-
437
- **Example:**
438
-
439
- ```graphql
440
- mutation {
441
- documentationUpdateOne(
442
- where: [{ url: { eq: "https://old-url.com" } }]
443
- input: {
444
- url: "https://new-url.com"
445
- }
446
- ) {
447
- item {
448
- id
449
- url
450
- }
451
- job # If embeddings regenerated
452
- }
453
- }
454
- ```
455
-
456
- ### Update one by ID
457
-
458
- ```graphql
459
- {contextPlural}UpdateOneById(
460
- id: ID!
461
- input: {contextId}Input!
462
- ): {contextId}MutationPayload
463
- ```
464
-
465
- **Example:**
466
-
467
- ```graphql
468
- mutation {
469
- documentationUpdateOneById(
470
- id: "doc-123"
471
- input: {
472
- title: "Updated Title"
473
- category: "advanced"
474
- }
475
- ) {
476
- item {
477
- id
478
- title
479
- category
480
- }
481
- }
482
- }
483
- ```
484
-
485
- ### Remove one
486
-
487
- ```graphql
488
- {contextPlural}RemoveOne(where: JSON!): {contextId}
489
- {contextPlural}RemoveOneById(id: ID!): {contextId}
490
- ```
491
-
492
- **Example:**
493
-
494
- ```graphql
495
- mutation {
496
- documentationRemoveOneById(id: "doc-123") {
497
- id
498
- title
499
- }
500
- }
501
- ```
502
-
503
- ## Embedder-specific mutations
504
-
505
- Contexts with embedders get additional mutations:
506
-
507
- ### Generate chunks
508
-
509
- ```graphql
510
- {contextId}GenerateChunks(
511
- where: [Filter{ContextId}]
512
- limit: Int
513
- ): {contextId}GenerateChunksReturnPayload
514
-
515
- type {contextId}GenerateChunksReturnPayload {
516
- message: String!
517
- items: Int!
518
- jobs: [String!]
519
- }
520
- ```
521
-
522
- **Example:**
523
-
524
- ```graphql
525
- mutation {
526
- documentationGenerateChunks(
527
- where: [{ category: { eq: "tutorials" } }]
528
- limit: 50
529
- ) {
530
- message
531
- items
532
- jobs
533
- }
534
- }
535
- ```
536
-
537
- ### Delete chunks
538
-
539
- ```graphql
540
- {contextId}DeleteChunks(
541
- where: [Filter{ContextId}]
542
- limit: Int
543
- ): {contextId}DeleteChunksReturnPayload
544
-
545
- type {contextId}DeleteChunksReturnPayload {
546
- message: String!
547
- items: Int!
548
- jobs: [String!]
549
- }
550
- ```
551
-
552
- **Example:**
553
-
554
- ```graphql
555
- mutation {
556
- documentationDeleteChunks(
557
- where: [{ category: { eq: "deprecated" } }]
558
- ) {
559
- message
560
- items
561
- }
562
- }
563
- ```
564
-
565
- ## Source-specific mutations
566
-
567
- Contexts with sources get:
568
-
569
- ### Execute source
570
-
571
- ```graphql
572
- {contextId}ExecuteSource(
573
- source: ID!
574
- inputs: JSON!
575
- ): {contextId}ExecuteSourceReturnPayload
576
-
577
- type {contextId}ExecuteSourceReturnPayload {
578
- message: String!
579
- jobs: [String!]
580
- items: [String!]
581
- }
582
- ```
583
-
584
- **Example:**
585
-
586
- ```graphql
587
- mutation {
588
- documentationExecuteSource(
589
- source: "github_docs_sync"
590
- inputs: {
591
- repository: "myorg/myrepo"
592
- branch: "main"
593
- }
594
- ) {
595
- message
596
- items
597
- jobs
598
- }
599
- }
600
- ```
601
-
602
- ## Processor-specific mutations
603
-
604
- Contexts with processors get:
605
-
606
- ### Process item
607
-
608
- ```graphql
609
- {contextId}ProcessItem(item: ID!): {contextId}ProcessItemFieldReturnPayload
610
-
611
- type {contextId}ProcessItemFieldReturnPayload {
612
- message: String!
613
- results: [String]
614
- jobs: [String]
615
- }
616
- ```
617
-
618
- ### Process items (batch)
619
-
620
- ```graphql
621
- {contextId}ProcessItems(
622
- limit: Int
623
- filters: [Filter{ContextId}]
624
- sort: SortBy
625
- ): {contextId}ProcessItemFieldReturnPayload
626
- ```
627
-
628
- **Example:**
629
-
630
- ```graphql
631
- mutation {
632
- documentationProcessItems(
633
- limit: 10
634
- filters: [{ category: { eq: "api" } }]
635
- ) {
636
- message
637
- results
638
- jobs
639
- }
640
- }
641
- ```
642
-
643
- ## Vector search types
644
-
645
- ### VectorSearchResult
646
-
647
- ```graphql
648
- type {contextId}VectorSearchResult {
649
- chunks: [{contextId}VectorSearchChunk!]!
650
- context: VectorSearchResultContext!
651
- itemFilters: JSON!
652
- chunkFilters: JSON!
653
- query: String!
654
- method: VectorMethodEnum!
655
- }
656
- ```
657
-
658
- ### VectorSearchChunk
659
-
660
- ```graphql
661
- type {contextId}VectorSearchChunk {
662
- chunk_content: String
663
- chunk_index: Int
664
- chunk_id: String
665
- chunk_source: String
666
- chunk_metadata: JSON
667
- chunk_created_at: Date
668
- chunk_updated_at: Date
669
- item_updated_at: Date
670
- item_created_at: Date
671
- item_id: String!
672
- item_external_id: String
673
- item_name: String!
674
- chunk_cosine_distance: Float
675
- chunk_fts_rank: Float
676
- chunk_hybrid_score: Float
677
- }
678
- ```
679
-
680
- ### Search methods
681
-
682
- ```graphql
683
- enum VectorMethodEnum {
684
- cosineDistance # Vector similarity (requires embedder)
685
- hybridSearch # Vector + full-text search
686
- tsvector # PostgreSQL full-text search only
687
- }
688
- ```
689
-
690
- ### Search cutoffs
691
-
692
- ```graphql
693
- input SearchCutoffs {
694
- cosineDistance: Float # 0-1, lower is more similar
695
- hybrid: Float
696
- tsvector: Float
697
- }
698
- ```
699
-
700
- ### Search expand
701
-
702
- ```graphql
703
- input SearchExpand {
704
- before: Int # Include N chunks before match
705
- after: Int # Include N chunks after match
706
- }
707
- ```
708
-
709
- ## Pagination result types
710
-
711
- ```graphql
712
- type {ContextId}PaginationResult {
713
- pageInfo: PageInfo!
714
- items: [{contextId}]!
715
- }
716
-
717
- type PageInfo {
718
- pageCount: Int!
719
- itemCount: Int!
720
- currentPage: Int!
721
- hasPreviousPage: Boolean!
722
- hasNextPage: Boolean!
723
- }
724
- ```
725
-
726
- ## Mutation payload types
727
-
728
- ```graphql
729
- type {contextId}MutationPayload {
730
- item: {contextId}!
731
- job: String # Job ID if background processing triggered
732
- }
733
- ```
734
-
735
- ## Complete example
736
-
737
- Here's a full example showing all generated types for a context:
738
-
739
- ```typescript
740
- const ticketsContext = new ExuluContext({
741
- id: "tickets",
742
- name: "Support Tickets",
743
- tableName: "support_tickets",
744
- fields: [
745
- { name: "subject", type: "string", required: true },
746
- { name: "description", type: "string" },
747
- { name: "status", type: "enum", enumValues: ["open", "closed"] },
748
- { name: "priority", type: "number" }
749
- ],
750
- embedder: myEmbedder
751
- });
752
- ```
753
-
754
- **Generates schema:**
755
-
756
- ```graphql
757
- # Enums
758
- enum statusEnum {
759
- OPEN
760
- CLOSED
761
- }
762
-
763
- # Main type
764
- type tickets {
765
- subject: String!
766
- description: String
767
- status: statusEnum
768
- priority: Float
769
- id: ID!
770
- createdAt: Date!
771
- updatedAt: Date!
772
- averageRelevance: Float
773
- totalRelevance: Float
774
- chunks: [ItemChunks]
775
- }
776
-
777
- # Input type
778
- input ticketsInput {
779
- subject: String!
780
- description: String
781
- status: statusEnum
782
- priority: Float
783
- }
784
-
785
- # Filter type
786
- input FilterTickets {
787
- subject: FilterOperatorString
788
- description: FilterOperatorString
789
- status: FilterOperatorstatusEnum
790
- priority: FilterOperatorFloat
791
- createdAt: FilterOperatorDate
792
- }
793
-
794
- # Queries
795
- type Query {
796
- ticketsById(id: ID!): tickets
797
- ticketsByIds(ids: [ID!]!): [tickets]!
798
- ticketsOne(filters: [FilterTickets], sort: SortBy): tickets
799
- ticketsPagination(limit: Int, page: Int, filters: [FilterTickets], sort: SortBy): TicketsPaginationResult
800
- ticketsStatistics(filters: [FilterTickets], groupBy: String, limit: Int): [StatisticsResult]!
801
- ticketsVectorSearch(query: String!, method: VectorMethodEnum!, itemFilters: [FilterTickets], cutoffs: SearchCutoffs, expand: SearchExpand): ticketsVectorSearchResult
802
- ticketsChunkById(id: ID!): ticketsVectorSearchChunk
803
- }
804
-
805
- # Mutations
806
- type Mutation {
807
- ticketsCreateOne(input: ticketsInput!, upsert: Boolean): ticketsMutationPayload
808
- ticketsCopyOneById(id: ID!): ticketsMutationPayload
809
- ticketsUpdateOne(where: [FilterTickets], input: ticketsInput!): ticketsMutationPayload
810
- ticketsUpdateOneById(id: ID!, input: ticketsInput!): ticketsMutationPayload
811
- ticketsRemoveOne(where: JSON!): tickets
812
- ticketsRemoveOneById(id: ID!): tickets
813
- ticketsGenerateChunks(where: [FilterTickets], limit: Int): ticketsGenerateChunksReturnPayload
814
- ticketsDeleteChunks(where: [FilterTickets], limit: Int): ticketsDeleteChunksReturnPayload
815
- }
816
- ```
817
-
818
- ## Best practices
819
-
820
- <Tip>
821
- **Use descriptive context IDs** - They become GraphQL type names, so choose clear, singular nouns (e.g., `document`, `ticket`, `article`)
822
- </Tip>
823
-
824
- <Note>
825
- **Plan field names carefully** - They become GraphQL field names and cannot easily be changed without migration
826
- </Note>
827
-
828
- <Warning>
829
- **Enum values must be valid GraphQL identifiers** - They're automatically converted to uppercase and sanitized
830
- </Warning>
831
-
832
- <Info>
833
- **Enable embedders for semantic search** - Vector search types are only generated when an embedder is configured
834
- </Info>
835
-
836
- ## Next steps
837
-
838
- <CardGroup cols={2}>
839
- <Card title="Core types" icon="database" href="/api-reference/core-types">
840
- Explore predefined platform types
841
- </Card>
842
- <Card title="Queries" icon="magnifying-glass" href="/api-reference/queries">
843
- Learn about all query operations
844
- </Card>
845
- <Card title="Mutations" icon="pen-to-square" href="/api-reference/mutations">
846
- Learn about all mutation operations
847
- </Card>
848
- <Card title="ExuluContext" icon="database" href="/core/exulu-context/introduction">
849
- Learn how to create contexts
850
- </Card>
851
- </CardGroup>