Skip to content

VectorsDB support for console#2923

Open
premtsd-code wants to merge 30 commits intofeat-documentsdbfrom
feat-vectordb
Open

VectorsDB support for console#2923
premtsd-code wants to merge 30 commits intofeat-documentsdbfrom
feat-vectordb

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

Summary

  • Full VectorsDB SDK integration (collections, documents, indexes, CRUD operations)
  • VectorsDB-specific UI: embedding editor with auto-fold, dimension field, HNSW index types
  • Route all collection pages through database-type-aware SDK helpers
  • Fix naming consistency (vectordb → vectorsdb)
  • Update SDK to 5fe49af with VectorsDB support
  • Add VectorsDB assets (SVGs, empty states)

Test plan

  • Create a vectorsdb database and collection
  • CRUD documents with embeddings
  • Create/delete HNSW indexes
  • Verify activity, usage, settings pages work for vectorsdb collections
  • Verify documentsdb/tablesdb collections still work unchanged

ItzNotABug and others added 7 commits February 11, 2026 17:27
- 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
@appwrite
Copy link
Copy Markdown

appwrite bot commented Mar 20, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Schedule functions to run as often as every minute with cron expressions

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 42b459b2-e413-425b-b30d-307241946751

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-vectordb

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 20, 2026

Greptile Summary

This PR delivers full VectorsDB support in the console, completing the polymorph database abstraction that previously had throw new Error('Database type not supported yet') stubs for all vectorsdb cases. All major surfaces — document CRUD, index management (including HNSW types), collection settings, activity logs, and usage stats — now route through database-type-aware SDK helpers rather than hardcoded documentsDB calls.

Key changes:

  • sdk.ts: All vectorsdb stubs replaced with real baseSdk.vectorsDB.* calls. New updateEntity and deleteIndex methods added to the DatabaseSdkResult type and implemented for all three database types.
  • getCollectionService() helper added for use in SvelteKit load functions (.ts files) where Svelte runes aren't available.
  • createIndex.svelte: HNSW index types (Euclidean, Dot, Cosine) and Object type added for vectorsdb; HNSW auto-fills the embeddings field and suppresses order/length inputs appropriately.
  • view.svelte: Embeddings arrays are rendered in multi-line format to enable native CodeMirror fold, with a custom ViewPlugin updating the fold placeholder with a truncated preview.
  • embeddingModal.svelte: New modal for generating embeddings from text via vectorsDB.createTextEmbeddings SDK method.
  • All collection-scoped load functions (documents, activity, usage) switched from hardcoded documentsDB to the new getCollectionService helper.
  • VectorsDB empty-state SVGs and database-selector card added.

Confidence Score: 5/5

Safe to merge — all remaining findings are P2 style suggestions that do not affect runtime correctness.

Prior P0/P1 concerns (hardcoded endpoint, missing dimension cap, incorrect DocumentsDBIndexType cast) are all resolved. The SDK abstraction layer is consistently and correctly implemented across all vectorsdb operations. The only remaining finding is a P2 style violation in the new embeddingModal.svelte (mixed Svelte 4/5 syntax), which does not affect functionality.

embeddingModal.svelte — mixed Svelte 4/5 syntax in a new file.

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/sdk.ts Core SDK abstraction layer updated with full VectorsDB CRUD support: createCollection, getCollection, listCollections, deleteCollection, updateEntity, createRecord, updateRecord, deleteRecord, deleteRecords, createIndex, deleteIndex. Logic looks correct and mirrors the documentsDB pattern throughout.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/embeddingModal.svelte New modal for generating text embeddings via SDK; correctly uses vectorsDB.createTextEmbeddings. Mixed Svelte 4 (on:click, svelte:fragment slot) and Svelte 5 runes syntax in a new file, violating project conventions.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/view.svelte Adds embeddings auto-fold on load/reset, a custom ViewPlugin for truncated fold placeholder, Mod-g keybinding to trigger embedding generation, and a replaceData export. DOM manipulation in the ViewPlugin is intentional and scoped.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte VectorsDB index types (HNSW Euclidean/Dot/Cosine, Object) added alongside DocumentsDB types; HNSW auto-fills "embeddings" field and hides order/length inputs. Logic is clean and the prior DocumentsDBIndexType cast has been removed.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/spreadsheet.svelte VectorsDB-aware document listing/loading; adds embedding modal integration, metadata key inference for suggested attributes, and fake-data generation that wraps fields in metadata with zero-filled embeddings. Uses existing Svelte 4 reactive style consistent with the pre-existing file.

Reviews (2): Last reviewed commit: "merge: resolve conflicts with remote fea..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants