Oracle Database Vector Store: Tool icon

Oracle Database Vector Store: Tool

Oracle Database Vector Tool Search

Overview

This node implements a tool that performs similarity search on vector embeddings stored in an Oracle Database. It connects to an Oracle database vector store table, queries it using an embedding vector input, and returns the top matching results based on a specified similarity metric. This is useful for applications like semantic search, knowledge base retrieval, or any scenario where you want to find the most relevant documents or data points given a query embedding.

Practical examples include:

  • Searching a company knowledge base by embedding user questions and retrieving the closest matching documents.
  • Finding similar product descriptions or customer feedback entries stored as vectors.
  • Enhancing AI workflows by integrating vector search capabilities directly within n8n.

Properties

Name Meaning
Name The name of the vector store tool. Used to identify this tool instance (e.g., "company_knowledge_base"). Must be alphanumeric.
Description A detailed explanation of what this tool does. Helps language models understand the tool's purpose to produce better results.
Table Name The name of the Oracle database table containing the vector embeddings to search against.
Limit Number of top results to fetch from the vector store (default is 4).
Include Metadata Whether to include document metadata in the output results (true/false).
Distance Strategy The similarity metric used to compare vectors. Options: COSINE, EUCLIDEAN, DOT.

Output

The node outputs a tool object that can be invoked with a text query. When called, it:

  • Embeds the query text into a vector.
  • Performs a similarity search in the Oracle vector store table.
  • Returns an array of results, each containing either:
    • Full document data including metadata if "Include Metadata" is true.
    • Only the main content of the document otherwise.

Each result is wrapped as a text type with JSON stringified content describing the matched document and its score.

Dependencies

  • Requires the oracledb Node.js module to connect to Oracle Database.
  • Uses a custom OracleDbVectorStore class for vector operations.
  • Needs credentials for connecting to an Oracle Database instance, including host, port, user, password, and service name.
  • The node expects an embedding input connection providing the embedding model to generate query vectors.

Troubleshooting

  • Missing OracleDB module error: If the oracledb package is not installed, the node will throw an error instructing to install it via npm install oracledb.
  • Connection failures: Ensure Oracle DB credentials and network access are correctly configured.
  • Empty results: Check that the table name is correct and contains vector data; also verify the embedding input is properly connected.
  • Invalid distance strategy: Use one of the supported options (COSINE, EUCLIDEAN, DOT) to avoid errors during similarity calculation.

Links and References

Discussion