Reading time: 10 minutes

AI-Powered HVAC Ticketing System: How to Use RAG

Vitaliy Zarubin
Written by Vitaliy Zarubin11 mar 2025

The AI-powered HVAC ticketing system (support center) is an advanced, integrated platform that combines multiple cutting-edge technologies, including Retrieval-Augmented Generation (RAG) with a vector database, an AI-powered assistant based on Claude, a structured business logic built on PHP Laravel for the backend, and React/Next.js for the frontend. This essay delves into the intricate technical details of each component and describes the system’s logic, architecture, and operational flow.


RAG

1. Retrieval-Augmented Generation (RAG) and Vector Database

How It Works

RAG is a hybrid approach that enhances traditional language models by integrating external knowledge retrieval. The system relies on a vector database to store and retrieve information efficiently. When an HVAC technician interacts with the AI assistant, the system first searches the vector database to extract relevant data, then generates a response by combining retrieved facts with the AI model's generative capabilities.

Why We Need It

Standard AI language models have limitations in recalling up-to-date or domain-specific knowledge. By leveraging a RAG approach, the AI assistant can provide:

  • Context-aware responses: Ensuring technicians receive accurate information based on real-world HVAC repair cases.
  • Reduced hallucinations: Unlike pure generative AI, this approach minimizes incorrect outputs by referencing stored knowledge.
  • Dynamic updates: New technical manuals, troubleshooting guides, and historical service data can be updated without requiring AI model retraining.

Storage in the Vector Database

The vector database (e.g., Pinecone, FAISS, or Weaviate) is essential for fast retrieval. It stores:

  • Technical manuals and documentation (e.g., HVAC system configurations, error codes)
  • Historical service tickets (previous repair cases, resolutions)
  • Frequently asked questions (common issues and solutions)
  • Real-time sensor data (if IoT integrations exist)
  • Conversational history (previous technician interactions to improve contextual responses)

The stored data is embedded into high-dimensional vector representations using transformers, enabling fast and relevant similarity searches.

ticketing system

2. AI Assistant in Claude

Prompt Engineering and Optimization

The AI assistant is built on Anthropic’s Claude model, which requires fine-tuned prompts to generate relevant, precise, and structured responses. Effective prompt design involves:

  • Dynamic contextual prompts: Injecting retrieved knowledge from RAG before invoking Claude.
  • Chain-of-thought reasoning: Encouraging multi-step logical thinking within the AI’s response.
  • System directives: Defining strict formatting and logical guidelines for responses.

For example, a well-structured prompt might look like:

Technician Query: "My HVAC unit is showing error E04." Context from Vector Database:

Error E04: Low refrigerant level. Common fixes: Check for leaks, recharge refrigerant, inspect compressor. Service history: Last refrigerant charge was 6 months ago.

Token Management and Efficiency

Claude operates within a token-based processing system. Each user query, retrieved RAG data, and AI-generated response contribute to token consumption. Optimization strategies include:

  • Truncation of irrelevant data: Prioritizing the most relevant context snippets.
  • Summarization techniques: Compressing verbose documentation before passing it to Claude.
  • Multi-turn memory management: Maintaining session history within token limits to ensure continuity in conversations.

Understanding "Thinking" in Claude

Claude’s "thinking" process is based on transformer-based deep learning models that analyze input data, extract relevant features, and generate structured outputs. It applies:

  • Attention mechanisms: Determining which parts of the input are most relevant to the query.
  • Pre-trained and fine-tuned knowledge: Mixing generalized HVAC knowledge with retrieved real-time data.
  • Token prioritization: Allocating more computational weight to recent, relevant user interactions.

3. Business Logic Implementation

Mobile app

Backend (PHP Laravel)

Laravel serves as the core backend framework, handling:

  • User authentication: Technician login, admin access control.
  • Service ticket management: CRUD operations for service tickets.
  • AI request handling: Managing API calls to Claude and RAG.
  • Database operations: Interaction with MySQL/PostgreSQL for structured data and a vector database for unstructured data.

Database Schema Example

CREATE TABLE users (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(255),
    role ENUM('admin', 'technician'),
    gps_location POINT,
    permissions JSON
);

CREATE TABLE tickets (
    id INT PRIMARY KEY AUTO_INCREMENT,
    customer_id INT,
    issue_description TEXT,
    status ENUM('open', 'in_progress', 'closed'),
    technician_id INT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

CREATE TABLE technician_responses (
    id INT PRIMARY KEY AUTO_INCREMENT,
    ticket_id INT,
    AI_response TEXT,
    technician_notes TEXT,
    timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

4. Logical Flow Between Components

  1. Administrator creates a ticket in the system via the Laravel backend.
  2. Technician is assigned based on GPS location and service area.
  3. Technician accesses the ticket via the React frontend.
  4. AI assistant (Claude) is consulted for troubleshooting guidance.
  5. Technician takes action, following AI guidance.
  6. Supervisor is contacted if needed, via direct call integration.
  7. Final resolution is logged, updating the ticket system.

5. HVAC Technician Scenarios and Layered Questions

HVAC troubleshooting follows a multi-layered question hierarchy:

  1. Basic diagnostic questions

    • Is the unit turning on?
    • Are there any visible issues (e.g., leaks, noises, or error messages)?
  2. Error code interpretation

    • What does error E04 mean?
    • Has this error occurred before?
    • What are the manufacturer-recommended troubleshooting steps?
  3. Component-level analysis

    • Is the compressor working?
    • Are refrigerant levels adequate?
    • Are sensors and thermostats calibrated properly?
  4. Environmental factors

    • Is there sufficient airflow?
    • Are there temperature variations in different areas?
    • Is the insulation affecting HVAC performance?
  5. Historical service correlation

    • Has this unit had similar issues in the past?
    • Were previous repairs successful, or did the issue recur?
    • Can predictive maintenance recommendations be made?

Each scenario follows a structured AI-assisted path, where the assistant refines responses based on the depth of questioning and prior knowledge retrieval.


6. Ticketing System and Customer Journey Map

CJM

Customer Journey Map

  1. Ticket Creation: Admin logs an issue in the system.
  2. Technician Assignment: Based on GPS tracking, a nearby technician is assigned.
  3. Ticket Acceptance: The technician reviews details via the app.
  4. AI Consultation: The technician engages with the AI assistant for guidance.
  5. Supervisor Contact: If necessary, the technician escalates via call.
  6. Resolution Logging: The technician documents findings and actions.
  7. Ticket Closure: The system logs the resolution for future reference.

Conclusion

This AI-powered HVAC support system integrates cutting-edge AI, a robust business logic framework, and a dynamic frontend for seamless technician support. By leveraging RAG-enhanced AI, a structured ticketing system, and geolocation-based technician dispatching, the system ensures:

  • Faster issue resolution
  • Enhanced technician efficiency
  • Scalable knowledge management

This approach optimizes on-site HVAC troubleshooting, reducing downtime and improving service efficiency.

Did you find this post interesting? Share it!