VectorsDB support for console#2923
Conversation
- Route delete/update/index operations through database-type-aware SDK (settings, indexes, activity, usage pages were hardcoding documentsDB) - Add updateEntity, deleteIndex methods to sdk.ts helper - Fix pagination and document loading to use correct SDK for vectorsdb - Fix realtime events to listen for both documentsdb and vectorsdb - Fix embeddings: pass number[] directly instead of JSON.stringify roundtrip - Auto-fold embeddings array in editor on document load
- Add !isVectorsDb guard to useMockSuggestions derivation - Use single sliceString for bracket matching instead of per-char rope traversal
Console (appwrite/console)Project ID: Tip Function scopes give you fine-grained control over API permissions |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR integrates VectorsDB as a first-class database type in the Appwrite Console, alongside the existing TablesDB and DocumentsDB. It adds a new SDK version ( Key changes:
Confidence Score: 2/5
Important Files Changed
|
| generating = true; | ||
| try { | ||
| const client = sdk.forProject(page.params.region, page.params.project).client; | ||
| const uri = new URL(client.config.endpoint + '/vectorsdb/embeddings/text'); |
There was a problem hiding this comment.
Hardcoded internal endpoint path
The embedding endpoint URL is constructed by manually appending a path string to the SDK's configured endpoint. This couples the component to an undocumented internal path (/vectorsdb/embeddings/text) and bypasses any SDK-level versioning or base-path changes. If the endpoint changes or if SDK methods are added for this operation, this string will silently break.
If the new SDK exposes a typed method for embedding generation, consider using it instead. At minimum, extract the path to a named constant so it is easier to update.
| <InputNumber | ||
| id="dimension" | ||
| label="Vector dimension" | ||
| bind:value={dimension} | ||
| min={1} | ||
| required /> | ||
| {/if} |
There was a problem hiding this comment.
No upper bound on vector dimension input
The InputNumber for VectorsDB dimension only enforces min={1} with no max constraint. Users can submit arbitrarily large values (e.g., 999999), which will be forwarded to the backend. It is worth adding a reasonable max value (e.g., 65535 or the actual backend limit) to prevent obvious mistakes and provide a better UX.
| key: index.key, | ||
| type: index.type as DocumentsDBIndexType, |
There was a problem hiding this comment.
Misleading
DocumentsDBIndexType cast for VectorsDB
index.type is cast to DocumentsDBIndexType even though this page now handles VectorsDB collections that use different index types (e.g., HNSW). The cast is harmless at runtime because databaseSdk.createIndex accepts type: string and routes to the correct SDK internally, but it is incorrect and may confuse future maintainers.
Since DatabaseSdkResult.createIndex already accepts type: string, the cast can simply be dropped.
…preview, metadata defaults

Summary
Test plan