NAME RT-Extension-AI - Add various AI Features to Request Tracker DESCRIPTION This RT extension introduces various AI-powered features to RT. AI assistance is added via scrips and also interactively through the RT editor. RT VERSION Works with RT 6. INSTALLATION perl Makefile.PL make make install May need root permissions make initdb Only run this the first time you install this module. If you run this twice, you may end up with duplicate data in your database. If you are upgrading this module, check for upgrading instructions in case changes need to be made to your database. Edit your /opt/rt5/etc/RT_SiteConfig.pm Add this line: Plugin('RT::Extension::AI'); See below for additional configuration details. Clear your mason cache rm -rf /opt/rt6/var/mason_data/obj Restart your webserver CONFIGURATION An example configuration file is provided in etc/RT_AI_Config.pm. The configuration defines both the details of the service you want to connect to and details of the specific features, like prompts for different features. Here is a sample configuration with Gemini: Set( %RT_AI_Provider, 'Default' => { name => 'Gemini', api_key => 'YOUR_API_KEY', timeout => 15, url => 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent', prompts => { summarize_ticket => 'You are a helpdesk assistant. Summarize the ticket conversation precisely. Focus on key points, decisions made, and any follow-up actions required.', assess_sentiment => 'Classify the overall sentiment as Satisfied, Dissatisfied, or Neutral. Provide reasoning if possible.', adjust_tone => 'Paraphrase the text for clarity and professionalism. Ensure the tone is polite, concise, and customer-friendly.', suggest_response => 'Provide clear, practical advice or suggestions based on the given question or scenario.', translate_content => 'Translate the provided text, maintaining accuracy and idiomatic expressions.', autocomplete_text => 'Predict the next three words based on the input text without explanations.', }, }, ); Below shows a sample configuration with OpenAI: Set( %RT_AI_Provider, 'Default' => { name => 'OpenAI', api_key => 'YOUR_API_KEY', timeout => 15, url => 'https://api.openai.com/v1/chat/completions', default_model => { name => 'gpt-4', max_tokens => 300, temperature => 0.5, }, autocomplete_model => { name => 'gpt-3.5-turbo', max_tokens => 20, temperature => 0.7, }, prompts => { summarize_ticket => 'You are a helpdesk assistant. Summarize the ticket conversation precisely. Focus on key points, decisions made, and any follow-up actions required.', assess_sentiment => 'Classify the overall sentiment as Satisfied, Dissatisfied, or Neutral. Provide reasoning if possible.', adjust_tone => 'Paraphrase the text for clarity and professionalism. Ensure the tone is polite, concise, and customer-friendly.', suggest_response => 'Provide clear, practical advice or suggestions based on the given question or scenario.', translate_content => 'Translate the provided text, maintaining accuracy and idiomatic expressions.', autocomplete_text => 'Predict the next three words based on the input text without explanations.', }, }, ); Global and Queue-specific Configuration The block of configuration defined for the "Default" key, as shown above, is used as the default global settings for your RT. You can define per-queue configuration by adding sections with queue names as keys. In any context where RT can associate the AI action with a ticket or queue, it will load the matching queue configuration, if available. Some features, like the editor autocomplete, may call the AI service many times. To limit AI features to selected queues only, do not provide a Default configuration and only add configuration for the queues you want. The AI menu in the editor will only appear for configured queues and autocomplete will also run only for configured queues. Using Different AI Providers This extension is designed to work with any AI provider with a REST API. The features currently all use the conversation AI feature. To interface with a system, you need the REST API URL for the conversation endpoint. Authentication can be different for different providers and may require some custom coding. Most require a token as indicated in the configuration. We have tested with the following providers. * OpenAPI, URL: https://api.openai.com/v1/chat/completions * Gemini, URL: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-f lash:generateContent Models Some API providers have different models that are optimized for different tasks. Currently most AI features use the general model. The autocomplete feature, however, requires fast responses, so we provide a way to set a different model for that feature. ChatGPT, for example, has a turbo model that is optimized for speed and makes the autocomplete work much better. Prompts You can define different prompts for different AI features. The keys in the prompts section describe what they are used for. These prompts are sent with every request to the AI for the defined feature. You will likely need to experiment with your selected AI to find wording that correctly processes the prompt along with the content sent in each request. CKEditor Integration Some AI features are integrated into RT's editor and are accessible via buttons in the editor toolbar. To load the editor features, some additional configuration is needed. It is provided in the sample etc/RT_AI_Config.pm file and should be loaded automatically when you enable the extension. If you don't see the AI button, you can copy the configuration into your local site configuration. FEATURES Scrips The following scrips are provided to update information on tickets when configured with whatever conditions you prefer. The sample scrips are configured with "On Correspond" conditions. These are just examples and you can use the actions in any new scrips you want to create. These scrips are applied globally as part of the installation. If you are just testing, you may want to update the scrips and limit them to just one queue. On Correspond Summarize Ticket History On Correspond Assess Reply Sentiment Scrip Actions The actions below are included with the extension and can be used with any conditions to create scrips that make sense for your system. Analyze Ticket Sentiment Content from the ticket is sent to the AI provider and analyzed to assess the sentiment of the end user. Responses are Satisfied, Dissatisfied, or Neutral and the value is saved in the "Ticket Summary" custom field on the ticket. Generate Ticket Summary Content from the ticket is sent to the AI provider and a concise summary is requested. The result is saved in the "Ticket Sentiment" custom field on the ticket. Editor Features The following features are available in RT's editor. Autocomplete As you type, suggestions are provided for the next few words. The behavior of the suggestions can be modified with the prompt. Adjust Tone You can submit a block of text to your AI provider and ask it to change the tone to something different. AI Suggestion Your AI provider can suggest a response to the current question on the ticket. Translate Translate the provided content from the current language to another selected language. DEVELOPER CKEditor Plugin RtExtensionAi A new custom CKEditor plugin RtExtensionAi provides the AI integration with the RT editor. Updating the plugin The plugin uses Vite to build the assets loaded into RT. Information on working with CKEditor plugins can be found on the CKEditor website . We use Vite to build the CKEditor plugin. npm install npm run build AUTHOR Best Practical Solutions, LLC Initial Prototype Parag Shah Neel Patel Abhinandan Vijan Ayush Goel Shivan Mathur BUGS All bugs should be reported via email to: bug-RT-Extension-AI@rt.cpan.org Or via the web at: rt.cpan.org . COPYRIGHT This extension is Copyright (C) 2013-2025 Best Practical Solutions, LLC. This is free software, licensed under: The GNU General Public License, Version 2, June 1991