
AI Chat can help us understand the FetchXML language, create queries, adjust them, and even teach our kids, granddad, and pets about what the FetchXML language really is.
AI Chat – the newest feature
When I saw what my ex-colleague, Andreas Adner, wrote in a post on LinkedIn about AI and XrmToolBox, it piqued my interest in what we can actually do by incorporating AI into our tools. Since that day, we have been working hard to implement the new feature for FetchXML Builder.
I believe I’m reasonably skilled in building tools in code internally, knowing when they should be put in general libraries to be used by other tools. I strive to ensure that the layout of my tools is consistent, both in terms of their usefulness and the consistency of the design itself, as well as the approach to delivering them for future versions. From what I know, Andreas has not built many of these types of tools, but he is consuming a firehose of information on the newest developments, especially regarding AI and LLM. He is developing all the cool features of our communication with AI.
A good combo it is!
If you are curious about Andreas, here are links to the website Nullpointer, GitHub and LinkedIn.
Getting to know AI Chat
How to chat
You can write in English, Swedish, French, or any other language you prefer!
There are some buttons on the right side:

- Send your text by clicking the robot button, or enter <CTRL>+Enter
- The thumbs up button is a shortcut to say “Yes, please!”. Can also be done by entering <CTRL>+Y
- The execute button in the AI Chat window will send “Please execute the FetchXML query!” to the AI
- Reset the chat – this will make the AI forget everything we have said in this session and start from a clean slate.
- The dots open the menu with more options
- The copy button will copy all the dialogue in this session, including hidden messages
- The save button will save the dialog to a text file
- The settings button is a shortcut to the settings of the AI Chat
- You may want to support this feature and the tool – click to get started
- Documentation gets you to this page (interception time??)
Settings for AI Chat

In the settings of FetchXML Builder, you need to select which AI supplier we are working with and which models are available.
The API Key is needed for any call to the AI. See below how we can get the key.
Suppliers supporting AI
Currently, FetchXML Builder supports two different services: OpenAI and Anthropic.
Note that the settings supported are stored in an online settings file, which means that more suppliers can be added without requiring an update to the tool.
As we know, nothing is for free, but this is definitely not expensive. During all my implementations, I have invested $ 10 in OpenAI and € 5 in Anthopics, and I still haven’t spent those bucks. See pricing for OpenAI and Anthropic. Compare models available in FetchXML Builder and the pricing pages.
Setting up OpenAI
Visit https://openai.com/ and follow the video below.
Setting up Anthropic
Visit https://anthropic.com/, set up an account, and find and generate an API Key.
Stay tuned for more details!
Techy details
The Tool

The tool FetchXML Builder has a bunch of dockable containers. As shown in the screenshot above, the AI Chat is docked on the right side. You can double-click on the header and move it around to the left/right and even to be floating.
The AI Chat

This is the DockControl
for the AI Chat window. This container is the same type of controls, such as the FetchXML window, the Result, the Converters, etc.
The History

In this part of the AI Chat, we can see everything from our dialogue. Yellow panel on the left is the response from the AI, and the blue panel on the right is what you wrote.
The History is implemented in a general way, and it is available for any tool including the shared projects in repository Rappen.XTB.Helper at https://github.com/rappen/Rappen.XTB.Helper.
This repository has a new shared project: Rappen.AI.WinForm. See the Using section below on what/why/how!
The Writing

This panel with where we write to the AI, all the buttons, and some statistics at the button is implemented only in FetchXML Builder. The reason is that there are some specific features that are only relevant for FXB, e.g. the execute button.
When sending it to the AI, the function in the AiCommunication.CallingAI
is used, where the general is implemented, which may be used in other tools.
Using general code helpers
If you are interrested, take a look at this blog post: https://jonasr.app/ai-code-helpers.