@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.
- package/dist/index.cjs +351 -42
- package/dist/index.d.cts +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +340 -38
- package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
- package/ee/python/README.md +295 -0
- package/ee/python/documents/processing/README.md +155 -0
- package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
- package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
- package/ee/python/setup.sh +180 -0
- package/package.json +14 -3
- package/scripts/postinstall.cjs +149 -0
- package/.agents/skills/mintlify/SKILL.md +0 -347
- package/.editorconfig +0 -15
- package/.eslintrc.json +0 -52
- package/.github/workflows/release-backend.yml +0 -38
- package/.husky/commit-msg +0 -1
- package/.jscpd.json +0 -18
- package/.mcp.json +0 -25
- package/.nvmrc +0 -1
- package/.prettierignore +0 -5
- package/.prettierrc.json +0 -12
- package/CHANGELOG.md +0 -8
- package/SECURITY.md +0 -5
- package/commitlint.config.js +0 -4
- package/devops/documentation/patch-older-releases.md +0 -42
- package/ee/documents/processing/build_pdf_processor.sh +0 -35
- package/ee/documents/processing/chunk_markdown.py +0 -263
- package/ee/documents/processing/pdf_processor.spec +0 -115
- package/eslint.config.js +0 -88
- package/jest.config.ts +0 -25
- package/mintlify-docs/.mintignore +0 -7
- package/mintlify-docs/AGENTS.md +0 -33
- package/mintlify-docs/CLAUDE.MD +0 -50
- package/mintlify-docs/CONTRIBUTING.md +0 -32
- package/mintlify-docs/LICENSE +0 -21
- package/mintlify-docs/README.md +0 -55
- package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
- package/mintlify-docs/ai-tools/cursor.mdx +0 -39
- package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
- package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
- package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
- package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
- package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
- package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
- package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
- package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
- package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
- package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
- package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
- package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
- package/mintlify-docs/api-reference/core-types.mdx +0 -585
- package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
- package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
- package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
- package/mintlify-docs/api-reference/introduction.mdx +0 -661
- package/mintlify-docs/api-reference/mutations.mdx +0 -1012
- package/mintlify-docs/api-reference/openapi.json +0 -217
- package/mintlify-docs/api-reference/queries.mdx +0 -1154
- package/mintlify-docs/backend/introduction.mdx +0 -218
- package/mintlify-docs/changelog.mdx +0 -387
- package/mintlify-docs/community-edition.mdx +0 -304
- package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
- package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
- package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
- package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
- package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
- package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
- package/mintlify-docs/core/exulu-authentication.mdx +0 -810
- package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
- package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
- package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
- package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
- package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
- package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
- package/mintlify-docs/core/exulu-database.mdx +0 -811
- package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
- package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
- package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
- package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
- package/mintlify-docs/core/exulu-logging.mdx +0 -464
- package/mintlify-docs/core/exulu-otel.mdx +0 -670
- package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
- package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
- package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
- package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
- package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
- package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
- package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
- package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
- package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
- package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
- package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
- package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
- package/mintlify-docs/development.mdx +0 -94
- package/mintlify-docs/docs.json +0 -248
- package/mintlify-docs/enterprise-edition.mdx +0 -538
- package/mintlify-docs/essentials/code.mdx +0 -35
- package/mintlify-docs/essentials/images.mdx +0 -59
- package/mintlify-docs/essentials/markdown.mdx +0 -88
- package/mintlify-docs/essentials/navigation.mdx +0 -87
- package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
- package/mintlify-docs/essentials/settings.mdx +0 -318
- package/mintlify-docs/favicon.svg +0 -3
- package/mintlify-docs/frontend/introduction.mdx +0 -39
- package/mintlify-docs/getting-started.mdx +0 -267
- package/mintlify-docs/guides/custom-agent.mdx +0 -608
- package/mintlify-docs/guides/first-agent.mdx +0 -315
- package/mintlify-docs/images/admin_ui.png +0 -0
- package/mintlify-docs/images/contexts.png +0 -0
- package/mintlify-docs/images/create_agents.png +0 -0
- package/mintlify-docs/images/evals.png +0 -0
- package/mintlify-docs/images/graphql.png +0 -0
- package/mintlify-docs/images/graphql_api.png +0 -0
- package/mintlify-docs/images/hero-dark.png +0 -0
- package/mintlify-docs/images/hero-light.png +0 -0
- package/mintlify-docs/images/hero.png +0 -0
- package/mintlify-docs/images/knowledge_sources.png +0 -0
- package/mintlify-docs/images/mcp.png +0 -0
- package/mintlify-docs/images/scaling.png +0 -0
- package/mintlify-docs/index.mdx +0 -411
- package/mintlify-docs/logo/dark.svg +0 -9
- package/mintlify-docs/logo/light.svg +0 -9
- package/mintlify-docs/partners.mdx +0 -558
- package/mintlify-docs/products.mdx +0 -77
- package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
- package/mintlify-docs/styles.css +0 -207
- package/ngrok.bash +0 -1
- package/ngrok.md +0 -6
- package/ngrok.yml +0 -10
- package/release.config.cjs +0 -15
- package/skills-lock.json +0 -10
- package/types/context-processor.ts +0 -45
- package/types/enums/eval-types.ts +0 -5
- package/types/enums/field-types.ts +0 -1
- package/types/enums/jobs.ts +0 -11
- package/types/enums/statistics.ts +0 -13
- package/types/exulu-table-definition.ts +0 -79
- package/types/file-types.ts +0 -18
- package/types/models/agent-session.ts +0 -27
- package/types/models/agent.ts +0 -68
- package/types/models/context.ts +0 -53
- package/types/models/embedding.ts +0 -17
- package/types/models/eval-run.ts +0 -40
- package/types/models/exulu-agent-tool-config.ts +0 -11
- package/types/models/item.ts +0 -21
- package/types/models/job.ts +0 -8
- package/types/models/project.ts +0 -16
- package/types/models/rate-limiter-rules.ts +0 -7
- package/types/models/test-case.ts +0 -25
- package/types/models/tool.ts +0 -9
- package/types/models/user-role.ts +0 -12
- package/types/models/user.ts +0 -20
- package/types/models/variable.ts +0 -8
- package/types/models/vector-methods.ts +0 -7
- package/types/provider-config.ts +0 -21
- package/types/queue-config.ts +0 -16
- package/types/rbac-rights-modes.ts +0 -1
- package/types/statistics.ts +0 -20
- package/types/workflow.ts +0 -31
- /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
- /package/ee/{documents/processing → python}/requirements.txt +0 -0
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "API reference"
|
|
3
|
-
description: "Complete method and property reference for ExuluApp"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Constructor
|
|
7
|
-
|
|
8
|
-
```typescript
|
|
9
|
-
const app = new ExuluApp();
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Creates a new ExuluApp instance. The constructor takes no parameters. You must call `create()` to initialize the app.
|
|
13
|
-
|
|
14
|
-
## Methods
|
|
15
|
-
|
|
16
|
-
### create()
|
|
17
|
-
|
|
18
|
-
Initializes the ExuluApp with all components and returns the initialized instance.
|
|
19
|
-
|
|
20
|
-
```typescript
|
|
21
|
-
async create(options: CreateOptions): Promise<ExuluApp>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
<ParamField path="options.contexts" type="Record<string, ExuluContext>">
|
|
25
|
-
Object mapping context IDs to ExuluContext instances
|
|
26
|
-
</ParamField>
|
|
27
|
-
|
|
28
|
-
<ParamField path="options.config" type="ExuluConfig" required>
|
|
29
|
-
Configuration object for the app
|
|
30
|
-
</ParamField>
|
|
31
|
-
|
|
32
|
-
<ParamField path="options.agents" type="ExuluAgent[]">
|
|
33
|
-
Array of custom agents to register in addition to default agents
|
|
34
|
-
</ParamField>
|
|
35
|
-
|
|
36
|
-
<ParamField path="options.tools" type="ExuluTool[]">
|
|
37
|
-
Array of custom tools to register in addition to default tools
|
|
38
|
-
</ParamField>
|
|
39
|
-
|
|
40
|
-
<ParamField path="options.evals" type="ExuluEval[]">
|
|
41
|
-
Array of custom evaluations to register in addition to default evaluations
|
|
42
|
-
</ParamField>
|
|
43
|
-
|
|
44
|
-
<ParamField path="options.rerankers" type="ExuluReranker[]">
|
|
45
|
-
Array of reranker instances for improving search results
|
|
46
|
-
</ParamField>
|
|
47
|
-
|
|
48
|
-
<ResponseField name="return" type="Promise<ExuluApp>">
|
|
49
|
-
Returns the initialized ExuluApp instance
|
|
50
|
-
</ResponseField>
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
const app = new ExuluApp();
|
|
54
|
-
await app.create({
|
|
55
|
-
contexts: {
|
|
56
|
-
docs: myDocsContext
|
|
57
|
-
},
|
|
58
|
-
config: {
|
|
59
|
-
workers: { enabled: true },
|
|
60
|
-
MCP: { enabled: false },
|
|
61
|
-
telemetry: { enabled: false }
|
|
62
|
-
},
|
|
63
|
-
agents: [myCustomAgent],
|
|
64
|
-
tools: [myCustomTool]
|
|
65
|
-
});
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
<Warning>
|
|
69
|
-
All context, agent, tool, and reranker IDs must be valid PostgreSQL identifiers: start with a letter or underscore, contain only letters, digits, or underscores, be 5-80 characters long.
|
|
70
|
-
</Warning>
|
|
71
|
-
|
|
72
|
-
### express.init()
|
|
73
|
-
|
|
74
|
-
Initializes and returns the Express application with all routes configured.
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
async express.init(): Promise<Express>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
<ResponseField name="return" type="Promise<Express>">
|
|
81
|
-
Returns the Express app instance ready to listen on a port
|
|
82
|
-
</ResponseField>
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
const expressApp = await app.express.init();
|
|
86
|
-
expressApp.listen(3000, () => {
|
|
87
|
-
console.log("Server running on port 3000");
|
|
88
|
-
});
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
<Note>
|
|
92
|
-
This method must be called before accessing `app.expressApp`. It configures all GraphQL and REST routes, initializes logging, and optionally starts the MCP server.
|
|
93
|
-
</Note>
|
|
94
|
-
|
|
95
|
-
### tool()
|
|
96
|
-
|
|
97
|
-
Retrieves a registered tool by its ID.
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
tool(id: string): ExuluTool | undefined
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
<ParamField path="id" type="string" required>
|
|
104
|
-
The unique identifier of the tool
|
|
105
|
-
</ParamField>
|
|
106
|
-
|
|
107
|
-
<ResponseField name="return" type="ExuluTool | undefined">
|
|
108
|
-
Returns the tool if found, otherwise undefined
|
|
109
|
-
</ResponseField>
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
const perplexityTool = app.tool("perplexity_search");
|
|
113
|
-
if (perplexityTool) {
|
|
114
|
-
console.log(perplexityTool.name);
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### tools()
|
|
119
|
-
|
|
120
|
-
Returns all registered tools including default tools, custom tools, and context-generated tools.
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
tools(): ExuluTool[]
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
<ResponseField name="return" type="ExuluTool[]">
|
|
127
|
-
Array of all registered tools
|
|
128
|
-
</ResponseField>
|
|
129
|
-
|
|
130
|
-
```typescript
|
|
131
|
-
const allTools = app.tools();
|
|
132
|
-
console.log(`Registered ${allTools.length} tools`);
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### context()
|
|
136
|
-
|
|
137
|
-
Retrieves a registered context by its ID.
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
context(id: string): ExuluContext | undefined
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
<ParamField path="id" type="string" required>
|
|
144
|
-
The unique identifier of the context
|
|
145
|
-
</ParamField>
|
|
146
|
-
|
|
147
|
-
<ResponseField name="return" type="ExuluContext | undefined">
|
|
148
|
-
Returns the context if found, otherwise undefined
|
|
149
|
-
</ResponseField>
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
const docsContext = app.context("documentation");
|
|
153
|
-
if (docsContext) {
|
|
154
|
-
console.log(docsContext.name);
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### agent()
|
|
159
|
-
|
|
160
|
-
Retrieves a registered agent by its ID.
|
|
161
|
-
|
|
162
|
-
```typescript
|
|
163
|
-
agent(id: string): ExuluAgent | undefined
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
<ParamField path="id" type="string" required>
|
|
167
|
-
The unique identifier of the agent
|
|
168
|
-
</ParamField>
|
|
169
|
-
|
|
170
|
-
<ResponseField name="return" type="ExuluAgent | undefined">
|
|
171
|
-
Returns the agent if found, otherwise undefined
|
|
172
|
-
</ResponseField>
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
const claudeAgent = app.agent("claude_sonnet_45");
|
|
176
|
-
if (claudeAgent) {
|
|
177
|
-
console.log(claudeAgent.name);
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### embeddings.generate.one()
|
|
182
|
-
|
|
183
|
-
Generates embeddings for a single item in a context.
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
async embeddings.generate.one(options: GenerateOneOptions): Promise<any>
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
<ParamField path="options.context" type="string" required>
|
|
190
|
-
The context ID
|
|
191
|
-
</ParamField>
|
|
192
|
-
|
|
193
|
-
<ParamField path="options.item" type="string" required>
|
|
194
|
-
The item ID within the context
|
|
195
|
-
</ParamField>
|
|
196
|
-
|
|
197
|
-
<ResponseField name="return" type="Promise<any>">
|
|
198
|
-
Returns the embedding generation result
|
|
199
|
-
</ResponseField>
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
await app.embeddings.generate.one({
|
|
203
|
-
context: "documentation",
|
|
204
|
-
item: "doc_123"
|
|
205
|
-
});
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
<Info>
|
|
209
|
-
This method retrieves the item from the database, generates its embeddings using the context's configured embedder, and stores them in the vector database.
|
|
210
|
-
</Info>
|
|
211
|
-
|
|
212
|
-
### embeddings.generate.all()
|
|
213
|
-
|
|
214
|
-
Generates embeddings for all items in a context.
|
|
215
|
-
|
|
216
|
-
```typescript
|
|
217
|
-
async embeddings.generate.all(options: GenerateAllOptions): Promise<any>
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
<ParamField path="options.context" type="string" required>
|
|
221
|
-
The context ID
|
|
222
|
-
</ParamField>
|
|
223
|
-
|
|
224
|
-
<ResponseField name="return" type="Promise<any>">
|
|
225
|
-
Returns the embedding generation result for all items
|
|
226
|
-
</ResponseField>
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
await app.embeddings.generate.all({
|
|
230
|
-
context: "documentation"
|
|
231
|
-
});
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
<Warning>
|
|
235
|
-
This method processes all items in the context and can be resource-intensive for large datasets. Consider using background workers for production workloads.
|
|
236
|
-
</Warning>
|
|
237
|
-
|
|
238
|
-
### bullmq.workers.create()
|
|
239
|
-
|
|
240
|
-
Creates and starts BullMQ workers for processing background jobs.
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
async bullmq.workers.create(queues?: string[]): Promise<any>
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
<ParamField path="queues" type="string[]">
|
|
247
|
-
Optional array of queue names to listen to. If not provided, workers listen to all registered queues.
|
|
248
|
-
</ParamField>
|
|
249
|
-
|
|
250
|
-
<ResponseField name="return" type="Promise<any>">
|
|
251
|
-
Returns worker instances
|
|
252
|
-
</ResponseField>
|
|
253
|
-
|
|
254
|
-
```typescript
|
|
255
|
-
// Start workers for all queues
|
|
256
|
-
await app.bullmq.workers.create();
|
|
257
|
-
|
|
258
|
-
// Start workers for specific queues only
|
|
259
|
-
await app.bullmq.workers.create(["embeddings", "agent_requests"]);
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
<Note>
|
|
263
|
-
Workers automatically set up schedulers for context sources with configured schedules. This enables periodic data synchronization.
|
|
264
|
-
</Note>
|
|
265
|
-
|
|
266
|
-
## Properties
|
|
267
|
-
|
|
268
|
-
### expressApp
|
|
269
|
-
|
|
270
|
-
Returns the initialized Express application instance.
|
|
271
|
-
|
|
272
|
-
```typescript
|
|
273
|
-
public get expressApp(): Express
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
<ResponseField name="return" type="Express">
|
|
277
|
-
The Express app instance
|
|
278
|
-
</ResponseField>
|
|
279
|
-
|
|
280
|
-
```typescript
|
|
281
|
-
const app = await exuluApp.express.init();
|
|
282
|
-
const server = exuluApp.expressApp.listen(3000);
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
<Warning>
|
|
286
|
-
Throws an error if `express.init()` has not been called yet.
|
|
287
|
-
</Warning>
|
|
288
|
-
|
|
289
|
-
### contexts
|
|
290
|
-
|
|
291
|
-
Returns all registered contexts as an array.
|
|
292
|
-
|
|
293
|
-
```typescript
|
|
294
|
-
public get contexts(): ExuluContext[]
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
<ResponseField name="return" type="ExuluContext[]">
|
|
298
|
-
Array of all registered contexts
|
|
299
|
-
</ResponseField>
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
const contexts = app.contexts;
|
|
303
|
-
console.log(`Registered ${contexts.length} contexts`);
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### agents
|
|
307
|
-
|
|
308
|
-
Returns all registered agents including default and custom agents.
|
|
309
|
-
|
|
310
|
-
```typescript
|
|
311
|
-
public get agents(): ExuluAgent[]
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
<ResponseField name="return" type="ExuluAgent[]">
|
|
315
|
-
Array of all registered agents
|
|
316
|
-
</ResponseField>
|
|
317
|
-
|
|
318
|
-
```typescript
|
|
319
|
-
const agents = app.agents;
|
|
320
|
-
agents.forEach(agent => {
|
|
321
|
-
console.log(`${agent.name} (${agent.id})`);
|
|
322
|
-
});
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
## TypeScript types
|
|
326
|
-
|
|
327
|
-
### ExuluConfig
|
|
328
|
-
|
|
329
|
-
```typescript
|
|
330
|
-
type ExuluConfig = {
|
|
331
|
-
telemetry?: {
|
|
332
|
-
enabled: boolean;
|
|
333
|
-
};
|
|
334
|
-
logger?: {
|
|
335
|
-
winston: {
|
|
336
|
-
transports: winston.transport[];
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
workers: {
|
|
340
|
-
enabled: boolean;
|
|
341
|
-
logger?: {
|
|
342
|
-
winston: {
|
|
343
|
-
transports: winston.transport[];
|
|
344
|
-
};
|
|
345
|
-
};
|
|
346
|
-
telemetry?: {
|
|
347
|
-
enabled: boolean;
|
|
348
|
-
};
|
|
349
|
-
};
|
|
350
|
-
MCP: {
|
|
351
|
-
enabled: boolean;
|
|
352
|
-
};
|
|
353
|
-
fileUploads?: {
|
|
354
|
-
s3region: string;
|
|
355
|
-
s3key: string;
|
|
356
|
-
s3secret: string;
|
|
357
|
-
s3Bucket: string;
|
|
358
|
-
s3endpoint?: string;
|
|
359
|
-
s3prefix?: string;
|
|
360
|
-
};
|
|
361
|
-
privacy?: {
|
|
362
|
-
systemPromptPersonalization?: boolean;
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### CreateOptions
|
|
368
|
-
|
|
369
|
-
```typescript
|
|
370
|
-
type CreateOptions = {
|
|
371
|
-
contexts?: Record<string, ExuluContext>;
|
|
372
|
-
config: ExuluConfig;
|
|
373
|
-
agents?: ExuluAgent[];
|
|
374
|
-
tools?: ExuluTool[];
|
|
375
|
-
evals?: ExuluEval[];
|
|
376
|
-
rerankers?: ExuluReranker[];
|
|
377
|
-
};
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## Usage examples
|
|
381
|
-
|
|
382
|
-
### Basic server setup
|
|
383
|
-
|
|
384
|
-
```typescript
|
|
385
|
-
import { ExuluApp } from "@exulu/backend";
|
|
386
|
-
|
|
387
|
-
const app = new ExuluApp();
|
|
388
|
-
await app.create({
|
|
389
|
-
config: {
|
|
390
|
-
workers: { enabled: false },
|
|
391
|
-
MCP: { enabled: false },
|
|
392
|
-
telemetry: { enabled: false }
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
const expressApp = await app.express.init();
|
|
397
|
-
expressApp.listen(3000);
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
### Server with workers
|
|
401
|
-
|
|
402
|
-
```typescript
|
|
403
|
-
// server.ts
|
|
404
|
-
import { ExuluApp } from "@exulu/backend";
|
|
405
|
-
|
|
406
|
-
const app = new ExuluApp();
|
|
407
|
-
await app.create({
|
|
408
|
-
config: {
|
|
409
|
-
workers: { enabled: true },
|
|
410
|
-
MCP: { enabled: true },
|
|
411
|
-
telemetry: { enabled: true }
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
|
|
415
|
-
const expressApp = await app.express.init();
|
|
416
|
-
expressApp.listen(3000);
|
|
417
|
-
|
|
418
|
-
// workers.ts (separate process)
|
|
419
|
-
import { app } from "./server";
|
|
420
|
-
await app.bullmq.workers.create();
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
### With custom components
|
|
424
|
-
|
|
425
|
-
```typescript
|
|
426
|
-
import {
|
|
427
|
-
ExuluApp,
|
|
428
|
-
ExuluContext,
|
|
429
|
-
ExuluAgent,
|
|
430
|
-
ExuluTool
|
|
431
|
-
} from "@exulu/backend";
|
|
432
|
-
|
|
433
|
-
const customContext = new ExuluContext({
|
|
434
|
-
id: "my_context",
|
|
435
|
-
name: "My Context",
|
|
436
|
-
// ... context configuration
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
const customAgent = new ExuluAgent({
|
|
440
|
-
id: "my_agent",
|
|
441
|
-
name: "My Agent",
|
|
442
|
-
// ... agent configuration
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
const customTool = new ExuluTool({
|
|
446
|
-
id: "my_tool",
|
|
447
|
-
name: "My Tool",
|
|
448
|
-
// ... tool configuration
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
const app = new ExuluApp();
|
|
452
|
-
await app.create({
|
|
453
|
-
contexts: {
|
|
454
|
-
my_context: customContext
|
|
455
|
-
},
|
|
456
|
-
agents: [customAgent],
|
|
457
|
-
tools: [customTool],
|
|
458
|
-
config: {
|
|
459
|
-
workers: { enabled: true },
|
|
460
|
-
MCP: { enabled: false },
|
|
461
|
-
telemetry: { enabled: false }
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
### Accessing registered components
|
|
467
|
-
|
|
468
|
-
```typescript
|
|
469
|
-
// Get specific components
|
|
470
|
-
const agent = app.agent("claude_sonnet_45");
|
|
471
|
-
const context = app.context("documentation");
|
|
472
|
-
const tool = app.tool("perplexity_search");
|
|
473
|
-
|
|
474
|
-
// List all components
|
|
475
|
-
console.log("Agents:", app.agents.map(a => a.name));
|
|
476
|
-
console.log("Contexts:", app.contexts.map(c => c.name));
|
|
477
|
-
console.log("Tools:", app.tools().map(t => t.name));
|
|
478
|
-
|
|
479
|
-
// Generate embeddings
|
|
480
|
-
await app.embeddings.generate.all({ context: "documentation" });
|
|
481
|
-
```
|