· May 18 3m read

Enhancing Preventive Health Engagement: The Backend Powering ChatIRIS with InterSystems IRIS

ChatIRIS Health Coach, a GPT-4 based agent that leverages the Health Belief Model as a psychological framework to craft empathetic replies. This article elaborates on the backend architecture and its components, focusing on how InterSystems IRIS supports the system's functionality.

Backend Architecture

The backend architecture of ChatIRIS Health Coach is built around the following key components:

  1. Scoring Agent
  2. Vector Search in RAG Pipeline

Scoring Agent

The Scoring Agent evaluates user inputs to tailor the health advice based on psychological models, specifically the Health Belief Model. This involves dynamically adjusting belief scores to reflect the user's perceptions and concerns.

  1. Initialization

    • ScoreOperation.on_init : Sets up the scoring agent with an initial prompt and belief map. This provides a framework for understanding and responding to user inputs.
  2. Belief Score Calculation

    • ScoreOperation.ask: Analyzes user inputs to calculate belief scores, which reflect the user’s perceptions of health risks and benefits, as well as barriers to taking preventive action.
  3. Prompt Creation

    • ScoreOperation.create_belief_prompt: Uses the belief scores to generate tailored prompts that address the user's specific concerns and motivations, enhancing the persuasive power of the responses.

Vector Search in RAG Pipeline

The Retrieval-Augmented Generation (RAG) pipeline is a core feature that combines large language models with a robust retrieval system to provide contextually relevant responses. InterSystems IRIS is integral to this process, enhancing data retrieval through its vector store capabilities.

  1. Initialization

    • IrisVectorOperation.init_data: Initializes the vector store with the initial knowledge base. This involves encoding the textual data into vector representations that capture semantic meanings.
  2. Query Processing

    • ChatProcess.ask: When a user query is received, the system invokes the VectorSearchRequest to perform a semantic search within the vector store. This ensures that the retrieved information is highly relevant to the user’s query, going beyond simple keyword matching.

Integration of Components

By combining the RAG pipeline with the Scoring Agent, ChatIRIS can generate responses that are both contextually accurate and psychologically tailored. The backend processes involve:

  1. Query Analysis: User queries are semantically analyzed using the vector search capabilities of InterSystems IRIS.
  2. Context Retrieval: Relevant information is retrieved from the knowledge base using vector search, ensuring high relevance to the query.
  3. Belief Score Adjustment: User inputs are processed to adjust belief scores dynamically.
  4. Response Generation: The system generates responses that are informed by both the retrieved context and the updated belief scores, ensuring they are persuasive and empathetic.


The backend of ChatIRIS Health Coach leverages the powerful data handling and semantic search capabilities of InterSystems IRIS, combined with dynamic belief scoring to provide personalized and persuasive health coaching. This integration enhances the system’s ability to engage users effectively and motivate preventive health behaviors.

See a demo of ChatIRIS in action here.

💭 Find out more

Discussion (0)1
Log in or sign up to continue