@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,690 +0,0 @@
1
- ---
2
- title: "Configuration"
3
- description: "Complete guide to configuring ExuluAgent for AI-powered task execution"
4
- ---
5
-
6
- ## Constructor parameters
7
-
8
- The ExuluAgent constructor accepts a configuration object with the following parameters:
9
-
10
- ```typescript
11
- const agent = new ExuluAgent({
12
- id: string,
13
- name: string,
14
- type: "agent",
15
- description: string,
16
- provider: string,
17
- config?: ExuluAgentConfig,
18
- capabilities?: Capabilities,
19
- maxContextLength?: number,
20
- authenticationInformation?: string,
21
- queue?: ExuluQueueConfig,
22
- workflows?: WorkflowConfig,
23
- rateLimit?: RateLimiterRule
24
- });
25
- ```
26
-
27
- ## Required parameters
28
-
29
- ### id
30
-
31
- <ParamField path="id" type="string" required>
32
- Unique identifier for the agent. Must start with a letter or underscore, contain only alphanumeric characters and underscores, 5-80 characters long.
33
- </ParamField>
34
-
35
- ```typescript
36
- id: "customer_support_agent"
37
- ```
38
-
39
- <Warning>
40
- The ID should not change after creation as it's used for database references and routing.
41
- </Warning>
42
-
43
- ### name
44
-
45
- <ParamField path="name" type="string" required>
46
- Human-readable name displayed in UI and logs
47
- </ParamField>
48
-
49
- ```typescript
50
- name: "Customer Support Agent"
51
- ```
52
-
53
- ### type
54
-
55
- <ParamField path="type" type="'agent'" required>
56
- Must be set to `"agent"`
57
- </ParamField>
58
-
59
- ```typescript
60
- type: "agent"
61
- ```
62
-
63
- ### description
64
-
65
- <ParamField path="description" type="string" required>
66
- Description of what the agent does. Used when the agent is called as a tool by other agents.
67
- </ParamField>
68
-
69
- ```typescript
70
- description: "Handles customer support inquiries and provides product information"
71
- ```
72
-
73
- ### provider
74
-
75
- <ParamField path="provider" type="string" required>
76
- LLM provider name (e.g., "openai", "anthropic", "google")
77
- </ParamField>
78
-
79
- ```typescript
80
- provider: "openai"
81
- ```
82
-
83
- ## Optional parameters
84
-
85
- ### config
86
-
87
- <ParamField path="config" type="ExuluAgentConfig">
88
- Configuration object containing model details and instructions
89
- </ParamField>
90
-
91
- ```typescript
92
- config: {
93
- name: "gpt-4o",
94
- model: {
95
- create: ({ apiKey }) => createOpenAI({ apiKey })("gpt-4o")
96
- },
97
- instructions: "You are a helpful assistant..."
98
- }
99
- ```
100
-
101
- #### Config properties
102
-
103
- <ParamField path="config.name" type="string">
104
- Model name (e.g., "gpt-4o", "claude-opus-4")
105
- </ParamField>
106
-
107
- <ParamField path="config.model" type="ModelFactory">
108
- Factory function that creates a LanguageModel instance from the AI SDK
109
- </ParamField>
110
-
111
- ```typescript
112
- model: {
113
- create: ({ apiKey }: { apiKey?: string }) => LanguageModel
114
- }
115
- ```
116
-
117
- <ParamField path="config.instructions" type="string">
118
- System instructions that define the agent's behavior, personality, and capabilities
119
- </ParamField>
120
-
121
- ```typescript
122
- instructions: `You are a customer support agent for Acme Corp.
123
-
124
- Guidelines:
125
- - Be friendly and professional
126
- - Answer questions clearly and concisely
127
- - Escalate complex technical issues to engineering
128
- - Always verify customer identity for account changes
129
-
130
- Company information:
131
- - Founded in 2020
132
- - 10,000+ customers worldwide
133
- - 24/7 support available`
134
- ```
135
-
136
- <Tip>
137
- Instructions are critical for agent performance. Include guidelines, examples, company information, and edge cases to handle.
138
- </Tip>
139
-
140
- ### capabilities
141
-
142
- <ParamField path="capabilities" type="Capabilities">
143
- Define what types of input the agent can process
144
- </ParamField>
145
-
146
- ```typescript
147
- capabilities: {
148
- text: boolean,
149
- images: imageTypes[],
150
- files: fileTypes[],
151
- audio: audioTypes[],
152
- video: videoTypes[]
153
- }
154
- ```
155
-
156
- #### Capability types
157
-
158
- ```typescript
159
- type imageTypes = '.png' | '.jpg' | '.jpeg' | '.gif' | '.webp';
160
- type fileTypes = '.pdf' | '.docx' | '.xlsx' | '.xls' | '.csv' |
161
- '.pptx' | '.ppt' | '.txt' | '.md' | '.json';
162
- type audioTypes = '.mp3' | '.wav' | '.m4a' | '.mp4' | '.mpeg';
163
- type videoTypes = '.mp4' | '.m4a' | '.mp3' | '.mpeg' | '.wav';
164
- ```
165
-
166
- **Example:**
167
-
168
- ```typescript
169
- capabilities: {
170
- text: true,
171
- images: [".png", ".jpg", ".jpeg"],
172
- files: [".pdf", ".docx", ".txt"],
173
- audio: [],
174
- video: []
175
- }
176
- ```
177
-
178
- ### maxContextLength
179
-
180
- <ParamField path="maxContextLength" type="number">
181
- Maximum number of tokens in the conversation context
182
- </ParamField>
183
-
184
- ```typescript
185
- maxContextLength: 128000 // GPT-4o context window
186
- ```
187
-
188
- ### authenticationInformation
189
-
190
- <ParamField path="authenticationInformation" type="string">
191
- Authentication details for API access
192
- </ParamField>
193
-
194
- ```typescript
195
- authenticationInformation: "Use OPENAI_API_KEY environment variable"
196
- ```
197
-
198
- ### queue
199
-
200
- <ParamField path="queue" type="ExuluQueueConfig">
201
- Queue configuration for background job processing
202
- </ParamField>
203
-
204
- ```typescript
205
- queue: await ExuluQueues.register("agent_queue")
206
- ```
207
-
208
- ### workflows
209
-
210
- <ParamField path="workflows" type="WorkflowConfig">
211
- Enable background workflow processing
212
- </ParamField>
213
-
214
- ```typescript
215
- workflows: {
216
- enabled: true,
217
- queue: await ExuluQueues.register("workflows")
218
- }
219
- ```
220
-
221
- ### rateLimit
222
-
223
- <ParamField path="rateLimit" type="RateLimiterRule">
224
- Rate limiting configuration for API access
225
- </ParamField>
226
-
227
- ```typescript
228
- rateLimit: {
229
- points: 100, // Number of requests
230
- duration: 60, // Time window in seconds
231
- blockDuration: 60 // Block duration after exceeding limit
232
- }
233
- ```
234
-
235
- ## Configuration examples
236
-
237
- ### OpenAI agent
238
-
239
- ```typescript
240
- import { ExuluAgent } from "@exulu/backend";
241
- import { createOpenAI } from "@ai-sdk/openai";
242
-
243
- const gpt4Agent = new ExuluAgent({
244
- id: "gpt4_assistant",
245
- name: "GPT-4 Assistant",
246
- type: "agent",
247
- description: "General-purpose AI assistant powered by GPT-4",
248
- provider: "openai",
249
- config: {
250
- name: "gpt-4o",
251
- model: {
252
- create: ({ apiKey }) => createOpenAI({
253
- apiKey: apiKey || process.env.OPENAI_API_KEY
254
- })("gpt-4o")
255
- },
256
- instructions: `You are a helpful AI assistant. Answer questions clearly,
257
- concisely, and accurately. If you don't know something, say so.`
258
- },
259
- capabilities: {
260
- text: true,
261
- images: [".png", ".jpg", ".jpeg", ".gif", ".webp"],
262
- files: [".pdf", ".docx", ".txt"],
263
- audio: [],
264
- video: []
265
- },
266
- maxContextLength: 128000
267
- });
268
- ```
269
-
270
- ### Anthropic Claude agent
271
-
272
- ```typescript
273
- import { ExuluAgent } from "@exulu/backend";
274
- import { createAnthropic } from "@ai-sdk/anthropic";
275
-
276
- const claudeAgent = new ExuluAgent({
277
- id: "claude_opus_4",
278
- name: "Claude Opus 4",
279
- type: "agent",
280
- description: "Advanced reasoning agent powered by Claude Opus 4",
281
- provider: "anthropic",
282
- config: {
283
- name: "claude-opus-4-20250514",
284
- model: {
285
- create: ({ apiKey }) => createAnthropic({
286
- apiKey: apiKey || process.env.ANTHROPIC_API_KEY
287
- })("claude-opus-4-20250514")
288
- },
289
- instructions: `You are Claude, an AI assistant created by Anthropic.
290
- You are thoughtful, nuanced, and detailed in your responses.`
291
- },
292
- capabilities: {
293
- text: true,
294
- images: [".png", ".jpg", ".jpeg", ".gif", ".webp"],
295
- files: [".pdf", ".txt"],
296
- audio: [],
297
- video: []
298
- },
299
- maxContextLength: 200000
300
- });
301
- ```
302
-
303
- ### Google Gemini agent
304
-
305
- ```typescript
306
- import { ExuluAgent } from "@exulu/backend";
307
- import { createGoogleGenerativeAI } from "@ai-sdk/google";
308
-
309
- const geminiAgent = new ExuluAgent({
310
- id: "gemini_2_5_pro",
311
- name: "Gemini 2.5 Pro",
312
- type: "agent",
313
- description: "Multi-modal AI agent powered by Google Gemini",
314
- provider: "google",
315
- config: {
316
- name: "gemini-2.5-pro",
317
- model: {
318
- create: ({ apiKey }) => createGoogleGenerativeAI({
319
- apiKey: apiKey || process.env.GOOGLE_API_KEY
320
- })("gemini-2.5-pro")
321
- },
322
- instructions: "You are Gemini, Google's most capable AI model."
323
- },
324
- capabilities: {
325
- text: true,
326
- images: [".png", ".jpg", ".jpeg", ".gif", ".webp"],
327
- files: [".pdf", ".docx", ".txt"],
328
- audio: [".mp3", ".wav"],
329
- video: [".mp4"]
330
- },
331
- maxContextLength: 1000000
332
- });
333
- ```
334
-
335
- ### Specialist agent with memory
336
-
337
- ```typescript
338
- import { ExuluAgent } from "@exulu/backend";
339
- import { createOpenAI } from "@ai-sdk/openai";
340
-
341
- const supportAgent = new ExuluAgent({
342
- id: "support_specialist",
343
- name: "Support Specialist",
344
- type: "agent",
345
- description: "Customer support agent with memory of past interactions",
346
- provider: "openai",
347
- config: {
348
- name: "gpt-4o",
349
- model: {
350
- create: ({ apiKey }) => createOpenAI({ apiKey })("gpt-4o")
351
- },
352
- instructions: `You are a customer support specialist for Acme Corp.
353
-
354
- Guidelines:
355
- - Always be friendly, patient, and professional
356
- - Use past conversation history to provide personalized help
357
- - Verify customer identity before sharing account information
358
- - Escalate billing issues to the finance team
359
- - Document all interactions in the memory system
360
-
361
- Product knowledge:
362
- - Acme Pro: $99/month, includes all features
363
- - Acme Basic: $29/month, limited to 100 projects
364
- - All plans include 24/7 support`,
365
- memory: "customer_interactions" // Context ID for memory
366
- },
367
- capabilities: {
368
- text: true,
369
- images: [".png", ".jpg"],
370
- files: [".pdf", ".txt"],
371
- audio: [],
372
- video: []
373
- },
374
- maxContextLength: 128000
375
- });
376
- ```
377
-
378
- <Note>
379
- When `memory` is configured, the agent automatically searches relevant past interactions before responding and can create new memory items.
380
- </Note>
381
-
382
- ### Agent with workflows
383
-
384
- ```typescript
385
- import { ExuluAgent, ExuluQueues } from "@exulu/backend";
386
- import { createOpenAI } from "@ai-sdk/openai";
387
-
388
- const asyncAgent = new ExuluAgent({
389
- id: "async_processor",
390
- name: "Async Processor",
391
- type: "agent",
392
- description: "Processes long-running tasks in the background",
393
- provider: "openai",
394
- config: {
395
- name: "gpt-4o-mini",
396
- model: {
397
- create: ({ apiKey }) => createOpenAI({ apiKey })("gpt-4o-mini")
398
- },
399
- instructions: "Process tasks efficiently and report results."
400
- },
401
- capabilities: {
402
- text: true,
403
- images: [],
404
- files: [".pdf", ".docx", ".txt"],
405
- audio: [],
406
- video: []
407
- },
408
- workflows: {
409
- enabled: true,
410
- queue: await ExuluQueues.register("async_agent_queue")
411
- },
412
- queue: await ExuluQueues.register("agent_tasks")
413
- });
414
- ```
415
-
416
- ### Data extraction agent
417
-
418
- ```typescript
419
- import { ExuluAgent } from "@exulu/backend";
420
- import { createOpenAI } from "@ai-sdk/openai";
421
-
422
- const extractorAgent = new ExuluAgent({
423
- id: "data_extractor",
424
- name: "Data Extractor",
425
- type: "agent",
426
- description: "Extracts structured data from unstructured text",
427
- provider: "openai",
428
- config: {
429
- name: "gpt-4o-mini",
430
- model: {
431
- create: ({ apiKey }) => createOpenAI({ apiKey })("gpt-4o-mini")
432
- },
433
- instructions: `You extract structured data from text.
434
- Be precise and only include information that is explicitly stated.
435
- If information is missing, use null values.`
436
- },
437
- capabilities: {
438
- text: true,
439
- images: [],
440
- files: [".pdf", ".docx", ".txt", ".json"],
441
- audio: [],
442
- video: []
443
- },
444
- maxContextLength: 16000
445
- });
446
-
447
- // Use with outputSchema
448
- const result = await extractorAgent.generateSync({
449
- prompt: "Extract contact info from this email",
450
- outputSchema: z.object({
451
- name: z.string(),
452
- email: z.string().email(),
453
- phone: z.string().optional(),
454
- company: z.string().optional()
455
- })
456
- });
457
- ```
458
-
459
- ### Rate-limited agent
460
-
461
- ```typescript
462
- import { ExuluAgent } from "@exulu/backend";
463
- import { createOpenAI } from "@ai-sdk/openai";
464
-
465
- const publicAgent = new ExuluAgent({
466
- id: "public_assistant",
467
- name: "Public Assistant",
468
- type: "agent",
469
- description: "Publicly accessible AI assistant with rate limiting",
470
- provider: "openai",
471
- config: {
472
- name: "gpt-4o-mini",
473
- model: {
474
- create: ({ apiKey }) => createOpenAI({ apiKey })("gpt-4o-mini")
475
- },
476
- instructions: "You are a helpful assistant for public users."
477
- },
478
- capabilities: {
479
- text: true,
480
- images: [],
481
- files: [],
482
- audio: [],
483
- video: []
484
- },
485
- rateLimit: {
486
- points: 20, // 20 requests
487
- duration: 3600, // Per hour
488
- blockDuration: 3600 // Block for 1 hour if exceeded
489
- }
490
- });
491
- ```
492
-
493
- ## Using default agents
494
-
495
- Exulu IMP provides pre-configured agents for all major providers:
496
-
497
- ```typescript
498
- import { ExuluDefaultAgents } from "@exulu/backend";
499
-
500
- // OpenAI agents
501
- const gpt4o = ExuluDefaultAgents.GPT_4O;
502
- const gpt5 = ExuluDefaultAgents.GPT_5;
503
- const o1 = ExuluDefaultAgents.O1;
504
-
505
- // Anthropic agents
506
- const claudeOpus = ExuluDefaultAgents.CLAUDE_OPUS_4;
507
- const claudeSonnet = ExuluDefaultAgents.CLAUDE_SONNET_4_5;
508
-
509
- // Google agents
510
- const geminiFlash = ExuluDefaultAgents.GEMINI_2_5_FLASH;
511
- const geminiPro = ExuluDefaultAgents.GEMINI_2_5_PRO;
512
-
513
- // Other providers
514
- const llama = ExuluDefaultAgents.LLAMA_3_3;
515
- const deepseek = ExuluDefaultAgents.DEEPSEEK_R1;
516
-
517
- // Register with app
518
- const app = new ExuluApp();
519
- await app.create({
520
- agents: {
521
- gpt4o,
522
- claude: claudeOpus,
523
- gemini: geminiPro
524
- },
525
- config: { /* ... */ }
526
- });
527
- ```
528
-
529
- ## Agent instructions best practices
530
-
531
- <AccordionGroup>
532
- <Accordion title="Define clear role and purpose">
533
- Start with who the agent is and what it does:
534
-
535
- ```typescript
536
- instructions: `You are a financial advisor AI assistant specializing in
537
- personal finance and investment strategy for retail investors.
538
-
539
- Your purpose is to:
540
- - Provide educational information about investing
541
- - Help users understand financial concepts
542
- - Suggest strategies based on risk tolerance
543
- - NOT provide specific investment advice or recommendations`
544
- ```
545
- </Accordion>
546
-
547
- <Accordion title="Set behavioral guidelines">
548
- Define how the agent should behave:
549
-
550
- ```typescript
551
- instructions: `Guidelines:
552
- - Be friendly, patient, and professional
553
- - Ask clarifying questions when requests are ambiguous
554
- - Admit when you don't know something
555
- - Never make up information
556
- - Cite sources when providing factual information
557
- - Break down complex topics into simple explanations`
558
- ```
559
- </Accordion>
560
-
561
- <Accordion title="Provide domain knowledge">
562
- Include relevant facts and context:
563
-
564
- ```typescript
565
- instructions: `Company information:
566
- - Founded: 2020
567
- - Products: SaaS platform for team collaboration
568
- - Pricing: Basic ($29/mo), Pro ($99/mo), Enterprise (custom)
569
- - Support: 24/7 live chat, email, phone for Pro+
570
- - Headquarters: San Francisco, CA
571
- - Customers: 10,000+ companies in 50 countries`
572
- ```
573
- </Accordion>
574
-
575
- <Accordion title="Handle edge cases">
576
- Define behavior for special situations:
577
-
578
- ```typescript
579
- instructions: `Edge cases:
580
- - If user asks for personal information, decline politely
581
- - If user is angry or frustrated, remain calm and empathetic
582
- - If technical issue requires engineering, create a support ticket
583
- - If billing question, redirect to finance team
584
- - If medical/legal advice, disclaimer that you're not qualified`
585
- ```
586
- </Accordion>
587
-
588
- <Accordion title="Use examples">
589
- Show desired behavior with examples:
590
-
591
- ```typescript
592
- instructions: `Example interactions:
593
-
594
- User: "How do I reset my password?"
595
- You: "I can help with that! You can reset your password by clicking
596
- 'Forgot Password' on the login page. You'll receive an email with
597
- reset instructions within a few minutes. Is there anything specific
598
- you're having trouble with?"
599
-
600
- User: "Why is my account not working?"
601
- You: "I'm sorry to hear you're having trouble. To help diagnose the
602
- issue, could you tell me: 1) What error message are you seeing?
603
- 2) When did this start? 3) What were you trying to do?"`
604
- ```
605
- </Accordion>
606
- </AccordionGroup>
607
-
608
- ## Memory configuration
609
-
610
- When configuring agent memory, create a dedicated ExuluContext:
611
-
612
- ```typescript
613
- import { ExuluContext, ExuluAgent, ExuluEmbedder } from "@exulu/backend";
614
-
615
- // Create memory context
616
- const memoryContext = new ExuluContext({
617
- id: "agent_memory",
618
- name: "Agent Memory",
619
- description: "Stores agent conversation history and learnings",
620
- active: true,
621
- fields: [
622
- {
623
- name: "interaction",
624
- type: "longtext",
625
- required: true
626
- },
627
- {
628
- name: "user_id",
629
- type: "text",
630
- index: true
631
- },
632
- {
633
- name: "topic",
634
- type: "text",
635
- index: true
636
- }
637
- ],
638
- embedder: myEmbedder,
639
- sources: [],
640
- configuration: {
641
- calculateVectors: "onInsert",
642
- maxRetrievalResults: 10
643
- }
644
- });
645
-
646
- // Configure agent to use memory
647
- const agent = new ExuluAgent({
648
- id: "assistant_with_memory",
649
- name: "Assistant with Memory",
650
- type: "agent",
651
- description: "AI assistant with long-term memory",
652
- provider: "openai",
653
- config: {
654
- name: "gpt-4o",
655
- model: { /* ... */ },
656
- instructions: "You are an assistant with memory of past conversations.",
657
- memory: "agent_memory" // Reference the context ID
658
- },
659
- capabilities: { text: true, images: [], files: [], audio: [], video: [] }
660
- });
661
- ```
662
-
663
- ## Environment variables
664
-
665
- Agents typically require API keys from environment variables:
666
-
667
- ```bash
668
- # OpenAI
669
- OPENAI_API_KEY=sk-...
670
-
671
- # Anthropic
672
- ANTHROPIC_API_KEY=sk-ant-...
673
-
674
- # Google
675
- GOOGLE_API_KEY=...
676
-
677
- # Security (required for encrypted variables)
678
- NEXTAUTH_SECRET=your-secret-key
679
- ```
680
-
681
- ## Next steps
682
-
683
- <CardGroup cols={2}>
684
- <Card title="API reference" icon="code" href="/core/exulu-agent/api-reference">
685
- Explore methods and properties
686
- </Card>
687
- <Card title="ExuluTool" icon="wrench" href="/core/exulu-tool/introduction">
688
- Learn about agent tools
689
- </Card>
690
- </CardGroup>