Skip to Content

How to build a contextual AI agent in Jitterbit Harmony

Introduction

This guide shows how to add memory and context to a reactive AI agent in Jitterbit Harmony using Integration Studio. This agent stores conversation history and maintains context across multiple interactions.

Important

These steps are a continuation from the how-to guide on building a reactive agent.

Tip

For learning purposes, reference the Contextual Agent provided through Jitterbit Marketplace for an implementation of this guide.

ai agent basic context

Build a contextual AI agent

  1. Open the Integration Studio project that contains your reactive AI agent.

  2. Add a datastore, such as Jitterbit Cloud Datastore or equivalent. Create two key storages:

    • Bot_Authorized_Users: To manage authorized sessions.
    • Agent_Q_and_A: To store conversation history for context.
  3. Update the main AI logic:

    1. Open the workflow Main - AI Agent Tools Logic.

    2. Click a new operation drop zone and select New Script. Configure the script to fetch conversation history for the user from the datastore. Include previous questions/answers in the LLM prompt to maintain context. See the script named Main-AI Logic in the Contextual Agent for an example.

  4. Add utility workflows. 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. Create two workflows:

      • Utility - Read from Datastore: Fetches conversation history.
      • Utility - Write to Datastore: Saves new messages and responses.

      See the workflow named Utility - Bot Chat Cloud Datastore in the Contextual Agent for an example.

  5. Ensure workflows have stateless entry:

    • Slack or API entry workflows only convert user input to internal payload.
    • Main logic handles memory retrieval and updates.

Next steps

To build upon the AI agent with memory and context, see Build an AI agent with RAG.