@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,511 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Overview"
|
|
3
|
-
description: "Centralized, encrypted variable management for API keys and secrets"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
|
|
8
|
-
`ExuluVariables` provides secure, centralized storage and retrieval of sensitive values like API keys, authentication tokens, and credentials. Variables are stored encrypted in the database and can be referenced across agents, tools, and embedders without exposing the actual values in code or environment files.
|
|
9
|
-
|
|
10
|
-
## Key features
|
|
11
|
-
|
|
12
|
-
<CardGroup cols={2}>
|
|
13
|
-
<Card title="Encrypted storage" icon="lock">
|
|
14
|
-
Variables are encrypted at rest using AES encryption
|
|
15
|
-
</Card>
|
|
16
|
-
<Card title="Centralized management" icon="database">
|
|
17
|
-
Store once, use everywhere across your application
|
|
18
|
-
</Card>
|
|
19
|
-
<Card title="UI/API management" icon="browser">
|
|
20
|
-
Create and update variables via UI or API
|
|
21
|
-
</Card>
|
|
22
|
-
<Card title="Reference by name" icon="tag">
|
|
23
|
-
Use variable names instead of hardcoded values
|
|
24
|
-
</Card>
|
|
25
|
-
<Card title="Automatic decryption" icon="key">
|
|
26
|
-
Variables are decrypted automatically when retrieved
|
|
27
|
-
</Card>
|
|
28
|
-
<Card title="Reusable" icon="recycle">
|
|
29
|
-
Share variables across agents, tools, and embedders
|
|
30
|
-
</Card>
|
|
31
|
-
</CardGroup>
|
|
32
|
-
|
|
33
|
-
## Why use ExuluVariables?
|
|
34
|
-
|
|
35
|
-
<AccordionGroup>
|
|
36
|
-
<Accordion title="Security">
|
|
37
|
-
Secrets aren't hardcoded in your codebase or stored in `.env` files that could be committed to version control. Variables are encrypted at rest and only decrypted when retrieved.
|
|
38
|
-
</Accordion>
|
|
39
|
-
|
|
40
|
-
<Accordion title="Centralization">
|
|
41
|
-
Update an API key once, and all agents, tools, and embedders using that variable automatically use the new value. No need to update multiple configuration files.
|
|
42
|
-
</Accordion>
|
|
43
|
-
|
|
44
|
-
<Accordion title="Flexibility">
|
|
45
|
-
Manage secrets through the UI or API without redeploying your application. Change API keys, tokens, or credentials on the fly.
|
|
46
|
-
</Accordion>
|
|
47
|
-
|
|
48
|
-
<Accordion title="Multi-environment">
|
|
49
|
-
Use different variables for development, staging, and production environments while keeping the same codebase.
|
|
50
|
-
</Accordion>
|
|
51
|
-
|
|
52
|
-
<Accordion title="Audit trail">
|
|
53
|
-
Track who created or updated variables (when integrated with your audit system).
|
|
54
|
-
</Accordion>
|
|
55
|
-
</AccordionGroup>
|
|
56
|
-
|
|
57
|
-
## Quick start
|
|
58
|
-
|
|
59
|
-
### Storing a variable
|
|
60
|
-
|
|
61
|
-
Variables can be created via the UI or API:
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
// Via API or database
|
|
65
|
-
INSERT INTO variables (name, value, encrypted)
|
|
66
|
-
VALUES ('openai_api_key', 'encrypted_value_here', true);
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Retrieving a variable
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
import { ExuluVariables } from "@exulu/backend";
|
|
73
|
-
|
|
74
|
-
// Get a variable value
|
|
75
|
-
const apiKey = await ExuluVariables.get("openai_api_key");
|
|
76
|
-
|
|
77
|
-
console.log(apiKey); // "sk-..."
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
The variable is automatically decrypted if it was stored encrypted.
|
|
81
|
-
|
|
82
|
-
## Common use cases
|
|
83
|
-
|
|
84
|
-
### API keys for LLM providers
|
|
85
|
-
|
|
86
|
-
Store API keys for OpenAI, Anthropic, Google, and other providers:
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
import { ExuluVariables } from "@exulu/backend";
|
|
90
|
-
|
|
91
|
-
// Store once in database:
|
|
92
|
-
// name: "openai_api_key", value: "sk-...", encrypted: true
|
|
93
|
-
// name: "anthropic_api_key", value: "sk-ant-...", encrypted: true
|
|
94
|
-
|
|
95
|
-
// Use in agents
|
|
96
|
-
const openaiKey = await ExuluVariables.get("openai_api_key");
|
|
97
|
-
|
|
98
|
-
const agent = new ExuluAgent({
|
|
99
|
-
id: "assistant",
|
|
100
|
-
name: "OpenAI Assistant",
|
|
101
|
-
type: "agent",
|
|
102
|
-
description: "AI assistant",
|
|
103
|
-
provider: "openai",
|
|
104
|
-
authenticationInformation: openaiKey, // Use retrieved variable
|
|
105
|
-
config: {
|
|
106
|
-
name: "gpt-4o",
|
|
107
|
-
model: {
|
|
108
|
-
create: ({ apiKey }) => createOpenAI({ apiKey: apiKey || openaiKey })("gpt-4o")
|
|
109
|
-
},
|
|
110
|
-
instructions: "You are a helpful assistant."
|
|
111
|
-
},
|
|
112
|
-
capabilities: { text: true, images: [], files: [], audio: [], video: [] }
|
|
113
|
-
});
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Embedding API keys
|
|
117
|
-
|
|
118
|
-
Use variables for embedding provider credentials:
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { ExuluVariables, ExuluEmbedder } from "@exulu/backend";
|
|
122
|
-
|
|
123
|
-
// Retrieve the API key
|
|
124
|
-
const openaiKey = await ExuluVariables.get("openai_api_key");
|
|
125
|
-
|
|
126
|
-
// Use in embedder
|
|
127
|
-
const embedder = new ExuluEmbedder({
|
|
128
|
-
id: "openai_embedder",
|
|
129
|
-
name: "OpenAI Embeddings",
|
|
130
|
-
provider: "openai",
|
|
131
|
-
model: "text-embedding-3-small",
|
|
132
|
-
vectorDimensions: 1536,
|
|
133
|
-
authenticationInformation: openaiKey // Use retrieved variable
|
|
134
|
-
});
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Tool authentication
|
|
138
|
-
|
|
139
|
-
Store credentials for external services used by tools:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
import { ExuluVariables, ExuluTool } from "@exulu/backend";
|
|
143
|
-
import { z } from "zod";
|
|
144
|
-
|
|
145
|
-
// Create tool with variable reference
|
|
146
|
-
const githubTool = new ExuluTool({
|
|
147
|
-
id: "github_search",
|
|
148
|
-
name: "search_github",
|
|
149
|
-
description: "Searches GitHub repositories",
|
|
150
|
-
type: "function",
|
|
151
|
-
inputSchema: z.object({
|
|
152
|
-
query: z.string()
|
|
153
|
-
}),
|
|
154
|
-
config: [
|
|
155
|
-
{
|
|
156
|
-
name: "github_token",
|
|
157
|
-
type: "variable", // Mark as variable reference
|
|
158
|
-
value: "github_api_token" // Variable name
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
execute: async ({ query }, config) => {
|
|
162
|
-
// Retrieve the variable inside execute
|
|
163
|
-
const token = await ExuluVariables.get("github_api_token");
|
|
164
|
-
|
|
165
|
-
const response = await fetch(
|
|
166
|
-
`https://api.github.com/search/repositories?q=${query}`,
|
|
167
|
-
{
|
|
168
|
-
headers: {
|
|
169
|
-
Authorization: `Bearer ${token}`
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
const data = await response.json();
|
|
175
|
-
return { result: JSON.stringify(data.items.slice(0, 5)) };
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Database credentials
|
|
181
|
-
|
|
182
|
-
Store database connection strings and credentials:
|
|
183
|
-
|
|
184
|
-
```typescript
|
|
185
|
-
import { ExuluVariables } from "@exulu/backend";
|
|
186
|
-
|
|
187
|
-
// Retrieve database URL
|
|
188
|
-
const databaseUrl = await ExuluVariables.get("database_url");
|
|
189
|
-
|
|
190
|
-
// Use in database connection
|
|
191
|
-
const db = createDatabaseClient({
|
|
192
|
-
connectionString: databaseUrl
|
|
193
|
-
});
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Multi-tenant applications
|
|
197
|
-
|
|
198
|
-
Different tenants can use different API keys:
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
import { ExuluVariables } from "@exulu/backend";
|
|
202
|
-
|
|
203
|
-
// Store tenant-specific keys:
|
|
204
|
-
// name: "tenant_1_openai_key", value: "sk-...", encrypted: true
|
|
205
|
-
// name: "tenant_2_openai_key", value: "sk-...", encrypted: true
|
|
206
|
-
|
|
207
|
-
async function getAgentForTenant(tenantId: string) {
|
|
208
|
-
const variableName = `tenant_${tenantId}_openai_key`;
|
|
209
|
-
const apiKey = await ExuluVariables.get(variableName);
|
|
210
|
-
|
|
211
|
-
return new ExuluAgent({
|
|
212
|
-
id: `tenant_${tenantId}_agent`,
|
|
213
|
-
name: `Agent for Tenant ${tenantId}`,
|
|
214
|
-
type: "agent",
|
|
215
|
-
description: "Tenant-specific agent",
|
|
216
|
-
provider: "openai",
|
|
217
|
-
authenticationInformation: apiKey,
|
|
218
|
-
config: { /* ... */ },
|
|
219
|
-
capabilities: { text: true, images: [], files: [], audio: [], video: [] }
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## How it works
|
|
225
|
-
|
|
226
|
-
### Storage
|
|
227
|
-
|
|
228
|
-
Variables are stored in the `variables` table in PostgreSQL:
|
|
229
|
-
|
|
230
|
-
```sql
|
|
231
|
-
CREATE TABLE variables (
|
|
232
|
-
name VARCHAR PRIMARY KEY,
|
|
233
|
-
value TEXT NOT NULL,
|
|
234
|
-
encrypted BOOLEAN DEFAULT false,
|
|
235
|
-
created_at TIMESTAMP DEFAULT NOW(),
|
|
236
|
-
updated_at TIMESTAMP DEFAULT NOW()
|
|
237
|
-
);
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Encryption
|
|
241
|
-
|
|
242
|
-
When `encrypted: true`, variables are encrypted using AES encryption with `NEXTAUTH_SECRET` as the encryption key:
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
// Encryption (when storing)
|
|
246
|
-
const encrypted = CryptoJS.AES.encrypt(value, process.env.NEXTAUTH_SECRET).toString();
|
|
247
|
-
|
|
248
|
-
// Decryption (when retrieving)
|
|
249
|
-
const bytes = CryptoJS.AES.decrypt(encrypted, process.env.NEXTAUTH_SECRET);
|
|
250
|
-
const decrypted = bytes.toString(CryptoJS.enc.Utf8);
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
<Warning>
|
|
254
|
-
The `NEXTAUTH_SECRET` environment variable must be set and consistent across deployments. If it changes, previously encrypted variables cannot be decrypted.
|
|
255
|
-
</Warning>
|
|
256
|
-
|
|
257
|
-
### Retrieval
|
|
258
|
-
|
|
259
|
-
When you call `ExuluVariables.get()`:
|
|
260
|
-
|
|
261
|
-
1. Queries the `variables` table for the specified name
|
|
262
|
-
2. Throws an error if the variable doesn't exist
|
|
263
|
-
3. Decrypts the value if `encrypted: true`
|
|
264
|
-
4. Returns the decrypted value
|
|
265
|
-
|
|
266
|
-
## Variable workflow
|
|
267
|
-
|
|
268
|
-
<Steps>
|
|
269
|
-
<Step title="Create variable">
|
|
270
|
-
Store a variable in the database via UI or API
|
|
271
|
-
|
|
272
|
-
```typescript
|
|
273
|
-
// Via UI: Navigate to Settings → Variables → Add Variable
|
|
274
|
-
// Or via API/SQL:
|
|
275
|
-
INSERT INTO variables (name, value, encrypted)
|
|
276
|
-
VALUES ('my_api_key', 'sk-...', true);
|
|
277
|
-
```
|
|
278
|
-
</Step>
|
|
279
|
-
|
|
280
|
-
<Step title="Reference in code">
|
|
281
|
-
Retrieve the variable using `ExuluVariables.get()`
|
|
282
|
-
|
|
283
|
-
```typescript
|
|
284
|
-
const apiKey = await ExuluVariables.get("my_api_key");
|
|
285
|
-
```
|
|
286
|
-
</Step>
|
|
287
|
-
|
|
288
|
-
<Step title="Use in configuration">
|
|
289
|
-
Pass the retrieved value to agents, tools, or embedders
|
|
290
|
-
|
|
291
|
-
```typescript
|
|
292
|
-
const agent = new ExuluAgent({
|
|
293
|
-
// ...
|
|
294
|
-
authenticationInformation: apiKey
|
|
295
|
-
});
|
|
296
|
-
```
|
|
297
|
-
</Step>
|
|
298
|
-
|
|
299
|
-
<Step title="Update as needed">
|
|
300
|
-
Update the variable value through UI or API without code changes
|
|
301
|
-
|
|
302
|
-
```typescript
|
|
303
|
-
UPDATE variables
|
|
304
|
-
SET value = 'new_encrypted_value'
|
|
305
|
-
WHERE name = 'my_api_key';
|
|
306
|
-
```
|
|
307
|
-
</Step>
|
|
308
|
-
</Steps>
|
|
309
|
-
|
|
310
|
-
## Variable naming conventions
|
|
311
|
-
|
|
312
|
-
<Tip>
|
|
313
|
-
Use descriptive, namespaced names for variables to avoid conflicts and improve clarity.
|
|
314
|
-
</Tip>
|
|
315
|
-
|
|
316
|
-
**Recommended patterns:**
|
|
317
|
-
|
|
318
|
-
```typescript
|
|
319
|
-
// Provider API keys
|
|
320
|
-
"openai_api_key"
|
|
321
|
-
"anthropic_api_key"
|
|
322
|
-
"google_api_key"
|
|
323
|
-
|
|
324
|
-
// Service-specific
|
|
325
|
-
"github_api_token"
|
|
326
|
-
"stripe_api_key"
|
|
327
|
-
"sendgrid_api_key"
|
|
328
|
-
|
|
329
|
-
// Environment-specific
|
|
330
|
-
"prod_openai_api_key"
|
|
331
|
-
"dev_openai_api_key"
|
|
332
|
-
|
|
333
|
-
// Tenant-specific
|
|
334
|
-
"tenant_123_openai_key"
|
|
335
|
-
"tenant_456_anthropic_key"
|
|
336
|
-
|
|
337
|
-
// Feature-specific
|
|
338
|
-
"embeddings_openai_key"
|
|
339
|
-
"chat_openai_key"
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
## Error handling
|
|
343
|
-
|
|
344
|
-
```typescript
|
|
345
|
-
import { ExuluVariables } from "@exulu/backend";
|
|
346
|
-
|
|
347
|
-
try {
|
|
348
|
-
const apiKey = await ExuluVariables.get("my_variable");
|
|
349
|
-
console.log("Retrieved variable:", apiKey);
|
|
350
|
-
} catch (error) {
|
|
351
|
-
console.error("Variable not found:", error.message);
|
|
352
|
-
// Handle missing variable (use default, prompt user, etc.)
|
|
353
|
-
}
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
`ExuluVariables.get()` throws an error if:
|
|
357
|
-
- The variable name doesn't exist in the database
|
|
358
|
-
- Database connection fails
|
|
359
|
-
- Decryption fails (e.g., wrong `NEXTAUTH_SECRET`)
|
|
360
|
-
|
|
361
|
-
## Security considerations
|
|
362
|
-
|
|
363
|
-
<Warning>
|
|
364
|
-
**Protect your `NEXTAUTH_SECRET`**: This key is used to encrypt/decrypt variables. Store it securely and never commit it to version control.
|
|
365
|
-
</Warning>
|
|
366
|
-
|
|
367
|
-
<Note>
|
|
368
|
-
**Database access**: Variables are stored in your PostgreSQL database. Ensure proper database access controls and backups.
|
|
369
|
-
</Note>
|
|
370
|
-
|
|
371
|
-
<Info>
|
|
372
|
-
**Encryption at rest**: Variables with `encrypted: true` are encrypted in the database. They are decrypted in memory when retrieved.
|
|
373
|
-
</Info>
|
|
374
|
-
|
|
375
|
-
<Tip>
|
|
376
|
-
**Principle of least privilege**: Only grant access to variables that are necessary. Consider using separate variables for different environments or tenants.
|
|
377
|
-
</Tip>
|
|
378
|
-
|
|
379
|
-
## Comparison with .env files
|
|
380
|
-
|
|
381
|
-
| Feature | ExuluVariables | .env files |
|
|
382
|
-
|---------|---------------|------------|
|
|
383
|
-
| **Storage** | Database (encrypted) | File system (plain text) |
|
|
384
|
-
| **Management** | UI/API | Manual file editing |
|
|
385
|
-
| **Updates** | No redeployment needed | Requires restart/redeploy |
|
|
386
|
-
| **Sharing** | Centralized across app | Per-instance |
|
|
387
|
-
| **Version control** | Not in code | Risk of accidental commit |
|
|
388
|
-
| **Encryption** | ✅ Built-in | ❌ Plain text |
|
|
389
|
-
| **Audit trail** | ✅ Possible | ❌ No |
|
|
390
|
-
| **Multi-tenant** | ✅ Easy | ❌ Difficult |
|
|
391
|
-
|
|
392
|
-
**Use ExuluVariables when:**
|
|
393
|
-
- You need to update secrets without redeployment
|
|
394
|
-
- Multiple agents/tools share the same credentials
|
|
395
|
-
- You want encrypted storage
|
|
396
|
-
- You need centralized management
|
|
397
|
-
- You're building a multi-tenant application
|
|
398
|
-
|
|
399
|
-
**Use .env files when:**
|
|
400
|
-
- You have simple, static configuration
|
|
401
|
-
- Secrets are environment-specific and rarely change
|
|
402
|
-
- You prefer file-based configuration
|
|
403
|
-
|
|
404
|
-
## Integration examples
|
|
405
|
-
|
|
406
|
-
### Complete agent setup
|
|
407
|
-
|
|
408
|
-
```typescript
|
|
409
|
-
import { ExuluAgent, ExuluVariables } from "@exulu/backend";
|
|
410
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
411
|
-
|
|
412
|
-
// Retrieve API key
|
|
413
|
-
const openaiKey = await ExuluVariables.get("openai_api_key");
|
|
414
|
-
|
|
415
|
-
// Create agent
|
|
416
|
-
const agent = new ExuluAgent({
|
|
417
|
-
id: "customer_support",
|
|
418
|
-
name: "Customer Support Agent",
|
|
419
|
-
type: "agent",
|
|
420
|
-
description: "Handles customer inquiries",
|
|
421
|
-
provider: "openai",
|
|
422
|
-
authenticationInformation: openaiKey,
|
|
423
|
-
config: {
|
|
424
|
-
name: "gpt-4o",
|
|
425
|
-
model: {
|
|
426
|
-
create: ({ apiKey }) => createOpenAI({ apiKey: apiKey || openaiKey })("gpt-4o")
|
|
427
|
-
},
|
|
428
|
-
instructions: "You are a helpful customer support agent."
|
|
429
|
-
},
|
|
430
|
-
capabilities: { text: true, images: [], files: [], audio: [], video: [] }
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
// Use agent
|
|
434
|
-
const response = await agent.generateSync({
|
|
435
|
-
prompt: "How do I reset my password?",
|
|
436
|
-
agentInstance: await loadAgent("customer_support"),
|
|
437
|
-
statistics: { label: "support", trigger: "api" }
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
console.log(response);
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
### Multi-provider setup
|
|
444
|
-
|
|
445
|
-
```typescript
|
|
446
|
-
import { ExuluAgent, ExuluVariables } from "@exulu/backend";
|
|
447
|
-
|
|
448
|
-
// Retrieve keys for multiple providers
|
|
449
|
-
const [openaiKey, anthropicKey, googleKey] = await Promise.all([
|
|
450
|
-
ExuluVariables.get("openai_api_key"),
|
|
451
|
-
ExuluVariables.get("anthropic_api_key"),
|
|
452
|
-
ExuluVariables.get("google_api_key")
|
|
453
|
-
]);
|
|
454
|
-
|
|
455
|
-
// Create agents for each provider
|
|
456
|
-
const openaiAgent = new ExuluAgent({
|
|
457
|
-
id: "openai_agent",
|
|
458
|
-
provider: "openai",
|
|
459
|
-
authenticationInformation: openaiKey,
|
|
460
|
-
// ... config
|
|
461
|
-
});
|
|
462
|
-
|
|
463
|
-
const anthropicAgent = new ExuluAgent({
|
|
464
|
-
id: "anthropic_agent",
|
|
465
|
-
provider: "anthropic",
|
|
466
|
-
authenticationInformation: anthropicKey,
|
|
467
|
-
// ... config
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
const googleAgent = new ExuluAgent({
|
|
471
|
-
id: "google_agent",
|
|
472
|
-
provider: "google",
|
|
473
|
-
authenticationInformation: googleKey,
|
|
474
|
-
// ... config
|
|
475
|
-
});
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
## Best practices
|
|
479
|
-
|
|
480
|
-
<Tip>
|
|
481
|
-
**Always encrypt sensitive values**: Set `encrypted: true` for API keys, tokens, passwords, and other secrets.
|
|
482
|
-
</Tip>
|
|
483
|
-
|
|
484
|
-
<Note>
|
|
485
|
-
**Use descriptive names**: Name variables clearly to avoid confusion (e.g., `openai_api_key` instead of `key1`).
|
|
486
|
-
</Note>
|
|
487
|
-
|
|
488
|
-
<Warning>
|
|
489
|
-
**Handle missing variables**: Always wrap `ExuluVariables.get()` in try/catch to handle cases where variables don't exist.
|
|
490
|
-
</Warning>
|
|
491
|
-
|
|
492
|
-
<Info>
|
|
493
|
-
**Document your variables**: Maintain a list of required variables for your application, especially when onboarding new team members.
|
|
494
|
-
</Info>
|
|
495
|
-
|
|
496
|
-
## Next steps
|
|
497
|
-
|
|
498
|
-
<CardGroup cols={2}>
|
|
499
|
-
<Card title="Configuration" icon="gear" href="/core/exulu-variables/configuration">
|
|
500
|
-
Learn about variable setup
|
|
501
|
-
</Card>
|
|
502
|
-
<Card title="API reference" icon="code" href="/core/exulu-variables/api-reference">
|
|
503
|
-
Explore methods and usage
|
|
504
|
-
</Card>
|
|
505
|
-
<Card title="ExuluAgent" icon="robot" href="/core/exulu-agent/introduction">
|
|
506
|
-
Use variables with agents
|
|
507
|
-
</Card>
|
|
508
|
-
<Card title="ExuluTool" icon="wrench" href="/core/exulu-tool/introduction">
|
|
509
|
-
Use variables with tools
|
|
510
|
-
</Card>
|
|
511
|
-
</CardGroup>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'Development'
|
|
3
|
-
description: 'Preview changes locally to update your docs'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<Info>
|
|
7
|
-
**Prerequisites**:
|
|
8
|
-
- Node.js version 19 or higher
|
|
9
|
-
- A docs repository with a `docs.json` file
|
|
10
|
-
</Info>
|
|
11
|
-
|
|
12
|
-
Follow these steps to install and run Mintlify on your operating system.
|
|
13
|
-
|
|
14
|
-
<Steps>
|
|
15
|
-
<Step title="Install the Mintlify CLI">
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm i -g mint
|
|
19
|
-
```
|
|
20
|
-
</Step>
|
|
21
|
-
|
|
22
|
-
<Step title="Preview locally">
|
|
23
|
-
|
|
24
|
-
Navigate to your docs directory where your `docs.json` file is located, and run the following command:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
mint dev
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
A local preview of your documentation will be available at `http://localhost:3000`.
|
|
31
|
-
|
|
32
|
-
</Step>
|
|
33
|
-
</Steps>
|
|
34
|
-
|
|
35
|
-
## Custom ports
|
|
36
|
-
|
|
37
|
-
By default, Mintlify uses port 3000. You can customize the port Mintlify runs on by using the `--port` flag. For example, to run Mintlify on port 3333, use this command:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
mint dev --port 3333
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
If you attempt to run Mintlify on a port that's already in use, it will use the next available port:
|
|
44
|
-
|
|
45
|
-
```md
|
|
46
|
-
Port 3000 is already in use. Trying 3001 instead.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Mintlify versions
|
|
50
|
-
|
|
51
|
-
Please note that each CLI release is associated with a specific version of Mintlify. If your local preview does not align with the production version, please update the CLI:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npm mint update
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Validating links
|
|
58
|
-
|
|
59
|
-
The CLI can assist with validating links in your documentation. To identify any broken links, use the following command:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
mint broken-links
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Deployment
|
|
66
|
-
|
|
67
|
-
If the deployment is successful, you should see the following:
|
|
68
|
-
|
|
69
|
-
<Frame>
|
|
70
|
-
<img src="/images/checks-passed.png" alt="Screenshot of a deployment confirmation message that says All checks have passed." style={{ borderRadius: '0.5rem' }} />
|
|
71
|
-
</Frame>
|
|
72
|
-
|
|
73
|
-
## Code formatting
|
|
74
|
-
|
|
75
|
-
We suggest using extensions on your IDE to recognize and format MDX. If you're a VSCode user, consider the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.
|
|
76
|
-
|
|
77
|
-
## Troubleshooting
|
|
78
|
-
|
|
79
|
-
<AccordionGroup>
|
|
80
|
-
<Accordion title='Error: Could not load the "sharp" module using the darwin-arm64 runtime'>
|
|
81
|
-
|
|
82
|
-
This may be due to an outdated version of node. Try the following:
|
|
83
|
-
1. Remove the currently-installed version of the CLI: `npm remove -g mint`
|
|
84
|
-
2. Upgrade to Node v19 or higher.
|
|
85
|
-
3. Reinstall the CLI: `npm i -g mint`
|
|
86
|
-
</Accordion>
|
|
87
|
-
|
|
88
|
-
<Accordion title="Issue: Encountering an unknown error">
|
|
89
|
-
|
|
90
|
-
Solution: Go to the root of your device and delete the `~/.mintlify` folder. Then run `mint dev` again.
|
|
91
|
-
</Accordion>
|
|
92
|
-
</AccordionGroup>
|
|
93
|
-
|
|
94
|
-
Curious about what changed in the latest CLI version? Check out the [CLI changelog](https://www.npmjs.com/package/mintlify?activeTab=versions).
|