Skip to content

Adapt to use VECTOR_EMBEDDING Function (Vector) and other new AI Core features within the HANA Database #2810

Open

Description

@jung-thomas

https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/vector-embedding-function-vector

There are now Database features to do AI Core calls such as creating ebeddings directly within the database. This can be done more efficiently that at the Node.js layer with the Cloud SDK. We should look at where we can utilize this new functionality.

Also this help link for setting up the connection to AI Core https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-vector-engine-guide/creating-text-embeddings-with-sap-ai-core

Activity

  1. added 7 commits that reference this issue on Oct 19, 2026
  2. jung-thomas commented on Oct 19, 2026

    @jung-thomas
    ContributorAuthor

    Status: basic setup DONE — HANA↔AI Core connection live and verified on DEV + PROD

    The first phase (connect the existing AI Core instance to HANA and prove VECTOR_EMBEDDING from the DB layer, before any rewrite) is complete.

    Proven end-to-end (as the app's own container _RT identity)

    DEV PROD
    Built-in NLP (SAP_GXY.20250407) 768-dim ✓ —
    AI Core via TUTORIALS_AICORE remote source 1536-dim ✓ 1536-dim ✓
    GET_REMOTE_SOURCE_AI_MODELS 55 models ✓ 55 models ✓

    Final architecture

    • One-time instance-level admin (per env): CREATE PSE TUTORIALS_AICORE_PSE + CREATE REMOTE SOURCE TUTORIALS_AICORE ADAPTER "sapgenaihub" using the dedicated hana-ai-core x509 service key (deployment da6d9c5e3fb50c3d). PSE + remote source are shared DB objects, not container artifacts.
    • Container grant: GRANT EXECUTE ON REMOTE SOURCE TUTORIALS_AICORE TO "<schema>::external_privileges_role" — the broker's external-object role; rebind-proof, inherited by all binding users. Not an _RT-user grant, not default_access_role, no grantor service.

    Shipped

    Runbook docs/developers/operations/hana-aicore-embeddings.md (both-env SQL, tiers, PROD marked done, auto-embedding + wider-AI-surface appendices) + design doc + CLAUDE.md link. PRs: #2844, #2846, #2847, #2848, #2849 (all merged to DEV). The runbook records the failed approaches (.hdbgrants, CREATE PSE as a privilege name, default_access_role + TRUST ADMIN) so they aren't re-tried.

    Follow-up (next phase — the actual efficiency payoff)

    Move embeddings currently generated at the Node/CAP layer into the DB using HANA's auto-embedding mechanisms (CREATE_VECTOR_EMBEDDINGS procedure, scheduler job, or BEFORE INSERT/UPDATE trigger — NCLOB-aware; GENERATED ALWAYS AS is NVARCHAR-only and doesn't fit the gzip/NCLOB content model). Candidate first target + wider AI surface (AI_TEXT_COMPLETION, CROSS_ENCODE, AI_TABULAR_PREDICTION) noted in the runbook appendices.

    Ops note

    Both hana-ai-core service keys (DEV + PROD) should be rotated — their x509 private keys were handled during setup.

  3. added a commit that references this issue on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions