@exulu/backend 1.48.2 → 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 (164) hide show
  1. package/dist/index.cjs +351 -42
  2. package/dist/index.d.cts +96 -1
  3. package/dist/index.d.ts +96 -1
  4. package/dist/index.js +340 -38
  5. package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
  6. package/ee/python/README.md +295 -0
  7. package/ee/python/documents/processing/README.md +155 -0
  8. package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
  9. package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
  10. package/ee/python/setup.sh +180 -0
  11. package/package.json +14 -3
  12. package/scripts/postinstall.cjs +149 -0
  13. package/.agents/skills/mintlify/SKILL.md +0 -347
  14. package/.editorconfig +0 -15
  15. package/.eslintrc.json +0 -52
  16. package/.github/workflows/release-backend.yml +0 -38
  17. package/.husky/commit-msg +0 -1
  18. package/.jscpd.json +0 -18
  19. package/.mcp.json +0 -25
  20. package/.nvmrc +0 -1
  21. package/.prettierignore +0 -5
  22. package/.prettierrc.json +0 -12
  23. package/CHANGELOG.md +0 -8
  24. package/SECURITY.md +0 -5
  25. package/commitlint.config.js +0 -4
  26. package/devops/documentation/patch-older-releases.md +0 -42
  27. package/ee/documents/processing/build_pdf_processor.sh +0 -35
  28. package/ee/documents/processing/chunk_markdown.py +0 -263
  29. package/ee/documents/processing/pdf_processor.spec +0 -115
  30. package/eslint.config.js +0 -88
  31. package/jest.config.ts +0 -25
  32. package/mintlify-docs/.mintignore +0 -7
  33. package/mintlify-docs/AGENTS.md +0 -33
  34. package/mintlify-docs/CLAUDE.MD +0 -50
  35. package/mintlify-docs/CONTRIBUTING.md +0 -32
  36. package/mintlify-docs/LICENSE +0 -21
  37. package/mintlify-docs/README.md +0 -55
  38. package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
  39. package/mintlify-docs/ai-tools/cursor.mdx +0 -39
  40. package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
  41. package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
  42. package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
  43. package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
  44. package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
  45. package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
  46. package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
  47. package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
  48. package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
  49. package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
  50. package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
  51. package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
  52. package/mintlify-docs/api-reference/core-types.mdx +0 -585
  53. package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
  54. package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
  55. package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
  56. package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
  57. package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
  58. package/mintlify-docs/api-reference/introduction.mdx +0 -661
  59. package/mintlify-docs/api-reference/mutations.mdx +0 -1012
  60. package/mintlify-docs/api-reference/openapi.json +0 -217
  61. package/mintlify-docs/api-reference/queries.mdx +0 -1154
  62. package/mintlify-docs/backend/introduction.mdx +0 -218
  63. package/mintlify-docs/changelog.mdx +0 -387
  64. package/mintlify-docs/community-edition.mdx +0 -304
  65. package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
  66. package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
  67. package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
  68. package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
  69. package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
  70. package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
  71. package/mintlify-docs/core/exulu-authentication.mdx +0 -810
  72. package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
  73. package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
  74. package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
  75. package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
  76. package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
  77. package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
  78. package/mintlify-docs/core/exulu-database.mdx +0 -811
  79. package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
  80. package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
  81. package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
  82. package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
  83. package/mintlify-docs/core/exulu-logging.mdx +0 -464
  84. package/mintlify-docs/core/exulu-otel.mdx +0 -670
  85. package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
  86. package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
  87. package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
  88. package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
  89. package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
  90. package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
  91. package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
  92. package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
  93. package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
  94. package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
  95. package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
  96. package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
  97. package/mintlify-docs/development.mdx +0 -94
  98. package/mintlify-docs/docs.json +0 -248
  99. package/mintlify-docs/enterprise-edition.mdx +0 -538
  100. package/mintlify-docs/essentials/code.mdx +0 -35
  101. package/mintlify-docs/essentials/images.mdx +0 -59
  102. package/mintlify-docs/essentials/markdown.mdx +0 -88
  103. package/mintlify-docs/essentials/navigation.mdx +0 -87
  104. package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
  105. package/mintlify-docs/essentials/settings.mdx +0 -318
  106. package/mintlify-docs/favicon.svg +0 -3
  107. package/mintlify-docs/frontend/introduction.mdx +0 -39
  108. package/mintlify-docs/getting-started.mdx +0 -267
  109. package/mintlify-docs/guides/custom-agent.mdx +0 -608
  110. package/mintlify-docs/guides/first-agent.mdx +0 -315
  111. package/mintlify-docs/images/admin_ui.png +0 -0
  112. package/mintlify-docs/images/contexts.png +0 -0
  113. package/mintlify-docs/images/create_agents.png +0 -0
  114. package/mintlify-docs/images/evals.png +0 -0
  115. package/mintlify-docs/images/graphql.png +0 -0
  116. package/mintlify-docs/images/graphql_api.png +0 -0
  117. package/mintlify-docs/images/hero-dark.png +0 -0
  118. package/mintlify-docs/images/hero-light.png +0 -0
  119. package/mintlify-docs/images/hero.png +0 -0
  120. package/mintlify-docs/images/knowledge_sources.png +0 -0
  121. package/mintlify-docs/images/mcp.png +0 -0
  122. package/mintlify-docs/images/scaling.png +0 -0
  123. package/mintlify-docs/index.mdx +0 -411
  124. package/mintlify-docs/logo/dark.svg +0 -9
  125. package/mintlify-docs/logo/light.svg +0 -9
  126. package/mintlify-docs/partners.mdx +0 -558
  127. package/mintlify-docs/products.mdx +0 -77
  128. package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
  129. package/mintlify-docs/styles.css +0 -207
  130. package/ngrok.bash +0 -1
  131. package/ngrok.md +0 -6
  132. package/ngrok.yml +0 -10
  133. package/release.config.cjs +0 -15
  134. package/skills-lock.json +0 -10
  135. package/types/context-processor.ts +0 -45
  136. package/types/enums/eval-types.ts +0 -5
  137. package/types/enums/field-types.ts +0 -1
  138. package/types/enums/jobs.ts +0 -11
  139. package/types/enums/statistics.ts +0 -13
  140. package/types/exulu-table-definition.ts +0 -79
  141. package/types/file-types.ts +0 -18
  142. package/types/models/agent-session.ts +0 -27
  143. package/types/models/agent.ts +0 -68
  144. package/types/models/context.ts +0 -53
  145. package/types/models/embedding.ts +0 -17
  146. package/types/models/eval-run.ts +0 -40
  147. package/types/models/exulu-agent-tool-config.ts +0 -11
  148. package/types/models/item.ts +0 -21
  149. package/types/models/job.ts +0 -8
  150. package/types/models/project.ts +0 -16
  151. package/types/models/rate-limiter-rules.ts +0 -7
  152. package/types/models/test-case.ts +0 -25
  153. package/types/models/tool.ts +0 -9
  154. package/types/models/user-role.ts +0 -12
  155. package/types/models/user.ts +0 -20
  156. package/types/models/variable.ts +0 -8
  157. package/types/models/vector-methods.ts +0 -7
  158. package/types/provider-config.ts +0 -21
  159. package/types/queue-config.ts +0 -16
  160. package/types/rbac-rights-modes.ts +0 -1
  161. package/types/statistics.ts +0 -20
  162. package/types/workflow.ts +0 -31
  163. /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
  164. /package/ee/{documents/processing → python}/requirements.txt +0 -0
@@ -1,4 +0,0 @@
1
- ---
2
- title: 'Create Plant'
3
- openapi: 'POST /plants'
4
- ---
@@ -1,4 +0,0 @@
1
- ---
2
- title: 'Delete Plant'
3
- openapi: 'DELETE /plants/{id}'
4
- ---
@@ -1,4 +0,0 @@
1
- ---
2
- title: 'Get Plants'
3
- openapi: 'GET /plants'
4
- ---
@@ -1,4 +0,0 @@
1
- ---
2
- title: 'New Plant'
3
- openapi: 'WEBHOOK /plant/webhook'
4
- ---
@@ -1,661 +0,0 @@
1
- ---
2
- title: 'API Reference'
3
- description: 'Complete GraphQL API reference for Exulu IMP'
4
- ---
5
-
6
- ## Overview
7
-
8
- The Exulu IMP GraphQL API provides programmatic access to manage agents, contexts, workflows, evaluations, and all other platform resources. The schema is **automatically generated** based on your ExuluContext and ExuluProvider instances, providing both core types and dynamic types tailored to your implementation.
9
-
10
- <CardGroup cols={3}>
11
- <Card title="Dynamic schema" icon="wand-magic-sparkles">
12
- Types are generated from your ExuluContext and ExuluProvider definitions
13
- </Card>
14
- <Card title="Full CRUD" icon="database">
15
- Create, read, update, and delete operations for all resources
16
- </Card>
17
- <Card title="Advanced filtering" icon="filter">
18
- Powerful filter operators with AND/OR logic
19
- </Card>
20
- </CardGroup>
21
-
22
- ## GraphQL endpoint
23
-
24
- ```
25
- POST https://your-domain.com/graphql
26
- ```
27
-
28
- ## Authentication
29
-
30
- All API requests must be authenticated using one of three methods:
31
-
32
- ### API key authentication
33
-
34
- Pass your API key in the `x-api-key` header:
35
-
36
- ```bash
37
- curl -X POST https://your-domain.com/graphql \
38
- -H "x-api-key: sk_abc123.../production-api-key" \
39
- -H "Content-Type: application/json" \
40
- -d '{"query": "query { agentsPagination { items { id name } } }"}'
41
- ```
42
-
43
- ### Session token authentication
44
-
45
- For web applications using NextAuth:
46
-
47
- ```bash
48
- curl -X POST https://your-domain.com/graphql \
49
- -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
50
- -H "Content-Type: application/json" \
51
- -d '{"query": "..."}'
52
- ```
53
-
54
- ### Internal key authentication
55
-
56
- For service-to-service communication:
57
-
58
- ```bash
59
- curl -X POST https://your-domain.com/graphql \
60
- -H "internal: YOUR_INTERNAL_SECRET" \
61
- -H "Content-Type: application/json" \
62
- -d '{"query": "..."}'
63
- ```
64
-
65
- <Tip>
66
- Generate API keys using [`ExuluDatabase.api.key.generate()`](/core/exulu-database#api-key-generation)
67
- </Tip>
68
-
69
- ## GraphQL Playground
70
-
71
- The easiest way to explore and test your GraphQL API is using the built-in GraphQL Playground.
72
-
73
- ### Accessing the playground
74
-
75
- When running the Exulu frontend:
76
-
77
- ```bash
78
- npx @exulu/frontend
79
- ```
80
-
81
- Visit the `/explorer` route in your browser:
82
-
83
- ```
84
- http://localhost:3000/explorer
85
- ```
86
-
87
- <Info>
88
- The GraphQL Playground is automatically configured with your specific Exulu IMP implementation, including all your custom ExuluContext types and dynamic schema.
89
- </Info>
90
-
91
- ### Features
92
-
93
- The playground provides:
94
-
95
- - **Schema explorer** - Browse all available types, queries, and mutations
96
- - **Autocomplete** - IntelliSense for query building
97
- - **Documentation** - Inline docs for all fields and operations
98
- - **Query history** - Access previously executed queries
99
- - **Variables editor** - Test queries with dynamic variables
100
- - **Authentication** - Automatically uses your session token
101
-
102
- <Tip>
103
- Run `npx @exulu/frontend` in the same folder as your Exulu IMP project to ensure the playground reflects your current schema configuration.
104
- </Tip>
105
-
106
- ### Example usage
107
-
108
- 1. Start your Exulu IMP backend
109
- 2. Run `npx @exulu/frontend` in your project folder
110
- 3. Open `http://localhost:3000/explorer`
111
- 4. Use the schema explorer to discover available types
112
- 5. Build and execute queries using autocomplete
113
-
114
- The playground is especially useful for:
115
- - Testing queries during development
116
- - Exploring your dynamically-generated schema
117
- - Debugging filter and mutation operations
118
- - Learning the API structure
119
-
120
- ## Schema structure
121
-
122
- The Exulu IMP GraphQL schema consists of:
123
-
124
- ### Core types
125
-
126
- Predefined types for platform resources:
127
-
128
- - **agents** - AI agent configurations
129
- - **users** - User accounts and authentication
130
- - **roles** - Role-based access control
131
- - **agent_sessions** - Conversation sessions
132
- - **agent_messages** - Chat messages
133
- - **test_cases** - Evaluation test cases
134
- - **eval_sets** - Evaluation test sets
135
- - **eval_runs** - Evaluation executions
136
- - **workflow_templates** - Workflow definitions
137
- - **statistics** - Usage analytics
138
- - **variables** - Encrypted configuration values
139
- - **projects** - Project organization
140
- - **prompt_library** - Saved prompts
141
- - **prompt_favorites** - Favorited prompts
142
-
143
- ### Dynamic types
144
-
145
- Types automatically generated from your ExuluContext instances. Each context creates:
146
-
147
- - **items table** - Main resource storage (e.g., `documentation`, `support_tickets`)
148
- - **chunks table** - Vector embeddings for semantic search (if embedder is configured)
149
-
150
- **Example:** A context with `id: "documentation"` generates:
151
- - `documentation` type
152
- - `documentationInput` type
153
- - `FilterDocumentation` input type
154
- - `documentationVectorSearch` query
155
- - CRUD mutations: `documentationCreateOne`, `documentationUpdateOne`, etc.
156
-
157
- ## Making requests
158
-
159
- ### Basic query
160
-
161
- ```graphql
162
- query {
163
- agentsPagination(limit: 10, page: 1) {
164
- items {
165
- id
166
- name
167
- description
168
- provider
169
- modelName
170
- }
171
- pageInfo {
172
- currentPage
173
- pageCount
174
- hasNextPage
175
- }
176
- }
177
- }
178
- ```
179
-
180
- ### With filters
181
-
182
- ```graphql
183
- query {
184
- agentsPagination(
185
- limit: 10
186
- page: 1
187
- filters: [
188
- { name: { contains: "assistant" } }
189
- { provider: { eq: "anthropic" } }
190
- ]
191
- ) {
192
- items {
193
- id
194
- name
195
- }
196
- }
197
- }
198
- ```
199
-
200
- ### Creating a resource
201
-
202
- ```graphql
203
- mutation {
204
- agentsCreateOne(
205
- input: {
206
- name: "Customer Support Agent"
207
- description: "Handles customer inquiries"
208
- backend: "anthropic_claude"
209
- type: "agent"
210
- }
211
- ) {
212
- item {
213
- id
214
- name
215
- }
216
- }
217
- }
218
- ```
219
-
220
- ### Updating a resource
221
-
222
- ```graphql
223
- mutation {
224
- agentsUpdateOneById(
225
- id: "agent-id-123"
226
- input: {
227
- name: "Updated Agent Name"
228
- description: "New description"
229
- }
230
- ) {
231
- item {
232
- id
233
- name
234
- updatedAt
235
- }
236
- }
237
- }
238
- ```
239
-
240
- ## Filter operators
241
-
242
- Exulu IMP supports powerful filtering with type-specific operators:
243
-
244
- <AccordionGroup>
245
- <Accordion title="String operators">
246
- - `eq` - Equals
247
- - `ne` - Not equals
248
- - `in` - In array
249
- - `contains` - Case-insensitive substring match
250
- - `and` - Combine conditions with AND logic
251
- - `or` - Combine conditions with OR logic
252
-
253
- ```graphql
254
- filters: [
255
- { name: { contains: "assistant" } }
256
- { description: { contains: "support" } }
257
- ]
258
- ```
259
- </Accordion>
260
-
261
- <Accordion title="Number operators">
262
- - `eq` - Equals
263
- - `ne` - Not equals
264
- - `in` - In array
265
- - `lte` - Less than or equal
266
- - `gte` - Greater than or equal
267
- - `and` - Combine conditions
268
- - `or` - Combine conditions
269
-
270
- ```graphql
271
- filters: [
272
- { age: { gte: 18, lte: 65 } }
273
- ]
274
- ```
275
- </Accordion>
276
-
277
- <Accordion title="Date operators">
278
- - `lte` - On or before date
279
- - `gte` - On or after date
280
- - `and` - Combine conditions
281
- - `or` - Combine conditions
282
-
283
- ```graphql
284
- filters: [
285
- { createdAt: { gte: "2025-01-01T00:00:00Z" } }
286
- ]
287
- ```
288
- </Accordion>
289
-
290
- <Accordion title="Boolean operators">
291
- - `eq` - Equals
292
- - `ne` - Not equals
293
- - `in` - In array
294
- - `and` - Combine conditions
295
- - `or` - Combine conditions
296
-
297
- ```graphql
298
- filters: [
299
- { active: { eq: true } }
300
- ]
301
- ```
302
- </Accordion>
303
-
304
- <Accordion title="JSON operators">
305
- - `eq` - Equals
306
- - `ne` - Not equals
307
- - `in` - In array
308
- - `contains` - Contains (PostgreSQL `@>` operator)
309
-
310
- ```graphql
311
- filters: [
312
- { metadata: { contains: { category: "support" } } }
313
- ]
314
- ```
315
- </Accordion>
316
- </AccordionGroup>
317
-
318
- ## Pagination
319
-
320
- All `*Pagination` queries return paginated results:
321
-
322
- ```graphql
323
- query {
324
- agentsPagination(limit: 20, page: 2) {
325
- items {
326
- id
327
- name
328
- }
329
- pageInfo {
330
- currentPage # Current page number
331
- pageCount # Total number of pages
332
- itemCount # Total number of items
333
- hasPreviousPage # Whether there's a previous page
334
- hasNextPage # Whether there's a next page
335
- }
336
- }
337
- }
338
- ```
339
-
340
- ## Sorting
341
-
342
- Sort results by any field:
343
-
344
- ```graphql
345
- query {
346
- agentsPagination(
347
- sort: { field: "createdAt", direction: DESC }
348
- ) {
349
- items {
350
- id
351
- name
352
- createdAt
353
- }
354
- }
355
- }
356
- ```
357
-
358
- ## Vector search
359
-
360
- For contexts with embedders, perform semantic search:
361
-
362
- ```graphql
363
- query {
364
- documentationVectorSearch(
365
- query: "How do I deploy Exulu IMP?"
366
- method: cosineDistance
367
- cutoffs: { cosineDistance: 0.7 }
368
- expand: { before: 1, after: 1 }
369
- ) {
370
- chunks {
371
- chunk_content
372
- chunk_cosine_distance
373
- item_name
374
- item_id
375
- }
376
- context {
377
- name
378
- embedder
379
- }
380
- }
381
- }
382
- ```
383
-
384
- **Search methods:**
385
- - `cosineDistance` - Vector similarity (requires embedder)
386
- - `hybridSearch` - Combines vector and full-text search
387
- - `tsvector` - PostgreSQL full-text search
388
-
389
- ## Role-based access control (RBAC)
390
-
391
- Resources with RBAC enabled include access control information:
392
-
393
- ```graphql
394
- query {
395
- agentById(id: "agent-123") {
396
- id
397
- name
398
- RBAC {
399
- type
400
- users {
401
- id
402
- rights
403
- }
404
- roles {
405
- id
406
- rights
407
- }
408
- }
409
- }
410
- }
411
- ```
412
-
413
- **Setting RBAC on create:**
414
-
415
- ```graphql
416
- mutation {
417
- agentsCreateOne(
418
- input: {
419
- name: "Private Agent"
420
- RBAC: {
421
- users: [
422
- { id: "user-123", rights: "write" }
423
- { id: "user-456", rights: "read" }
424
- ]
425
- }
426
- }
427
- ) {
428
- item {
429
- id
430
- RBAC {
431
- users {
432
- id
433
- rights
434
- }
435
- }
436
- }
437
- }
438
- }
439
- ```
440
-
441
- ## Workflows
442
-
443
- Execute workflows with variables:
444
-
445
- ```graphql
446
- mutation {
447
- runWorkflow(
448
- id: "workflow-123"
449
- variables: {
450
- customerName: "John Doe"
451
- orderId: "12345"
452
- }
453
- ) {
454
- result
455
- job
456
- metadata
457
- }
458
- }
459
- ```
460
-
461
- ## Evaluations
462
-
463
- Run evaluation sets on agents:
464
-
465
- ```graphql
466
- mutation {
467
- runEval(
468
- id: "eval-run-123"
469
- test_case_ids: ["test-1", "test-2", "test-3"]
470
- ) {
471
- jobs
472
- count
473
- }
474
- }
475
- ```
476
-
477
- ## Background jobs
478
-
479
- Query job status from BullMQ queues:
480
-
481
- ```graphql
482
- query {
483
- jobs(
484
- queue: eval_runs
485
- statusses: [active, waiting, failed]
486
- page: 1
487
- limit: 50
488
- ) {
489
- items {
490
- id
491
- name
492
- state
493
- data
494
- failedReason
495
- attemptsMade
496
- }
497
- pageInfo {
498
- currentPage
499
- pageCount
500
- }
501
- }
502
- }
503
- ```
504
-
505
- **Queue operations:**
506
-
507
- ```graphql
508
- mutation {
509
- # Pause a queue
510
- pauseQueue(queue: eval_runs) {
511
- success
512
- }
513
-
514
- # Resume a queue
515
- resumeQueue(queue: eval_runs) {
516
- success
517
- }
518
-
519
- # Drain waiting jobs
520
- drainQueue(queue: eval_runs) {
521
- success
522
- }
523
-
524
- # Delete a specific job
525
- deleteJob(queue: eval_runs, id: "job-123") {
526
- success
527
- }
528
- }
529
- ```
530
-
531
- ## Statistics
532
-
533
- Aggregate statistics with grouping:
534
-
535
- ```graphql
536
- query {
537
- agentsStatistics(
538
- groupBy: "provider"
539
- limit: 10
540
- ) {
541
- group
542
- count
543
- }
544
- }
545
- ```
546
-
547
- ## Error handling
548
-
549
- Errors are returned in the standard GraphQL format:
550
-
551
- ```json
552
- {
553
- "errors": [
554
- {
555
- "message": "Record not found",
556
- "locations": [{ "line": 2, "column": 3 }],
557
- "path": ["agentById"]
558
- }
559
- ],
560
- "data": null
561
- }
562
- ```
563
-
564
- **Common error messages:**
565
-
566
- - `Record not found` - Resource doesn't exist or no access
567
- - `Insufficient permissions` - RBAC access denied
568
- - `Access control error` - User lacks role permission
569
- - `Invalid token` - Authentication failed
570
- - `You are not authorized` - Operation requires super_admin
571
-
572
- ## Schema introspection
573
-
574
- Explore the schema using introspection:
575
-
576
- ```graphql
577
- query {
578
- __schema {
579
- types {
580
- name
581
- kind
582
- description
583
- }
584
- }
585
- }
586
- ```
587
-
588
- Or query specific types:
589
-
590
- ```graphql
591
- query {
592
- __type(name: "agent") {
593
- name
594
- fields {
595
- name
596
- type {
597
- name
598
- kind
599
- }
600
- }
601
- }
602
- }
603
- ```
604
-
605
- ## GraphQL clients
606
-
607
- In addition to the [built-in GraphQL Playground](#graphql-playground) available at `/explorer`, you can use any GraphQL client:
608
-
609
- - **GraphQL Playground** - Standalone desktop app
610
- - **Apollo Studio** - Cloud-based GraphQL IDE
611
- - **Insomnia** - REST and GraphQL client
612
- - **Postman** - Supports GraphQL requests
613
-
614
- ## Rate limiting
615
-
616
- API rate limits are enforced per API key. If you exceed the limit, you'll receive:
617
-
618
- ```json
619
- {
620
- "errors": [
621
- {
622
- "message": "Rate limit exceeded. Try again in 60 seconds."
623
- }
624
- ]
625
- }
626
- ```
627
-
628
- ## Best practices
629
-
630
- <Tip>
631
- **Request only needed fields** - GraphQL allows you to specify exactly which fields you need, reducing payload size and improving performance
632
- </Tip>
633
-
634
- <Note>
635
- **Use pagination** - Always paginate large result sets to avoid timeout and memory issues
636
- </Note>
637
-
638
- <Warning>
639
- **Avoid deeply nested queries** - Deeply nested queries can cause performance problems. Keep nesting to 3-4 levels maximum
640
- </Warning>
641
-
642
- <Info>
643
- **Batch mutations** - When creating multiple resources, use array inputs instead of separate mutations when possible
644
- </Info>
645
-
646
- ## Next steps
647
-
648
- <CardGroup cols={2}>
649
- <Card title="Core types" icon="database" href="/api-reference/core-types">
650
- Explore predefined platform types
651
- </Card>
652
- <Card title="Dynamic types" icon="wand-magic-sparkles" href="/api-reference/dynamic-types">
653
- Learn about context-generated types
654
- </Card>
655
- <Card title="Queries" icon="magnifying-glass" href="/api-reference/queries">
656
- Reference for all query operations
657
- </Card>
658
- <Card title="Mutations" icon="pen-to-square" href="/api-reference/mutations">
659
- Reference for all mutation operations
660
- </Card>
661
- </CardGroup>