Skip to content

VectorsDB support for console#2923

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

VectorsDB support for console#2923
premtsd-code wants to merge 32 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

Git integration provides automatic deployments with optional PR comments

@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 adds full VectorsDB support to the console: SDK integration for collections/documents/indexes, a dimension field in the collection creation modal, HNSW index types, an embedding generation modal, and VectorsDB assets/empty states. The polymorph useDatabaseSdk abstraction is consistently extended, and the previous hardcoded embedding endpoint has been replaced with a proper SDK call.

  • P1 — createIndex.svelte: Switching from an HNSW type to Key/Unique leaves fieldList[0].order = null. This keeps addFieldDisabled = true, and create() immediately throws "Selected attribute key or type invalid", blocking index creation until the user manually touches the order dropdown.
  • P2 — collection/+page.svelte: Import JSON and Export JSON button groups are rendered twice inside the {#if !$isSmallViewport} block (the first pair at lines 169–195 lacks the $isCollectionsJsonImportInProgress disabled guard).

Confidence Score: 4/5

Safe to merge after fixing the HNSW→Key index type transition bug; remaining findings are P2.

One confirmed P1 functional bug (stale fieldList after HNSW type switch blocks index creation) should be addressed before merge. The duplicate button issue is a UI defect worth fixing but not blocking.

createIndex.svelte (P1 type-switch bug), collection/+page.svelte (duplicate Import/Export buttons)

Important Files Changed

Filename Overview
src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/sdk.ts Full VectorsDB switch-case coverage added to all CRUD + index operations; abstraction is consistent.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/helpers/terminology.ts Added vectorsdb terminology entry and DEFAULT_VECTOR_DIMENSION constant; no issues found.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/create.svelte Dimension field added for VectorsDB collections with max=4096; clean implementation.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/(components)/editor/embeddingModal.svelte Now uses SDK vectorsDB.createTextEmbeddings instead of a hardcoded fetch URL; correct implementation.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/createIndex.svelte HNSW/Object index type support added; P1 bug: switching away from HNSW leaves fieldList with order=null, blocking index creation.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.svelte VectorsDB document view wired up; P2 issue: Import JSON and Export JSON buttons rendered twice within the desktop guard.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+layout.svelte VectorsDB realtime events and sample document generation added; zero-vector embeddings are a P2 concern for HNSW indexes.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/+page.ts Switched to getCollectionService for VectorsDB-aware document listing; correct.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/indexes/+page.svelte Index CRUD now routes through databaseSdk; no issues found.
src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte Settings page now uses databaseSdk abstraction for VectorsDB; clean update.
src/routes/(console)/project-[region]-[project]/databases/empty.svelte VectorsDB database type card added to the "create first database" landing; straightforward UI addition.

Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/fea..." | Re-trigger Greptile

…ordb

# Conflicts:
#	bun.lock
#	package.json
#	src/routes/(console)/project-[region]-[project]/databases/database-[database]/(entity)/views/field/activity.svelte
#	src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/activity/+page.ts
…ordb

# Conflicts:
#	src/routes/(console)/project-[region]-[project]/databases/database-[database]/collection-[collection]/usage/[[period]]/+page.ts
Comment on lines +136 to +140
$effect(() => {
if (isHnswType) {
fieldList = [{ value: 'embeddings', order: null, length: null }];
}
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Stale order: null after switching away from HNSW type

When the user selects an HNSW type, fieldList is set to [{ value: 'embeddings', order: null, length: null }]. If the user then switches to Key or Unique, this $effect doesn't run (since isHnswType is now false), so fieldList retains order: null. That makes addFieldDisabled = true (via !isObjectType && !fieldList.at(-1)?.order), which causes create() to throw "Selected attribute key or type invalid" — blocking index creation until the user manually picks an order.

Suggested change
$effect(() => {
if (isHnswType) {
fieldList = [{ value: 'embeddings', order: null, length: null }];
}
});
$effect(() => {
if (isHnswType) {
fieldList = [{ value: 'embeddings', order: null, length: null }];
} else if (!isObjectType) {
// Reset stale HNSW state so order is never null for Key/Unique types
if (fieldList.some((f) => f.order === null)) {
fieldList = [{ value: '', order: OrderBy.Asc, length: null }];
}
}
});

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