@rcrsr/rill-ext-chroma 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andre Bremer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,268 @@
1
+ # @rcrsr/rill-ext-chroma
2
+
3
+ [rill](https://rill.run) extension for [ChromaDB](https://www.trychroma.com) vector database integration. Provides 11 host functions for vector CRUD, batch operations, and collection management.
4
+
5
+ > **Experimental.** Breaking changes will occur before stabilization.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @rcrsr/rill-ext-chroma
11
+ ```
12
+
13
+ **Peer dependencies:** `@rcrsr/rill`
14
+
15
+ ## Quick Start
16
+
17
+ ```typescript
18
+ import { parse, execute, createRuntimeContext, prefixFunctions } from '@rcrsr/rill';
19
+ import { createChromaExtension } from '@rcrsr/rill-ext-chroma';
20
+
21
+ const ext = createChromaExtension({
22
+ collection: 'my_vectors',
23
+ });
24
+ const prefixed = prefixFunctions('chroma', ext);
25
+ const { dispose, ...functions } = prefixed;
26
+
27
+ const ctx = createRuntimeContext({
28
+ functions,
29
+ callbacks: { onLog: (v) => console.log(v) },
30
+ });
31
+
32
+ const script = `
33
+ chroma::upsert("doc-1", $embedding, [title: "Example"])
34
+ chroma::search($embedding, [k: 5]) -> log
35
+ `;
36
+ const result = await execute(parse(script), ctx);
37
+
38
+ dispose?.();
39
+ ```
40
+
41
+ ## Host Functions
42
+
43
+ All vector database extensions share identical function signatures. Swap `chroma::` for `qdrant::` or `pinecone::` with no script changes.
44
+
45
+ ### chroma::upsert(id, vector, metadata?)
46
+
47
+ Insert or update a single vector with metadata.
48
+
49
+ ```rill
50
+ chroma::upsert("doc-1", $embedding, [title: "Example", page: 1]) => $result
51
+ $result.id -> log # "doc-1"
52
+ $result.success -> log # true
53
+ ```
54
+
55
+ **Idempotent.** Duplicate ID overwrites existing vector.
56
+
57
+ ### chroma::upsert_batch(items)
58
+
59
+ Batch insert or update vectors. Processes sequentially; halts on first failure.
60
+
61
+ ```rill
62
+ chroma::upsert_batch([
63
+ [id: "doc-1", vector: $v1, metadata: [title: "First"]],
64
+ [id: "doc-2", vector: $v2, metadata: [title: "Second"]]
65
+ ]) => $result
66
+ $result.succeeded -> log # 2
67
+ ```
68
+
69
+ Returns `{ succeeded }` on success. Returns `{ succeeded, failed, error }` on failure.
70
+
71
+ ### chroma::search(vector, options?)
72
+
73
+ Search for k nearest neighbors.
74
+
75
+ ```rill
76
+ chroma::search($embedding, [k: 5, score_threshold: 0.8]) => $results
77
+ $results -> each { "{.id}: {.score}" -> log }
78
+ ```
79
+
80
+ | Option | Type | Default | Description |
81
+ |--------|------|---------|-------------|
82
+ | `k` | number | `10` | Max results to return |
83
+ | `filter` | dict | `{}` | Metadata filter conditions |
84
+ | `score_threshold` | number | (none) | Exclude results below threshold |
85
+
86
+ Returns `[{ id, score, metadata }]`. Empty results return `[]`.
87
+
88
+ ### chroma::get(id)
89
+
90
+ Fetch a vector by ID.
91
+
92
+ ```rill
93
+ chroma::get("doc-1") => $point
94
+ $point.id -> log # "doc-1"
95
+ $point.metadata -> log # [title: "Example", page: 1]
96
+ ```
97
+
98
+ Returns `{ id, vector, metadata }`. Halts with error if ID not found.
99
+
100
+ ### chroma::delete(id)
101
+
102
+ Delete a vector by ID.
103
+
104
+ ```rill
105
+ chroma::delete("doc-1") => $result
106
+ $result.deleted -> log # true
107
+ ```
108
+
109
+ Returns `{ id, deleted }`. Halts with error if ID not found.
110
+
111
+ ### chroma::delete_batch(ids)
112
+
113
+ Batch delete vectors. Processes sequentially; halts on first failure.
114
+
115
+ ```rill
116
+ chroma::delete_batch(["doc-1", "doc-2", "doc-3"]) => $result
117
+ $result.succeeded -> log # 3
118
+ ```
119
+
120
+ Returns `{ succeeded }` on success. Returns `{ succeeded, failed, error }` on failure.
121
+
122
+ ### chroma::count()
123
+
124
+ Count vectors in the collection.
125
+
126
+ ```rill
127
+ chroma::count() -> log # 42
128
+ ```
129
+
130
+ Returns a number.
131
+
132
+ ### chroma::create_collection(name, options?)
133
+
134
+ Create a new collection.
135
+
136
+ ```rill
137
+ chroma::create_collection("my_vectors", [dimensions: 384, distance: "cosine"]) => $result
138
+ $result.created -> log # true
139
+ ```
140
+
141
+ | Option | Type | Default | Description |
142
+ |--------|------|---------|-------------|
143
+ | `dimensions` | number | (none) | Vector dimension size |
144
+ | `distance` | string | `"cosine"` | `"cosine"`, `"euclidean"`, or `"dot"` |
145
+
146
+ Returns `{ name, created }`. **Not idempotent** — halts if collection exists.
147
+
148
+ ### chroma::delete_collection(id)
149
+
150
+ Delete a collection.
151
+
152
+ ```rill
153
+ chroma::delete_collection("old_vectors") => $result
154
+ $result.deleted -> log # true
155
+ ```
156
+
157
+ Returns `{ name, deleted }`. **Not idempotent** — halts if collection not found.
158
+
159
+ ### chroma::list_collections()
160
+
161
+ List all collection names.
162
+
163
+ ```rill
164
+ chroma::list_collections() -> log # ["my_vectors", "archive"]
165
+ ```
166
+
167
+ Returns a list of strings.
168
+
169
+ ### chroma::describe()
170
+
171
+ Describe the configured collection.
172
+
173
+ ```rill
174
+ chroma::describe() => $info
175
+ $info.name -> log # "my_vectors"
176
+ $info.count -> log # 42
177
+ $info.dimensions -> log # 384
178
+ $info.distance -> log # "cosine"
179
+ ```
180
+
181
+ Returns `{ name, count, dimensions, distance }`.
182
+
183
+ ## Configuration
184
+
185
+ ```typescript
186
+ const ext = createChromaExtension({
187
+ url: 'http://localhost:8000',
188
+ collection: 'my_vectors',
189
+ embeddingFunction: 'openai',
190
+ timeout: 30000,
191
+ });
192
+ ```
193
+
194
+ | Option | Type | Default | Description |
195
+ |--------|------|---------|-------------|
196
+ | `url` | string | undefined | ChromaDB API endpoint (undefined uses embedded mode) |
197
+ | `collection` | string | required | Default collection name |
198
+ | `embeddingFunction` | string | undefined | Embedding function name |
199
+ | `timeout` | number | SDK default | Request timeout in ms |
200
+
201
+ ## Error Handling
202
+
203
+ All errors use `RuntimeError('RILL-R004', 'chroma: <message>')` and halt script execution.
204
+
205
+ | Condition | Message |
206
+ |-----------|---------|
207
+ | HTTP 401 | `chroma: authentication failed (401)` |
208
+ | Collection not found | `chroma: collection not found` |
209
+ | Rate limit (429) | `chroma: rate limit exceeded` |
210
+ | Timeout | `chroma: request timeout` |
211
+ | Dimension mismatch | `chroma: dimension mismatch (expected N, got M)` |
212
+ | Collection exists | `chroma: collection already exists` |
213
+ | ID not found | `chroma: id not found` |
214
+ | After dispose | `chroma: operation cancelled` |
215
+ | Other | `chroma: <error message>` |
216
+
217
+ ## Local Setup
218
+
219
+ ### Embedded Mode (default)
220
+
221
+ ChromaDB runs in-process without an external server:
222
+
223
+ ```typescript
224
+ const ext = createChromaExtension({
225
+ collection: 'test_collection',
226
+ });
227
+ ```
228
+
229
+ No Docker or server setup required.
230
+
231
+ ### HTTP Server Mode
232
+
233
+ Run ChromaDB with Docker:
234
+
235
+ ```bash
236
+ docker run -p 8000:8000 chromadb/chroma
237
+ ```
238
+
239
+ Verify: `curl http://localhost:8000/api/v1`
240
+
241
+ ```typescript
242
+ const ext = createChromaExtension({
243
+ url: 'http://localhost:8000',
244
+ collection: 'test_collection',
245
+ });
246
+ ```
247
+
248
+ ## Lifecycle
249
+
250
+ ```typescript
251
+ const ext = createChromaExtension({ ... });
252
+ // ... use extension ...
253
+ await ext.dispose?.();
254
+ ```
255
+
256
+ `dispose()` aborts pending requests and closes the SDK client. Idempotent — second call resolves without error.
257
+
258
+ ## Documentation
259
+
260
+ | Document | Description |
261
+ |----------|-------------|
262
+ | [Extensions Guide](https://github.com/rcrsr/rill/blob/main/docs/integration-extensions.md) | Extension contract and patterns |
263
+ | [Host API Reference](https://github.com/rcrsr/rill/blob/main/docs/ref-host-api.md) | Runtime context and host functions |
264
+ | [ChromaDB Documentation](https://docs.trychroma.com) | Official ChromaDB docs |
265
+
266
+ ## License
267
+
268
+ MIT
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Extension factory for ChromaDB vector database integration.
3
+ * Creates extension instance with config validation and SDK lifecycle management.
4
+ */
5
+ import { type ExtensionResult } from '@rcrsr/rill';
6
+ import type { ChromaConfig } from './types.js';
7
+ /**
8
+ * Create ChromaDB extension instance.
9
+ * Validates configuration and returns host functions with cleanup.
10
+ *
11
+ * @param config - Extension configuration
12
+ * @returns ExtensionResult with 11 vector database functions and dispose
13
+ * @throws Error for invalid configuration (AC-10)
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Embedded mode
18
+ * const ext = createChromaExtension({
19
+ * collection: 'my_vectors',
20
+ * });
21
+ *
22
+ * // HTTP mode
23
+ * const ext = createChromaExtension({
24
+ * url: 'http://localhost:8000',
25
+ * collection: 'my_vectors',
26
+ * });
27
+ * // Use with rill runtime...
28
+ * await ext.dispose();
29
+ * ```
30
+ */
31
+ export declare function createChromaExtension(config: ChromaConfig): ExtensionResult;
32
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAIL,KAAK,eAAe,EAIrB,MAAM,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CAovB3E"}
@@ -0,0 +1,667 @@
1
+ /**
2
+ * Extension factory for ChromaDB vector database integration.
3
+ * Creates extension instance with config validation and SDK lifecycle management.
4
+ */
5
+ import { ChromaClient } from 'chromadb';
6
+ import { RuntimeError, emitExtensionEvent, createVector, } from '@rcrsr/rill';
7
+ import { mapVectorError, createDisposalState, checkDisposed, dispose, assertRequired, } from '@rcrsr/rill-ext-vector-shared';
8
+ // ============================================================
9
+ // FACTORY
10
+ // ============================================================
11
+ /**
12
+ * Create ChromaDB extension instance.
13
+ * Validates configuration and returns host functions with cleanup.
14
+ *
15
+ * @param config - Extension configuration
16
+ * @returns ExtensionResult with 11 vector database functions and dispose
17
+ * @throws Error for invalid configuration (AC-10)
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Embedded mode
22
+ * const ext = createChromaExtension({
23
+ * collection: 'my_vectors',
24
+ * });
25
+ *
26
+ * // HTTP mode
27
+ * const ext = createChromaExtension({
28
+ * url: 'http://localhost:8000',
29
+ * collection: 'my_vectors',
30
+ * });
31
+ * // Use with rill runtime...
32
+ * await ext.dispose();
33
+ * ```
34
+ */
35
+ export function createChromaExtension(config) {
36
+ // Validate required fields (AC-10)
37
+ assertRequired(config.collection, 'collection');
38
+ // Instantiate SDK client at factory time
39
+ // Use embedded mode if url undefined, remote otherwise
40
+ const clientConfig = {};
41
+ if (config.url !== undefined) {
42
+ clientConfig.path = config.url;
43
+ }
44
+ const client = new ChromaClient(clientConfig);
45
+ // Store config values for use in functions
46
+ const factoryCollection = config.collection;
47
+ // Track disposal state (EC-8)
48
+ const disposalState = createDisposalState('chroma');
49
+ // Return extension result with implementations
50
+ const result = {
51
+ // IR-1: chroma::upsert
52
+ upsert: {
53
+ params: [
54
+ { name: 'id', type: 'string' },
55
+ { name: 'vector', type: 'vector' },
56
+ { name: 'metadata', type: 'dict', defaultValue: {} },
57
+ ],
58
+ fn: async (args, ctx) => {
59
+ const startTime = Date.now();
60
+ try {
61
+ checkDisposed(disposalState, 'chroma');
62
+ // Extract arguments
63
+ const id = args[0];
64
+ const vector = args[1];
65
+ const metadata = (args[2] ?? {});
66
+ // Get or create collection
67
+ const collection = await client.getOrCreateCollection({
68
+ name: factoryCollection,
69
+ });
70
+ // Call ChromaDB API
71
+ await collection.upsert({
72
+ ids: [id],
73
+ embeddings: [Array.from(vector.data)],
74
+ metadatas: [metadata],
75
+ });
76
+ // Build result
77
+ const result = {
78
+ id,
79
+ success: true,
80
+ };
81
+ // Emit success event
82
+ const duration = Date.now() - startTime;
83
+ emitExtensionEvent(ctx, {
84
+ event: 'chroma:upsert',
85
+ subsystem: 'extension:chroma',
86
+ duration,
87
+ id,
88
+ });
89
+ return result;
90
+ }
91
+ catch (error) {
92
+ // Map error and emit failure event
93
+ const duration = Date.now() - startTime;
94
+ const rillError = mapVectorError('chroma', error);
95
+ emitExtensionEvent(ctx, {
96
+ event: 'chroma:error',
97
+ subsystem: 'extension:chroma',
98
+ error: rillError.message,
99
+ duration,
100
+ });
101
+ throw rillError;
102
+ }
103
+ },
104
+ description: 'Insert or update single vector with metadata',
105
+ returnType: 'dict',
106
+ },
107
+ // IR-2: chroma::upsert_batch
108
+ upsert_batch: {
109
+ params: [{ name: 'items', type: 'list' }],
110
+ fn: async (args, ctx) => {
111
+ const startTime = Date.now();
112
+ try {
113
+ checkDisposed(disposalState, 'chroma');
114
+ // Extract arguments
115
+ const items = args[0];
116
+ let succeeded = 0;
117
+ // Get or create collection
118
+ const collection = await client.getOrCreateCollection({
119
+ name: factoryCollection,
120
+ });
121
+ // Process sequentially; halt on first failure
122
+ for (let i = 0; i < items.length; i++) {
123
+ const item = items[i];
124
+ // Validate item structure
125
+ if (!item || typeof item !== 'object') {
126
+ const result = {
127
+ succeeded,
128
+ failed: `index ${i}`,
129
+ error: 'invalid item structure',
130
+ };
131
+ const duration = Date.now() - startTime;
132
+ emitExtensionEvent(ctx, {
133
+ event: 'chroma:upsert_batch',
134
+ subsystem: 'extension:chroma',
135
+ duration,
136
+ count: items.length,
137
+ succeeded,
138
+ });
139
+ return result;
140
+ }
141
+ const id = item['id'];
142
+ const vector = item['vector'];
143
+ const metadata = (item['metadata'] ?? {});
144
+ try {
145
+ // Call ChromaDB API
146
+ await collection.upsert({
147
+ ids: [id],
148
+ embeddings: [Array.from(vector.data)],
149
+ metadatas: [
150
+ metadata,
151
+ ],
152
+ });
153
+ succeeded++;
154
+ }
155
+ catch (error) {
156
+ // Halt on first failure
157
+ const rillError = mapVectorError('chroma', error);
158
+ const result = {
159
+ succeeded,
160
+ failed: id,
161
+ error: rillError.message,
162
+ };
163
+ const duration = Date.now() - startTime;
164
+ emitExtensionEvent(ctx, {
165
+ event: 'chroma:upsert_batch',
166
+ subsystem: 'extension:chroma',
167
+ duration,
168
+ count: items.length,
169
+ succeeded,
170
+ });
171
+ return result;
172
+ }
173
+ }
174
+ // All succeeded
175
+ const result = { succeeded };
176
+ const duration = Date.now() - startTime;
177
+ emitExtensionEvent(ctx, {
178
+ event: 'chroma:upsert_batch',
179
+ subsystem: 'extension:chroma',
180
+ duration,
181
+ count: items.length,
182
+ succeeded,
183
+ });
184
+ return result;
185
+ }
186
+ catch (error) {
187
+ // Map error and emit failure event
188
+ const duration = Date.now() - startTime;
189
+ const rillError = mapVectorError('chroma', error);
190
+ emitExtensionEvent(ctx, {
191
+ event: 'chroma:error',
192
+ subsystem: 'extension:chroma',
193
+ error: rillError.message,
194
+ duration,
195
+ });
196
+ throw rillError;
197
+ }
198
+ },
199
+ description: 'Batch insert/update vectors',
200
+ returnType: 'dict',
201
+ },
202
+ // IR-3: chroma::search
203
+ search: {
204
+ params: [
205
+ { name: 'vector', type: 'vector' },
206
+ { name: 'options', type: 'dict', defaultValue: {} },
207
+ ],
208
+ fn: async (args, ctx) => {
209
+ const startTime = Date.now();
210
+ try {
211
+ checkDisposed(disposalState, 'chroma');
212
+ // Extract arguments
213
+ const vector = args[0];
214
+ const options = (args[1] ?? {});
215
+ // Extract options with defaults
216
+ const k = typeof options['k'] === 'number' ? options['k'] : 10;
217
+ const filter = (options['filter'] ?? {});
218
+ // Get or create collection
219
+ const collection = await client.getOrCreateCollection({
220
+ name: factoryCollection,
221
+ });
222
+ // Build query request
223
+ const queryRequest = {
224
+ queryEmbeddings: [Array.from(vector.data)],
225
+ nResults: k,
226
+ };
227
+ if (Object.keys(filter).length > 0) {
228
+ queryRequest.where = filter;
229
+ }
230
+ // Call ChromaDB API
231
+ const response = await collection.query(queryRequest);
232
+ // Build result list from first query results
233
+ const results = response.ids[0].map((id, idx) => ({
234
+ id: String(id),
235
+ score: response.distances?.[0]?.[idx] ?? 0,
236
+ metadata: response.metadatas?.[0]?.[idx] ?? {},
237
+ }));
238
+ // Emit success event
239
+ const duration = Date.now() - startTime;
240
+ emitExtensionEvent(ctx, {
241
+ event: 'chroma:search',
242
+ subsystem: 'extension:chroma',
243
+ duration,
244
+ result_count: results.length,
245
+ k,
246
+ });
247
+ return results;
248
+ }
249
+ catch (error) {
250
+ // Map error and emit failure event
251
+ const duration = Date.now() - startTime;
252
+ const rillError = mapVectorError('chroma', error);
253
+ emitExtensionEvent(ctx, {
254
+ event: 'chroma:error',
255
+ subsystem: 'extension:chroma',
256
+ error: rillError.message,
257
+ duration,
258
+ });
259
+ throw rillError;
260
+ }
261
+ },
262
+ description: 'Search k nearest neighbors',
263
+ returnType: 'list',
264
+ },
265
+ // IR-4: chroma::get
266
+ get: {
267
+ params: [{ name: 'id', type: 'string' }],
268
+ fn: async (args, ctx) => {
269
+ const startTime = Date.now();
270
+ try {
271
+ checkDisposed(disposalState, 'chroma');
272
+ // Extract arguments
273
+ const id = args[0];
274
+ // Get or create collection
275
+ const collection = await client.getOrCreateCollection({
276
+ name: factoryCollection,
277
+ });
278
+ // Call ChromaDB API
279
+ const response = await collection.get({
280
+ ids: [id],
281
+ });
282
+ // EC-7: ID not found
283
+ if (response.ids.length === 0) {
284
+ throw new RuntimeError('RILL-R004', 'chroma: id not found');
285
+ }
286
+ const embedding = response.embeddings?.[0];
287
+ const metadata = response.metadatas?.[0];
288
+ // Convert embedding to Float32Array
289
+ if (!embedding || !Array.isArray(embedding)) {
290
+ throw new RuntimeError('RILL-R004', 'chroma: invalid vector format');
291
+ }
292
+ const float32Data = new Float32Array(embedding);
293
+ const vector = createVector(float32Data, factoryCollection);
294
+ // Build result
295
+ const result = {
296
+ id: String(response.ids[0]),
297
+ vector,
298
+ metadata: metadata ?? {},
299
+ };
300
+ // Emit success event
301
+ const duration = Date.now() - startTime;
302
+ emitExtensionEvent(ctx, {
303
+ event: 'chroma:get',
304
+ subsystem: 'extension:chroma',
305
+ duration,
306
+ id,
307
+ });
308
+ return result;
309
+ }
310
+ catch (error) {
311
+ // Map error and emit failure event
312
+ const duration = Date.now() - startTime;
313
+ const rillError = mapVectorError('chroma', error);
314
+ emitExtensionEvent(ctx, {
315
+ event: 'chroma:error',
316
+ subsystem: 'extension:chroma',
317
+ error: rillError.message,
318
+ duration,
319
+ });
320
+ throw rillError;
321
+ }
322
+ },
323
+ description: 'Fetch vector by ID',
324
+ returnType: 'dict',
325
+ },
326
+ // IR-5: chroma::delete
327
+ delete: {
328
+ params: [{ name: 'id', type: 'string' }],
329
+ fn: async (args, ctx) => {
330
+ const startTime = Date.now();
331
+ try {
332
+ checkDisposed(disposalState, 'chroma');
333
+ // Extract arguments
334
+ const id = args[0];
335
+ // Get or create collection
336
+ const collection = await client.getOrCreateCollection({
337
+ name: factoryCollection,
338
+ });
339
+ // Call ChromaDB API
340
+ await collection.delete({
341
+ ids: [id],
342
+ });
343
+ // Build result
344
+ const result = {
345
+ id,
346
+ deleted: true,
347
+ };
348
+ // Emit success event
349
+ const duration = Date.now() - startTime;
350
+ emitExtensionEvent(ctx, {
351
+ event: 'chroma:delete',
352
+ subsystem: 'extension:chroma',
353
+ duration,
354
+ id,
355
+ });
356
+ return result;
357
+ }
358
+ catch (error) {
359
+ // Map error and emit failure event
360
+ const duration = Date.now() - startTime;
361
+ const rillError = mapVectorError('chroma', error);
362
+ emitExtensionEvent(ctx, {
363
+ event: 'chroma:error',
364
+ subsystem: 'extension:chroma',
365
+ error: rillError.message,
366
+ duration,
367
+ });
368
+ throw rillError;
369
+ }
370
+ },
371
+ description: 'Delete vector by ID',
372
+ returnType: 'dict',
373
+ },
374
+ // IR-6: chroma::delete_batch
375
+ delete_batch: {
376
+ params: [{ name: 'ids', type: 'list' }],
377
+ fn: async (args, ctx) => {
378
+ const startTime = Date.now();
379
+ try {
380
+ checkDisposed(disposalState, 'chroma');
381
+ // Extract arguments
382
+ const ids = args[0];
383
+ let succeeded = 0;
384
+ // Get or create collection
385
+ const collection = await client.getOrCreateCollection({
386
+ name: factoryCollection,
387
+ });
388
+ // Process sequentially; halt on first failure
389
+ for (let i = 0; i < ids.length; i++) {
390
+ const id = ids[i];
391
+ try {
392
+ // Call ChromaDB API
393
+ await collection.delete({
394
+ ids: [id],
395
+ });
396
+ succeeded++;
397
+ }
398
+ catch (error) {
399
+ // Halt on first failure
400
+ const rillError = mapVectorError('chroma', error);
401
+ const result = {
402
+ succeeded,
403
+ failed: id,
404
+ error: rillError.message,
405
+ };
406
+ const duration = Date.now() - startTime;
407
+ emitExtensionEvent(ctx, {
408
+ event: 'chroma:delete_batch',
409
+ subsystem: 'extension:chroma',
410
+ duration,
411
+ count: ids.length,
412
+ succeeded,
413
+ });
414
+ return result;
415
+ }
416
+ }
417
+ // All succeeded
418
+ const result = { succeeded };
419
+ const duration = Date.now() - startTime;
420
+ emitExtensionEvent(ctx, {
421
+ event: 'chroma:delete_batch',
422
+ subsystem: 'extension:chroma',
423
+ duration,
424
+ count: ids.length,
425
+ succeeded,
426
+ });
427
+ return result;
428
+ }
429
+ catch (error) {
430
+ // Map error and emit failure event
431
+ const duration = Date.now() - startTime;
432
+ const rillError = mapVectorError('chroma', error);
433
+ emitExtensionEvent(ctx, {
434
+ event: 'chroma:error',
435
+ subsystem: 'extension:chroma',
436
+ error: rillError.message,
437
+ duration,
438
+ });
439
+ throw rillError;
440
+ }
441
+ },
442
+ description: 'Batch delete vectors',
443
+ returnType: 'dict',
444
+ },
445
+ // IR-7: chroma::count
446
+ count: {
447
+ params: [],
448
+ fn: async (_args, ctx) => {
449
+ const startTime = Date.now();
450
+ try {
451
+ checkDisposed(disposalState, 'chroma');
452
+ // Get or create collection
453
+ const collection = await client.getOrCreateCollection({
454
+ name: factoryCollection,
455
+ });
456
+ // Call ChromaDB API
457
+ const count = await collection.count();
458
+ // Emit success event
459
+ const duration = Date.now() - startTime;
460
+ emitExtensionEvent(ctx, {
461
+ event: 'chroma:count',
462
+ subsystem: 'extension:chroma',
463
+ duration,
464
+ count,
465
+ });
466
+ return count;
467
+ }
468
+ catch (error) {
469
+ // Map error and emit failure event
470
+ const duration = Date.now() - startTime;
471
+ const rillError = mapVectorError('chroma', error);
472
+ emitExtensionEvent(ctx, {
473
+ event: 'chroma:error',
474
+ subsystem: 'extension:chroma',
475
+ error: rillError.message,
476
+ duration,
477
+ });
478
+ throw rillError;
479
+ }
480
+ },
481
+ description: 'Return total vector count in collection',
482
+ returnType: 'number',
483
+ },
484
+ // IR-8: chroma::create_collection
485
+ create_collection: {
486
+ params: [
487
+ { name: 'name', type: 'string' },
488
+ { name: 'options', type: 'dict', defaultValue: {} },
489
+ ],
490
+ fn: async (args, ctx) => {
491
+ const startTime = Date.now();
492
+ try {
493
+ checkDisposed(disposalState, 'chroma');
494
+ // Extract arguments
495
+ const name = args[0];
496
+ const options = (args[1] ?? {});
497
+ // Extract metadata options
498
+ const metadata = (options['metadata'] ?? {});
499
+ // Call ChromaDB API
500
+ await client.createCollection({
501
+ name,
502
+ metadata,
503
+ });
504
+ // Build result
505
+ const result = {
506
+ name,
507
+ created: true,
508
+ };
509
+ // Emit success event
510
+ const duration = Date.now() - startTime;
511
+ emitExtensionEvent(ctx, {
512
+ event: 'chroma:create_collection',
513
+ subsystem: 'extension:chroma',
514
+ duration,
515
+ name,
516
+ });
517
+ return result;
518
+ }
519
+ catch (error) {
520
+ // Map error and emit failure event
521
+ const duration = Date.now() - startTime;
522
+ const rillError = mapVectorError('chroma', error);
523
+ emitExtensionEvent(ctx, {
524
+ event: 'chroma:error',
525
+ subsystem: 'extension:chroma',
526
+ error: rillError.message,
527
+ duration,
528
+ });
529
+ throw rillError;
530
+ }
531
+ },
532
+ description: 'Create new vector collection',
533
+ returnType: 'dict',
534
+ },
535
+ // IR-9: chroma::delete_collection
536
+ delete_collection: {
537
+ params: [{ name: 'name', type: 'string' }],
538
+ fn: async (args, ctx) => {
539
+ const startTime = Date.now();
540
+ try {
541
+ checkDisposed(disposalState, 'chroma');
542
+ // Extract arguments
543
+ const name = args[0];
544
+ // Call ChromaDB API
545
+ await client.deleteCollection({ name });
546
+ // Build result
547
+ const result = {
548
+ name,
549
+ deleted: true,
550
+ };
551
+ // Emit success event
552
+ const duration = Date.now() - startTime;
553
+ emitExtensionEvent(ctx, {
554
+ event: 'chroma:delete_collection',
555
+ subsystem: 'extension:chroma',
556
+ duration,
557
+ name,
558
+ });
559
+ return result;
560
+ }
561
+ catch (error) {
562
+ // Map error and emit failure event
563
+ const duration = Date.now() - startTime;
564
+ const rillError = mapVectorError('chroma', error);
565
+ emitExtensionEvent(ctx, {
566
+ event: 'chroma:error',
567
+ subsystem: 'extension:chroma',
568
+ error: rillError.message,
569
+ duration,
570
+ });
571
+ throw rillError;
572
+ }
573
+ },
574
+ description: 'Delete vector collection',
575
+ returnType: 'dict',
576
+ },
577
+ // IR-10: chroma::list_collections
578
+ list_collections: {
579
+ params: [],
580
+ fn: async (_args, ctx) => {
581
+ const startTime = Date.now();
582
+ try {
583
+ checkDisposed(disposalState, 'chroma');
584
+ // Call ChromaDB API
585
+ const names = await client.listCollections();
586
+ // Emit success event
587
+ const duration = Date.now() - startTime;
588
+ emitExtensionEvent(ctx, {
589
+ event: 'chroma:list_collections',
590
+ subsystem: 'extension:chroma',
591
+ duration,
592
+ count: names.length,
593
+ });
594
+ return names;
595
+ }
596
+ catch (error) {
597
+ // Map error and emit failure event
598
+ const duration = Date.now() - startTime;
599
+ const rillError = mapVectorError('chroma', error);
600
+ emitExtensionEvent(ctx, {
601
+ event: 'chroma:error',
602
+ subsystem: 'extension:chroma',
603
+ error: rillError.message,
604
+ duration,
605
+ });
606
+ throw rillError;
607
+ }
608
+ },
609
+ description: 'List all collection names',
610
+ returnType: 'list',
611
+ },
612
+ // IR-11: chroma::describe
613
+ describe: {
614
+ params: [],
615
+ fn: async (_args, ctx) => {
616
+ const startTime = Date.now();
617
+ try {
618
+ checkDisposed(disposalState, 'chroma');
619
+ // Get or create collection
620
+ const collection = await client.getOrCreateCollection({
621
+ name: factoryCollection,
622
+ });
623
+ // Call ChromaDB API
624
+ const count = await collection.count();
625
+ // Build result (ChromaDB doesn't expose dimensions/distance in collection metadata)
626
+ const result = {
627
+ name: factoryCollection,
628
+ count,
629
+ };
630
+ // Emit success event
631
+ const duration = Date.now() - startTime;
632
+ emitExtensionEvent(ctx, {
633
+ event: 'chroma:describe',
634
+ subsystem: 'extension:chroma',
635
+ duration,
636
+ name: factoryCollection,
637
+ });
638
+ return result;
639
+ }
640
+ catch (error) {
641
+ // Map error and emit failure event
642
+ const duration = Date.now() - startTime;
643
+ const rillError = mapVectorError('chroma', error);
644
+ emitExtensionEvent(ctx, {
645
+ event: 'chroma:error',
646
+ subsystem: 'extension:chroma',
647
+ error: rillError.message,
648
+ duration,
649
+ });
650
+ throw rillError;
651
+ }
652
+ },
653
+ description: 'Describe configured collection',
654
+ returnType: 'dict',
655
+ },
656
+ };
657
+ // Attach dispose lifecycle method using shared utility
658
+ result.dispose = async () => {
659
+ await dispose(disposalState, async () => {
660
+ // Cleanup SDK HTTP connections
661
+ // Note: ChromaDB SDK doesn't expose a close() method, but we include
662
+ // this structure for consistency with extension pattern
663
+ });
664
+ };
665
+ return result;
666
+ }
667
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,GAKb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,OAAO,EACP,cAAc,GAEf,MAAM,+BAA+B,CAAC;AAGvC,+DAA+D;AAC/D,UAAU;AACV,+DAA+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAoB;IACxD,mCAAmC;IACnC,cAAc,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEhD,yCAAyC;IACzC,uDAAuD;IACvD,MAAM,YAAY,GAEd,EAAE,CAAC;IAEP,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,YAAY,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;IACjC,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;IAE9C,2CAA2C;IAC3C,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC;IAE5C,8BAA8B;IAC9B,MAAM,aAAa,GAAkB,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAEnE,+CAA+C;IAC/C,MAAM,MAAM,GAAoB;QAC9B,uBAAuB;QACvB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,EAA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;oBACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;oBACxC,kBAAkB,CAAC,GAAqB,EAAE;wBACxC,KAAK,EAAE,iBAAiB;wBACxB,SAAS,EAAE,kBAAkB;wBAC7B,QAAQ;wBACR,IAAI,EAAE,iBAAiB;qBACxB,CAAC,CAAC;oBAEH,OAAO,MAAmB,CAAC;gBAC7B,CAAC;gBAAC,OAAO,KAAc,EAAE,CAAC;oBACxB,mCAAmC;oBACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;oBACxC,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;oBAElD,kBAAkB,CAAC,GAAqB,EAAE;wBACxC,KAAK,EAAE,cAAc;wBACrB,SAAS,EAAE,kBAAkB;wBAC7B,KAAK,EAAE,SAAS,CAAC,OAAO;wBACxB,QAAQ;qBACT,CAAC,CAAC;oBAEH,MAAM,SAAS,CAAC;gBAClB,CAAC;YACH,CAAC;YACD,WAAW,EAAE,gCAAgC;YAC7C,UAAU,EAAE,MAAM;SACnB;KACF,CAAC;IAEF,uDAAuD;IACvD,MAAM,CAAC,OAAO,GAAG,KAAK,IAAmB,EAAE;QACzC,MAAM,OAAO,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YACtC,+BAA+B;YAC/B,qEAAqE;YACrE,wDAAwD;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ChromaDB extension for rill.
3
+ * Provides vector database operations using ChromaDB.
4
+ */
5
+ export type { ChromaConfig, ChromaExtensionConfig } from './types.js';
6
+ export { createChromaExtension } from './factory.js';
7
+ export declare const CHROMA_EXTENSION_VERSION = "0.0.1";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAKtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAKrD,eAAO,MAAM,wBAAwB,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ChromaDB extension for rill.
3
+ * Provides vector database operations using ChromaDB.
4
+ */
5
+ // ============================================================
6
+ // FACTORY
7
+ // ============================================================
8
+ export { createChromaExtension } from './factory.js';
9
+ // ============================================================
10
+ // VERSION
11
+ // ============================================================
12
+ export const CHROMA_EXTENSION_VERSION = '0.0.1';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,+DAA+D;AAC/D,UAAU;AACV,+DAA+D;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,+DAA+D;AAC/D,UAAU;AACV,+DAA+D;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,OAAO,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Type definitions for ChromaDB extension.
3
+ * Defines configuration for connecting to ChromaDB vector database.
4
+ */
5
+ /**
6
+ * Configuration options for ChromaDB extension.
7
+ *
8
+ * Defines connection parameters for ChromaDB client including
9
+ * optional API URL, collection name, embedding function, and timeout settings.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // Embedded mode (default)
14
+ * const embeddedConfig: ChromaConfig = {
15
+ * collection: 'my_collection',
16
+ * };
17
+ *
18
+ * // HTTP client mode
19
+ * const httpConfig: ChromaConfig = {
20
+ * url: 'http://localhost:8000',
21
+ * collection: 'my_collection',
22
+ * embeddingFunction: 'openai',
23
+ * timeout: 30000,
24
+ * };
25
+ * ```
26
+ */
27
+ export interface ChromaConfig {
28
+ /**
29
+ * API endpoint URL for ChromaDB server.
30
+ *
31
+ * Optional - when undefined, uses embedded mode.
32
+ * HTTP mode: 'http://localhost:8000'
33
+ */
34
+ readonly url?: string | undefined;
35
+ /**
36
+ * Collection name for vector operations.
37
+ *
38
+ * Required - identifies the collection to use for operations.
39
+ */
40
+ readonly collection: string;
41
+ /**
42
+ * Embedding function name.
43
+ *
44
+ * Optional - when undefined, database uses collection default.
45
+ * Examples: 'openai', 'cohere', 'huggingface'
46
+ */
47
+ readonly embeddingFunction?: string | undefined;
48
+ /**
49
+ * Request timeout in milliseconds.
50
+ *
51
+ * Must be a positive integer.
52
+ * Default: SDK default (30000ms)
53
+ */
54
+ readonly timeout?: number | undefined;
55
+ }
56
+ /**
57
+ * Legacy type alias for ChromaConfig.
58
+ *
59
+ * @deprecated Use ChromaConfig instead.
60
+ */
61
+ export type ChromaExtensionConfig = ChromaConfig;
62
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAElC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAMD;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Type definitions for ChromaDB extension.
3
+ * Defines configuration for connecting to ChromaDB vector database.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@rcrsr/rill-ext-chroma",
3
+ "version": "0.0.1",
4
+ "description": "rill extension for ChromaDB vector database integration",
5
+ "license": "MIT",
6
+ "author": "Andre Bremer",
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "keywords": [
11
+ "rill",
12
+ "chroma",
13
+ "chromadb",
14
+ "vector-database",
15
+ "vector-search",
16
+ "extension",
17
+ "ai",
18
+ "scripting"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc --build",
22
+ "test": "vitest run",
23
+ "typecheck": "tsc --noEmit",
24
+ "lint": "eslint --config ../../../eslint.config.js src/",
25
+ "check": "pnpm run build && pnpm run test && pnpm run lint"
26
+ },
27
+ "peerDependencies": {
28
+ "@rcrsr/rill": "workspace:^"
29
+ },
30
+ "devDependencies": {
31
+ "@rcrsr/rill": "workspace:^"
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/rcrsr/rill.git",
39
+ "directory": "packages/ext/chroma"
40
+ },
41
+ "homepage": "https://github.com/rcrsr/rill/tree/main/packages/ext/chroma#readme",
42
+ "bugs": {
43
+ "url": "https://github.com/rcrsr/rill/issues"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "dependencies": {
49
+ "@rcrsr/rill-ext-vector-shared": "workspace:^",
50
+ "chromadb": "^1.9.2"
51
+ }
52
+ }