Share at:

As organizations race to operationalize generative AI (genAI), a key challenge has emerged connecting powerful AI models to trusted enterprise data. Many teams already use specialized vector databases for semantic search and retrieval, but these systems often exist outside their automation or AI platforms, creating silos that block real-time access to contextual knowledge.
The Bring Your Own Vector Database (BYOVD) pattern solves this by allowing UiPath agents to securely query your existing vector stores like Databricks or Azure AI Search, grounding GenAI outputs in your organization’s most relevant information without duplicating data or disrupting existing architecture.
This pattern lets you connect externally managed vector databases, such as Databricks Vector Search or Azure AI Search, to bring specialized, real-time context from your proprietary data directly into agents and GenAI inference within the UiPath Platform.
Instead of a direct, native integration into the Context Grounding service, this pattern is enabled by using UiPath Integration Service and API Workflows. The core method is to build a custom API Workflow that acts as a bridge. There are some great UiPath Integration Service Connectors and activities to vector databases like Pinecone to help you get started. This workflow:
Directly queries your vector database's API endpoint.
Is published to your Orchestrator tenant.
Is added as a Tool to your agent.
The agent's underlying LLM can then be prompted to use this tool to fetch context, just as it would use any other tool or skill.
Please note: API workflows generally require static IPs for runtimes so enterprises can properly configure/adjust firewalls, please find additional information here.
The agent uses the custom workflow as a tool to perform Retrieval-Augmented Generation (RAG).
User prompt: A user asks a question to an agent.
Tool selection: The agent's LLM determines that it needs external knowledge and selects your custom "vector search" tool.
API Workflow execution: The agent invokes the API Workflow, passing the user's query as an input.
Query execution: This is the key step, which differs by provider:
Databricks (Model-Native Endpoint): The API Workflow can often send the raw text query directly to the Databricks Vector Search endpoint. Databricks' endpoint handles vectorizing the query internally before performing the similarity search.
Azure AI Search (Client-Side Vectorization): Azure AI Search typically expects the client (your API workflow) to provide the query vector. In this case, the workflow must first make a call to an embedding model (like Azure OpenAI) to convert the text query into a vector, and then send that vector to the Azure AI Search endpoint.
Azure AI Search (Integrated Vectorization): While client-side vectorization is an option, Azure AI Search now offers integrated vectorization. Through Azure AI Foundry, it can directly handle content ingestion, chunking, and the creation of embeddings from various models, which streamlines the process of indexing data for vector search.
Return context: The database endpoint returns a structured JSON response with the most relevant text chunks and their scores.
Formulate answer: The API Workflow passes this structured context back to the agent. The LLM then uses this context to generate a final, accurate answer for the user.
Before building the workflow, it is critical to securely store your API keys and other secrets. Instead of hardcoding them into your workflow, you should use the Orchestrator Credentials store.
Store Credentials in Orchestrator: Add your API keys and other secrets as Credential assets in your Orchestrator tenant. This allows for centralized and secure management of sensitive data.
Use the Get Credential Activity: In your API Workflow, use the Get Credential activity to retrieve the stored credentials at runtime. This activity returns the username as a string and the password (your API key) as a SecureString, ensuring that your secrets are not exposed in logs or the workflow definition.
This guide provides the precise steps to configure this pattern. Note the guide below focuses on Databricks and Azure, but can be extensible to other vector dbs.
An active vector database (e.g. Databricks Vector Search or Azure AI Search) with your data already indexed.
A secure API endpoint and authentication details (e.g., API Key, Bearer Token) for your vector database, stored as a Credential asset in Orchestrator.
(For Azure AI Search with client-side vectorization only) An API endpoint and key for an embedding model (e.g., Azure OpenAI) to vectorize the queries, also stored as a Credential asset.
This method is simpler as Databricks can handle query vectorization at its endpoint.
Get databricks details: From your Databricks Vector Search endpoint, copy the Endpoint URL. Store your Personal Access Token (PAT) as a Credential asset in Orchestrator.
Create API workflow: In UiPath Studio, create a new API Workflow project.
Define arguments: Define input arguments inQueryText (String) and inTopK (Int32, with a default value like 5), and an output argument out_Results (String).
Get credentials: Add a Get Credential activity to retrieve your Databricks PAT from Orchestrator.
Build HTTP Request: Add an HTTP Request activity.
Endpoint: Set the URI to your Databricks endpoint.
Method: POST.
Headers: Add an Authorization header with the value "Bearer" + YourPATSecureString_Variable.
Body: Construct the JSON body required by the Databricks API, mapping your input variables.
Publish as tool: Publish the workflow to your Orchestrator tenant.
Add to agent: In your agent’s configuration, add the published workflow as a Tool, giving it a clear, descriptive name (e.g., SearchCompanyKnowledgeBase).
This method requires two API calls: one to create the embedding, and one to query the search.
Get API Details:
Azure AI search: Note your Endpoint URL, Index Name, and store your API Key as a Credential asset in Orchestrator.
Embedding model: Note the Endpoint URL and store the API Key for your embedding service as a Credential asset in Orchestrator.
Create API workflow: Create a new API Workflow with inputs inQueryText (String), inTopK (Int32), and output out_Results (String).
Step 1: Vectorize query:
Add a Get Credential activity to retrieve your embedding model's API key.
Add an HTTP Request activity to call your embedding model with the in_QueryText.
Deserialize the JSON response and store the resulting embedding vector in a variable (e.g., queryVector).
Step 2: Query Azure AI search:
Add another Get Credential activity to retrieve your Azure AI Search API key.
Add a second HTTP Request activity.
Endpoint: Your Azure AI Search endpoint.
Method: POST.
Headers: Add an api-key header with your AIS API key variable.
Body: Construct the JSON body for the AIS vector search query, embedding your queryVector variable.
Publish as Tool: Publish the workflow to your Orchestrator tenant.
Add to Agent: Add the published workflow as a tool to your agent, providing a clear description for the LLM
This method simplifies the process by leveraging Azure's built-in vectorization capabilities at query time. It only requires a single API call from the workflow.
Get API Details: From your Azure AI Search service, note your Endpoint URL, Index Name, and store your API Key as a Credential asset in Orchestrator.
Create API Workflow: Create a new API Workflow with inputs inQueryText (String), inTopK (Int32), and output out_Results (String).
Get Credentials: Add a Get Credential activity to retrieve your Azure AI Search API key from Orchestrator.
Build HTTP Request: Add an HTTP Request activity.
Endpoint: Your Azure AI Search endpoint (e.g., https://<service>.search.windows.net/indexes/<index-name>/docs/search?api-version=2023-11-01).
Method: POST.
Headers: Add an api-key header with your AIS API key variable.
Body: Construct the JSON body to perform a vector search using a text query. The text field provides the query to be vectorized by the model defined in your search index's vectorizer configuration.
{
"vectorQueries": [
{
"kind": "text",
"text": "<%= in_QueryText %>",
"fields": "contentVector",
"k": "<%= in_TopK %>"
}
],
"select": "chunk, source_document"
}
5. Publish as tool: Publish the workflow to your Orchestrator tenant.
6. Add to agent: Add the published workflow as a Tool to your agent, providing a clear description for the LLM.
We encourage you to use this guide to give it a try on the UiPath Platform - and let us know what you think.
Find documentation on Agents and Context Grounding here.
You can try out these great new features at playground.uipath.com or sign up for a trial here: https://www.uipath.com/pricing.
Stay tuned for the latest updates from labs.uipath.com, and on the community blog.

Director, Product Management, UiPath
Sign up today and we'll email you the newest articles every week.
Thank you for subscribing! Each week, we'll send the best automation blog posts straight to your inbox.