SAP HANA Vector Store icon

SAP HANA Vector Store

Work with your data in SAP HANA Vector Store using LangChain

SAP HANA Vector Store

AI-generated

Overview

This node integrates with SAP HANA as a vector store using LangChain, enabling operations such as inserting documents, retrieving ranked documents, and using the vector store as a tool for AI workflows. It supports embedding documents into SAP HANA tables, querying for similar documents based on vector similarity, and configuring various options like table and column names, distance calculation strategies, and metadata filtering. Common use cases include managing and querying vector embeddings for AI applications, such as knowledge bases or AI agents that require fast similarity searches within SAP HANA.

Use Case Examples

  1. Insert a batch of documents into a SAP HANA vector store table for later similarity search.
  2. Retrieve the top N most similar documents to a given query vector from SAP HANA for use in an AI chain or tool.
  3. Use the vector store as a tool in an AI agent by retrieving documents with metadata and reranking options enabled.

Properties

Name Meaning
Operation Mode Determines the action to perform: load (get many ranked documents), insert (add documents), retrieve (get documents as vector store), or retrieve-as-tool (get documents as tool for AI agent).
Name Name of the vector store (used when mode is retrieve-as-tool).
Description Description of what the tool does, helping LLMs produce expected results (used when mode is retrieve-as-tool).
Table Name The SAP HANA table name to store or query vectors. The table will be created if it does not exist.
Embedding Batch Size Number of documents to embed in a single batch (used when inserting).
Options Additional configuration options such as column names, schema name, and whether to clear the table before inserting.
Prompt Search prompt to retrieve matching documents from the vector store using similarity-based ranking (used when loading).
Limit Number of top results to fetch from the vector store (used when loading or retrieving as tool).
Include Metadata Whether to include document metadata in the results (used when loading or retrieving as tool).
Rerank Results Whether to rerank the results after initial retrieval (used when loading, retrieving, or retrieving as tool).
ID ID of an embedding entry (used when updating).
Distance Strategy Method to calculate distance between vectors, either cosine similarity or Euclidean distance.
Column Names Names of the columns in the SAP HANA table for content, metadata, and vector embeddings.
Schema Name Optional database schema name to use in SAP HANA.
Metadata Filter Metadata fields to filter documents by during retrieval.
Clear Table Whether to clear the SAP HANA table before inserting new data.

Output

JSON

  • documents - Array of retrieved documents with content and optionally metadata.
  • scores - Similarity scores for each retrieved document.

Dependencies

  • SAP HANA database with hdb client package
  • An API key credential for SAP HANA access

Troubleshooting

  • Ensure the 'hdb' package is installed for SAP HANA integration; error 'hdb package is required' indicates it is missing.
  • Verify SAP HANA credentials and connection parameters; connection failures will throw errors with messages like 'SAP HANA connection failed'.
  • If the table does not exist, it will be created automatically, but permission issues may cause failures.
  • Clearing the table before insert may fail if the table does not exist or due to permission issues; warnings are logged but do not stop execution.

Links

Discussion