Skip to Content

How to build an AI agent with Retrieval-Augmented Generation (RAG) in Jitterbit Harmony

Introduction

This guide shows how to add a tool to address specific questions to a contextual AI agent in Jitterbit Harmony using Integration Studio. This agent uses the Retrieval-Augmented Generation (RAG) technique, which combines LLM reasoning with access to external tools and data sources.

Important

These steps are a continuation from the how-to guides on building a reactive agent and building a contextual agent.

Tip

For learning purposes, reference the Salesforce Q&A Agent provided through Jitterbit Marketplace for an implementation of this guide.

ai agent basic rag

Build an AI agent with RAG

  1. Open the Integration Studio project that contains your contextual agent.

  2. Identify tools for integration. For example:

    • Tool - Get Salesforce Orders
    • Tool - Query Jira Tickets
  3. Add tool workflows based on the identified tools for integration. For each:

    1. Click Add New Workflow along the top of the design canvas to create a new workflow.

    2. Double-click the default workflow name and rename it for the specific tool.

    3. Design the tool workflow so that it accepts the input parameters, queries the data source, and returns structured output. Each tool must be independent and stateless. See Salesforce Q&A Agent for an example.

  4. Update the main AI logic for RAG and tool calls:

    1. Open the workflow Main - AI Agent Tools Logic.
    2. Modify the workflow such that it receives the user's query from Main Entry - API Request Handler.
    3. Add a function calling tool to the LLM request to determine which tool to call.
    4. Upon receiving a functional calling response from the LLM, invoke the appropriate tool to retrieve the relevant data.
    5. Feed the tool output and conversation history into an LLM prompt to get structured output.
    6. Generate the response and optionally summarize the context.

    See Salesforce Q&A Agent for an example.

  5. (Optional) Integrate indexing and search.

    Tip

    For queries involving extensive unstructured documents, consider using Azure Blob Storage and Azure AI Search or a similar search/indexing service. More information can be found in the Jitterbit Knowledge Agent, which leverages Azure Blob Storage and Azure AI Search.

Next steps

To embed the API agent in an App Builder app, see Build an intelligent application.