Back to contents

Chapter 3B

Decisions with Chat Completions & Responses APIs

Static reading edition generated from the Decisions with Chat Completions & Responses APIs notebook.

3b - Workshop (AI Extensions) - Decisions with Chat Completions & Responses APIs

Decision Intelligence applied in this module:

  • Listing of various decision-making frameworks and with their descriptions by using Chat Completion
  • Decision Scenario: Recommendation of a decision-making framework for specific higher-stakes decisions (purchase of a car)
  • Illustrating a domain specific decision-making framework (millitary intelligence)

In this module, the Microsoft Extensions for AI (MEAI) ability to create a chat experience will be introduced. This is a much richer experience than just sending simple prompts that are stateless and context is forgotten.

MEAI has first-class support for chat scenarios, where the user talks back and forth with the LLM, the arguments get populated with the history of the conversation. During each new run of the kernel, the arguments will be provided to the AI with content. This allows the LLM to know the historical context of the conversation.


Step 1 - Initialize Configuration Builder & Build the AI Orchestration

Execute the next two cells to:

  • Use the Configuration Builder to load the API secrets.
  • Use the API configuration to build the ChatCompletions orchestrator.
In [1]:
// Import the required NuGet configuration packages
#r "nuget: Microsoft.Extensions.Configuration, 10.0.8"
#r "nuget: Microsoft.Extensions.Configuration.Json, 10.0.8"
#r "nuget: System.Text.Json, 10.0.8"

using Microsoft.Extensions.Configuration.Json;
using Microsoft.Extensions.Configuration;
using System.IO;
using System;

// Load the configuration settings from the local.settings.json and secrets.settings.json files
// The secrets.settings.json file is used to store sensitive information such as API keys
var configurationBuilder = new ConfigurationBuilder()
    .SetBasePath(Directory.GetCurrentDirectory())
    .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
    .AddJsonFile("secrets.settings.json", optional: true, reloadOnChange: true);
var config = configurationBuilder.Build();

// IMPORTANT: You ONLY NEED either Azure OpenAI or OpenAI connection info, not both.
// Azure OpenAI Connection Info
var azureOpenAIEndpoint = config["AzureOpenAI:Endpoint"];
var azureOpenAIAPIKey = config["AzureOpenAI:APIKey"];
var azureOpenAIModelDeploymentName = config["AzureOpenAI:ModelDeploymentName"];
// OpenAI Connection Info 
var openAIAPIKey = config["OpenAI:APIKey"];
var openAIModelId = config["OpenAI:ModelId"];
Installed Packages
  • Microsoft.Extensions.Configuration, 10.0.8
  • Microsoft.Extensions.Configuration.Json, 10.0.8
  • System.Text.Json, 10.0.8
In [2]:
// Import the Microdoft Extensions AI NuGet Packages
#r "nuget: Microsoft.Extensions.AI, 10.6.0"
#r "nuget: Microsoft.Extensions.AI.Abstractions, 10.6.0"
#r "nuget: Microsoft.Extensions.AI.OpenAI, 10.6.0"
// Import Azure & OpenAI NuGet Packages
#r "nuget: Azure.AI.OpenAI, 2.9.0-beta.1"
#r "nuget: Azure.Identity, 1.21.0"
#r "nuget: OpenAI, 2.10.0"

using Azure;
using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Configuration;
using System.ClientModel;
using System.ComponentModel;
using System.Text.Json;

// Set the flag to use Azure OpenAI or OpenAI. False to use OpenAI, True to use Azure OpenAI
var useAzureOpenAI = true;

// Create the IChatClient based on the selected service
IChatClient chatClient;

// Create a new MEAI ChatClient based on the Azure OpenAI Service or OpenAI Service depending on the flag
if (useAzureOpenAI)
{
    Console.WriteLine("Using Azure OpenAI Service");

    var apiKeyCredential = new ApiKeyCredential(azureOpenAIAPIKey);
    var azureOpenAIClient = new AzureOpenAIClient(new Uri(azureOpenAIEndpoint), apiKeyCredential);

    #pragma warning disable OPENAI001
    chatClient = azureOpenAIClient.GetChatClient(azureOpenAIModelDeploymentName).AsIChatClient();
}
else
{
    Console.WriteLine("Using OpenAI Service");

    var apiKeyCredential = new ApiKeyCredential(azureOpenAIAPIKey);
    var azureOpenAIClient = new AzureOpenAIClient(new Uri(azureOpenAIEndpoint), apiKeyCredential);

    #pragma warning disable OPENAI001
    chatClient = azureOpenAIClient.GetChatClient(azureOpenAIModelDeploymentName).AsIChatClient();
}
Installed Packages
  • Azure.AI.OpenAI, 2.9.0-beta.1
  • Azure.Identity, 1.21.0
  • Microsoft.Extensions.AI, 10.6.0
  • Microsoft.Extensions.AI.Abstractions, 10.6.0
  • Microsoft.Extensions.AI.OpenAI, 10.6.0
  • OpenAI, 2.10.0
Using Azure OpenAI Service
warning CS1701: Assuming assembly reference 'OpenAI, Version=2.9.1.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' used by 'Azure.AI.OpenAI' matches identity 'OpenAI, Version=2.10.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' of 'OpenAI', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'System.ClientModel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' used by 'Azure.AI.OpenAI' matches identity 'System.ClientModel, Version=1.10.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' of 'System.ClientModel', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'Azure.Core, Version=1.51.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' used by 'Azure.AI.OpenAI' matches identity 'Azure.Core, Version=1.53.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' of 'Azure.Core', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'OpenAI, Version=2.9.1.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' used by 'Azure.AI.OpenAI' matches identity 'OpenAI, Version=2.10.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' of 'OpenAI', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'OpenAI, Version=2.9.1.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' used by 'Azure.AI.OpenAI' matches identity 'OpenAI, Version=2.10.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' of 'OpenAI', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'System.ClientModel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' used by 'Azure.AI.OpenAI' matches identity 'System.ClientModel, Version=1.10.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' of 'System.ClientModel', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'Azure.Core, Version=1.51.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' used by 'Azure.AI.OpenAI' matches identity 'Azure.Core, Version=1.53.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' of 'Azure.Core', you may need to supply runtime policy

warning CS1701: Assuming assembly reference 'OpenAI, Version=2.9.1.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' used by 'Azure.AI.OpenAI' matches identity 'OpenAI, Version=2.10.0.0, Culture=neutral, PublicKeyToken=b4187f3e65366280' of 'OpenAI', you may need to supply runtime policy

Step 2 - Execute Decision Chat Completion with Prompt Execution Settings

📜 "If you can’t describe what you are doing as a process, you don’t know what you’re doing."

-- W. Edwards Deming (renowned American engineer, statistician, and management consultant)

Using the Microsoft Extensions AI ChatCompletion service is very similar to inovoking a prompt for basic LLM interactions. The chat completion service will provide very similar results to invoking the prompt directly.

In [3]:
// Simple prompt to list some decision frameworks this GenAI LLM is familiar with 
// LLMs are trained on a diverse range of data and can provide insights on a wide range of topics like decision frameworks
// SLMS (smaller LLMs) are trained on a more specific range of data and may not provide insights on all topics
var simpleDecisionPrompt = """
Provide a list of 5 decision frameworks that can help improve the quality of decisions.

Output Format Instructions:
When generating Markdown, do not use any headings higher than ###. 
Avoid # and ## headers. Use only ###, ####, or lower-level headings if necessary. 
All top-level section headers should start at ### or lower. 
Never use ---, ***, or ___ for horizontal lines. There should be no horizontal lines in the output.
For separation, use extra extra spacing. Do not any render horizontal lines.
""";


// Execute the prompt against the AI model
var simpleDecisionPromptResponse = await chatClient.GetResponseAsync(simpleDecisionPrompt);
var simpleDecisionPromptResponseText = simpleDecisionPromptResponse.Text;

// Display the response string as Markdown
simpleDecisionPromptResponseText.DisplayAs("text/markdown");

5 decision frameworks to improve decision quality

  1. Decision Matrix

    • List your options and the criteria that matter most.
    • Score each option against each criterion, then weight the criteria by importance.
    • Helpful when comparing multiple alternatives systematically.
  2. Pros and Cons Analysis

    • Write down the benefits and drawbacks of each option.
    • Best for quick, simple decisions where you need clarity on tradeoffs.
    • Can be improved by assigning rough weights to the pros and cons.
  3. Cost-Benefit Analysis

    • Estimate the total expected costs and benefits of each option.
    • Useful when decisions have financial, operational, or measurable outcomes.
    • Helps determine whether the likely value outweighs the downside.
  4. Pre-Mortem

    • Imagine the decision has failed and ask: “What went wrong?”
    • Identifies risks, blind spots, and weak assumptions before committing.
    • Especially useful for high-stakes or uncertain decisions.
  5. RICE Prioritization

    • Score options by Reach, Impact, Confidence, and Effort.
    • Often used for prioritizing projects, features, or initiatives.
    • Helps choose what is likely to deliver the most value relative to effort.

Step 3 - Execute Decision Chat Completion with a System Prompt & Chat History

In the previous examples, simple decision prompts were used. In more sophisticated scenarios, a conversational history and state is required to be maintained. The Chat Completions API definition includes mechanisms to maintain state.

Microsoft Extensions for AI includes a ChatHistory object that can be used with the ChatCompletionService to provide historical chat context to the LLM. Notice that the ChatHistory object differentiates between the different types of chat messages:

  • System Message - System or MetaPrompt. These are usually global instructions that set the "overall rules" for interacting with the LLMs.
  • User Message - A message from the user
  • Assistant Message - A message from the LLM. This is a message generated from an assistant or an agent.

Identifying the messages from which role (user) it came from can help the LLM improve its own reasoning and decision responses. This is a more sophisticated approach than passing chat history in a long dynamic string. ChatHistory objects can be serialized and persisted into databases as well. This allows a system architect to load chat history dynamically, branch history conversations, re-run or simulate different conversation paths. For decision scenarios, these tools are super helpful.

In [4]:
// Set the overall system prompt to behave like a decision intelligence assistant (persona)
var systemPrompt = """
You are a Decision Intelligence assistant. 
Assist the user in exploring options, reasoning through decisions, problem-solving, and applying systems thinking to various scenarios. 
Provide structured, logical, and comprehensive advice.

Output Format Instructions:
When generating Markdown, do not use any headings higher than ###. 
Avoid # and ## headers. Use only ###, ####, or lower-level headings if necessary. 
All top-level section headers should start at ### or lower. 
Never use ---, ***, or ___ for horizontal lines. There should be no horizontal lines in the output.
For separation, use extra extra spacing. Do not any render horizontal lines.

Format the response using only a Markdown table. Only return a Markdown table. 
Do not enclose the table in triple backticks.
""";

// Simple instruction prompt to list 5 (five) decision frameworks this GenAI LLM is familiar with
var simpleDecisionPrompt = """
Provide five Decision Frameworks that can help improve the quality of decisions.
""";

// Create a new chat history object with proper system and user message roles
var chatMessages = new List<ChatMessage>();
// Add system and user messages to the chat history
var systemMessage = new ChatMessage(ChatRole.System, systemPrompt);
var userMessage = new ChatMessage(ChatRole.User, simpleDecisionPrompt);
chatMessages.Add(systemMessage);
chatMessages.Add(userMessage);


// Execute the chat messages against the AI model
var chatHistoryResponse = await chatClient.GetResponseAsync(chatMessages);
var chatHistoryResponseText = chatHistoryResponse.Text;

// Display the response string as Markdown
chatHistoryResponseText.DisplayAs("text/markdown");

// Capture the Assistant response and add it to the chat history
// This will persist the full conversation for future interactions
var assistantChatMessage = new ChatMessage(ChatRole.Assistant, chatHistoryResponseText);
Framework Core idea Best used for How it improves decision quality Simple application steps
Cost-Benefit Analysis Compare expected benefits against expected costs for each option. Choices with measurable tradeoffs, especially when resources are limited. Makes tradeoffs explicit and helps avoid decisions based only on intuition or isolated pros and cons. 1) List options 2) Identify costs and benefits 3) Estimate magnitude and timing 4) Compare net value 5) Choose the highest expected return.
Decision Matrix Score multiple options against criteria that matter most. Multi-factor decisions with several competing priorities. Reduces bias by forcing a structured comparison across all relevant criteria. 1) Define criteria 2) Assign weights 3) Score each option 4) Multiply and total scores 5) Review sensitivity of results.
Expected Value Analysis Multiply each outcome by its probability and sum the results. Decisions under uncertainty with identifiable outcomes. Helps quantify uncertainty instead of ignoring it, making risk clearer. 1) List possible outcomes 2) Estimate probability of each 3) Assign payoff or loss values 4) Calculate expected value 5) Compare options.
Pre-Mortem Analysis Imagine the decision failed and work backward to find why. High-stakes or risky decisions where blind spots matter. Surfaces hidden risks, assumptions, and failure modes before commitment. 1) Assume failure 2) Brainstorm causes 3) Identify weak assumptions 4) Add safeguards 5) Revise the decision plan.
OODA Loop Observe, Orient, Decide, Act in a repeated cycle. Dynamic environments that change quickly. Encourages learning, adaptation, and faster correction when conditions shift. 1) Observe current conditions 2) Orient using context and data 3) Decide on action 4) Act 5) Repeat and adjust.

In the next step, an additional prompt instruction will be added to the chat history. From the 5 decision frameworks provided in the chat history, Generative AI is asked to recommed a decision framework best suited for the militaty intelligence community. Notice that the previous chat history is automatically provided to provide additional intelligence context.

📜 "Take time to deliberate, but when the time for action comes, stop thinking and go in."

-- Napoleon Bornaparte (French Emporer and brilliant military mind)

In [5]:
// Add the assistant message to the chat history
chatMessages.Add(assistantChatMessage);

// Note: No reference is made to what previous frameworks were listed.
// Note: Previous context is maintained by the MEAI ChatHistory object 
var simpleDecisionPromptFollowupQuestionPartTwo = """
Which of the 5 decision frameworks listed above is best suited for the military intelligence community?  
Think carefully step by step about what decision frameworks are needed to answer the query.  
Select only the single best framework. 
""";

// Add User message to the chat history
var userFollowupChatMessage = new ChatMessage(ChatRole.User, simpleDecisionPromptFollowupQuestionPartTwo);
chatMessages.Add(userFollowupChatMessage);

// Execute the chat messages against the AI model
var chatHistoryResponseMilitaryIntelligence = await chatClient.GetResponseAsync(chatMessages);
var chatHistoryResponseMilitaryIntelligenceText = chatHistoryResponseMilitaryIntelligence.Text;

// Display the response string as Markdown
chatHistoryResponseMilitaryIntelligenceText.DisplayAs("text/markdown");
Selected framework Why it is the single best fit for the military intelligence community Short rationale
OODA Loop Military intelligence operates in fast-changing, adversarial, information-rich environments where conditions can shift quickly and decisions must be continuously updated. OODA is designed for observe-orient-decide-act cycles under uncertainty and conflict, making it the most operationally relevant of the five. It best matches the need for rapid sensing, interpretation, adaptation, and repeated reassessment in dynamic situations.

Step 4 - Execute Decision Chat Completion with a Multi-Turn Conversation Scenario

The list of Chat Messages persists the state. This allows for natural converations between the user and AI to be persisted for future use. It can be saved for future reference, it can be replayed, it can be forked in certain spots to try different scenarios, it can be used as a starting point for other conversations etc.

In the scenario below, let's build a multi-turn conversation about a decision over a purchase for a fitness tracker. Notice that each turn the appropriate Chat History roles are populated with the appropriate User prompts and assistant (AI) responses. This in effect acts as the Gathering Intelligence step of the Decision Intelligence framework as the conversation information has been persisted and can be re-used as context for the decision scenario.

In [6]:
// Set the overall system prompt to behave like a decision intelligence assistant (persona)
var systemPromptDecisionConversation = """
You are a Decision Intelligence assistant. 
Assist the user in exploring options, reasoning through decisions, problem-solving, and applying systems thinking to various scenarios. 
Provide structured, logical, and comprehensive advice.
""";

// User prompt to start a decision conversation about buying a fitness tracker
var userPromptDecisionConversationTurn1 = """
I am considering buying a fitness tracker but I am not sure which features really matter. 
Could you explain the main considerations? 
""";

var assistantResponseDecisionConversationTurn1 = """
Absolutely! Key considerations for choosing a fitness tracker often include: 
- Fitness Features (e.g., step counting, heart-rate monitoring, workout tracking)
- Health Monitoring (like sleep tracking or advanced ECG capabilities)
- Battery Life
- Comfort and Fit
- Compatibility with your smartphone's operating system
- Price Range
- Knowing which of these you value most will help narrow down your options.
""";

var userPromptDecisionConversationTurn2 = """
Got it. Battery life and sleep tracking are both important to me. 
What's a typical battery life range for trackers, and how good is their sleep tracking?
""";

var assistantResponseDecisionConversationTurn2 = """
Different fitness trackers have varying battery lives, typically anywhere from 2-3 days (for more feature-rich or bright-display devices) 
up to about 10-14 days (for more minimalist trackers). 

Regarding sleep tracking:
- Many modern devices can track different sleep stages (light, deep, REM).
- High-end devices even track breathing rate and oxygen saturation during the night.
- Some also offer insights about sleep quality and tips for improvement.

If battery life is a priority, you may want to consider trackers with a more conservative display and fewer power-hungry features.
""";

var userPromptDecisionConversationTurn3 = """
Are there any popular models you would recommend for that balance of battery life and sleep tracking?
""";

var assistantResponseDecisionConversationTurn3 = """
Popular options that strike a balance between robust sleep tracking and good battery life include:
- Fitbit Inspire 3 or Fitbit Charge 5: Both have solid sleep tracking, multi-day battery, and strong app support.
- Garmin Vivosmart 5: Offers decent fitness and sleep insights, plus better-than-average battery life.
- Xiaomi Mi Band 7: Budget-friendly, surprisingly robust health metrics, and a long-lasting battery.

Each varies in price and features, so consider your budget and the specific metrics youd like to track.
""";

var userPromptDecisionConversationTurn4 = """
That is great infor. 
I also have a friend who said I should consider an Apple Watch. 
Does that have comparable battery life and sleep tracking?
""";

var assistantResponseDecisionConversationTurn4 = """
The Apple Watch is known for its extensive feature set, including advanced health monitoring, 
but its battery life tends to be shorterusually around 18-24 hours on a single charge 
(or possibly a bit more in low-power mode). While its sleep tracking features have improved over time, 
you might find you need to charge it daily or almost daily, which could conflict with your goal of 24/7 tracking. 
""";

// Create a new chat history with a multi-turn conversation about buying a fitness tracker
// Notice how the conversation flow uses different roles (user and assistant) to simulate a realistic decision-making dialogue
var chatHistoryMessages = new List<ChatMessage>();

chatHistoryMessages.Add(new ChatMessage(ChatRole.System, systemPromptDecisionConversation));
chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptDecisionConversationTurn1));
chatHistoryMessages.Add(new ChatMessage(ChatRole.Assistant, assistantResponseDecisionConversationTurn1));
chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptDecisionConversationTurn2));
chatHistoryMessages.Add(new ChatMessage(ChatRole.Assistant, assistantResponseDecisionConversationTurn2));
chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptDecisionConversationTurn3));
chatHistoryMessages.Add(new ChatMessage(ChatRole.Assistant, assistantResponseDecisionConversationTurn3));
chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptDecisionConversationTurn4));
chatHistoryMessages.Add(new ChatMessage(ChatRole.Assistant, assistantResponseDecisionConversationTurn4));

Using the above conversation history as the "Gathered Intelligence" betweeen the user and the AI assistant, let's make a final decision and ask for final feedback and a decision evaluation. This "Gathered Intelligence" for the decision can be persisted, re-loaded, simulated multiple times, applied to different AI systems to optimize decisions further.

In [7]:
var userPromptDecisionConversationFinalDecision = """
Thank you for all of that information, I think I'll go with a Fitbit. 
The Fitbit Inspire 3 seems like a good fit for my budget and needs. 

Any quick final thoughts or insights on my decision? 
""";

// Add User message to the chat history
chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptDecisionConversationFinalDecision));

// Execute the chat messages against the AI model
var fitnessTrackerResponse = await chatClient.GetResponseAsync(chatHistoryMessages);
var fitnessTrackerResponseText = fitnessTrackerResponse.Text;

// Add the response to the chat history (Chat Messages)
chatHistoryMessages.Add(new ChatMessage(ChatRole.Assistant, fitnessTrackerResponseText));

// Display the response string as Markdown
fitnessTrackerResponseText.DisplayAs("text/markdown");

That sounds like a sensible choice.

Quick final thoughts:

  • Good match for your priorities: The Inspire 3 is a strong fit if you care most about battery life and sleep tracking.
  • Low-friction daily use: Its multi-day battery makes it easier to wear consistently, which helps sleep data quality.
  • Budget-friendly: You’re getting the core health features without paying for extras you may not need.
  • Tradeoff to keep in mind: It won’t be as feature-rich as an Apple Watch or higher-end Garmin, especially for apps and smartwatch functions.

If your main goal is to build a consistent habit of tracking sleep and general activity, it’s a practical, well-balanced pick.


Step 5 - Inspect & Optimize Gathered Intelligence of Chat History

The ChatMessage list is a transparent construct that can be inspected and written out. Because it is a simple list, the chat messages object can be manipulated to replay chats from middle interactions to simulate different outcomes.

Execute the cell below to write out entire decision conversation.

📝 Note: In the Decision Intelligence framework, chat history can serve as a form of gathered intelligence. Interactions among users, AI models, processes, and agents provide valuable context for effective decision-making. It’s highly recommended to persist chat history objects (agent threads), especially during decision optimization, to ensure critical information is retained and accessible.

In [8]:
// Print the number of chat interactions and the chat history (turns)
Console.WriteLine("Number of chat interactions: " + chatHistoryMessages.Count());

// Change this to a string builder and show as markdown
var stringBuilderChatHistory = new StringBuilder();
foreach (var message in chatHistoryMessages)
{
    // add a new line for each message
    stringBuilderChatHistory.AppendLine($"**{message.Role.ToString().ToUpper()}**:");
    stringBuilderChatHistory.Append($"{message.Text.Replace("#", string.Empty)}");
    stringBuilderChatHistory.AppendLine("\n");
}

// Display the chat history as Markdown
stringBuilderChatHistory.ToString().DisplayAs("text/markdown");
Number of chat interactions: 11

SYSTEM: You are a Decision Intelligence assistant. Assist the user in exploring options, reasoning through decisions, problem-solving, and applying systems thinking to various scenarios. Provide structured, logical, and comprehensive advice.

USER: I am considering buying a fitness tracker but I am not sure which features really matter. Could you explain the main considerations?

ASSISTANT: Absolutely! Key considerations for choosing a fitness tracker often include:

  • Fitness Features (e.g., step counting, heart-rate monitoring, workout tracking)
  • Health Monitoring (like sleep tracking or advanced ECG capabilities)
  • Battery Life
  • Comfort and Fit
  • Compatibility with your smartphone's operating system
  • Price Range
  • Knowing which of these you value most will help narrow down your options.

USER: Got it. Battery life and sleep tracking are both important to me. What's a typical battery life range for trackers, and how good is their sleep tracking?

ASSISTANT: Different fitness trackers have varying battery lives, typically anywhere from 2-3 days (for more feature-rich or bright-display devices) up to about 10-14 days (for more minimalist trackers).

Regarding sleep tracking:

  • Many modern devices can track different sleep stages (light, deep, REM).
  • High-end devices even track breathing rate and oxygen saturation during the night.
  • Some also offer insights about sleep quality and tips for improvement.

If battery life is a priority, you may want to consider trackers with a more conservative display and fewer power-hungry features.

USER: Are there any popular models you would recommend for that balance of battery life and sleep tracking?

ASSISTANT: Popular options that strike a balance between robust sleep tracking and good battery life include:

  • Fitbit Inspire 3 or Fitbit Charge 5: Both have solid sleep tracking, multi-day battery, and strong app support.
  • Garmin Vivosmart 5: Offers decent fitness and sleep insights, plus better-than-average battery life.
  • Xiaomi Mi Band 7: Budget-friendly, surprisingly robust health metrics, and a long-lasting battery.

Each varies in price and features, so consider your budget and the specific metrics you’d like to track.

USER: That is great infor. I also have a friend who said I should consider an Apple Watch. Does that have comparable battery life and sleep tracking?

ASSISTANT: The Apple Watch is known for its extensive feature set, including advanced health monitoring, but its battery life tends to be shorter—usually around 18-24 hours on a single charge (or possibly a bit more in low-power mode). While its sleep tracking features have improved over time, you might find you need to charge it daily or almost daily, which could conflict with your goal of 24/7 tracking.

USER: Thank you for all of that information, I think I'll go with a Fitbit. The Fitbit Inspire 3 seems like a good fit for my budget and needs.

Any quick final thoughts or insights on my decision?

ASSISTANT: That sounds like a sensible choice.

Quick final thoughts:

  • Good match for your priorities: The Inspire 3 is a strong fit if you care most about battery life and sleep tracking.
  • Low-friction daily use: Its multi-day battery makes it easier to wear consistently, which helps sleep data quality.
  • Budget-friendly: You’re getting the core health features without paying for extras you may not need.
  • Tradeoff to keep in mind: It won’t be as feature-rich as an Apple Watch or higher-end Garmin, especially for apps and smartwatch functions.

If your main goal is to build a consistent habit of tracking sleep and general activity, it’s a practical, well-balanced pick.

By persisting the Decision Intelligence chats and making them available for inspection, can further help the decision-making process. For example you can load the Chat History summarize it or even have AI recommend optimizations for it based on the conversation.

📝 Note: The process below is simplified to illustrate the power of Gathering Intelligence with user <--> AI interactions. More advanced best practices will be introduced in further sections.

In [9]:
var userPromptSummarizeTheDecisionChat = """
Briefly summarize the chat conversation about buying a fitness tracker.
""";

chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptSummarizeTheDecisionChat));

// Execute the chat messages against the AI model
var fitnessTrackerDecisionSummaryResponse = await chatClient.GetResponseAsync(chatHistoryMessages);
var fitnessTrackerDecisionSummaryResponseText = fitnessTrackerDecisionSummaryResponse.Text;

// Display the response string as Markdown
fitnessTrackerDecisionSummaryResponseText.DisplayAs("text/markdown");

You asked what matters most in a fitness tracker, and we discussed key factors like fitness features, health monitoring, battery life, comfort, phone compatibility, and price. You then said battery life and sleep tracking were your priorities, so I explained that trackers usually range from about 2–3 days to 10–14 days of battery life, with many offering sleep-stage tracking and some advanced overnight health metrics. I suggested a few popular options that balance those needs: Fitbit Inspire 3/Charge 5, Garmin Vivosmart 5, and Xiaomi Mi Band 7. When you asked about the Apple Watch, I noted that it has stronger smartwatch and health features but much shorter battery life, typically around 18–24 hours, which makes constant sleep tracking less convenient. In the end, you chose the Fitbit Inspire 3 as a budget-friendly fit for your needs, and I agreed it’s a practical choice if your main goals are reliable sleep tracking and long battery life.

The chat history messsage can further be manipulated by looking at the user to AI interactions and getting feedback for future decision interactions.

In [10]:
// Optimize the chat history for any future decision interactions
var userPromptOptimizeTheDecisionChat = """
Based on the chat conversation so far...
Provide some recommendations on how the decision interactions could be optimized for decision-making.
What are some considerations for the AI to help the use make even better decisions?
""";

// Remove the last message to avoid redundancy
chatHistoryMessages.RemoveAt(chatHistoryMessages.Count - 1);

chatHistoryMessages.Add(new ChatMessage(ChatRole.User, userPromptOptimizeTheDecisionChat));

// Execute the chat messages against the AI model
var decisionOptimizationResponse = await chatClient.GetResponseAsync(chatHistoryMessages);
var decisionOptimizationResponseText = decisionOptimizationResponse.Text;

// Display the response string as Markdown
decisionOptimizationResponseText.DisplayAs("text/markdown");

Here are some ways the decision interaction could be optimized to help the user make better choices.

What could be improved in the interaction

1. Clarify the decision context earlier

The conversation focused on battery life and sleep tracking, but a stronger decision process would first ask:

  • What is the main use case: sleep, workouts, general health, or smartwatch features?
  • What phone do they use: iPhone or Android?
  • What budget range are they comfortable with?
  • Are there must-have features like GPS, ECG, or phone notifications?

This would help avoid recommending options before the decision criteria are fully defined.

2. Make tradeoffs explicit

The responses gave useful product suggestions, but could have more clearly framed the tradeoffs, for example:

  • Longer battery life often means fewer smartwatch features
  • Better sleep tracking may come at a higher price or more frequent charging
  • Apple Watch offers more smart features, but worse battery life for 24/7 wear
  • Fitbit may be a better “health-first” choice than a “smartwatch-first” choice

Making these tradeoffs explicit helps the user understand why a model fits.

3. Compare options using a decision framework

A simple comparison table would make the decision easier. For example:

  • Battery life
  • Sleep tracking quality
  • App ecosystem
  • Price
  • Comfort
  • Compatibility
  • Workout tracking

This supports more structured thinking instead of relying on isolated recommendations.

4. Explore user priorities more deeply

The interaction identified battery life and sleep tracking, which is good. But the AI could go further by asking:

  • How often are you willing to charge it?
  • Do you want detailed sleep insights or just basic sleep duration/stages?
  • Do you need a display always on?
  • Are you okay with a smaller screen if it improves battery life?

These details would help identify the best-fit model more accurately.

5. Separate facts from preferences

The AI could be more careful to distinguish:

  • Objective product features and battery estimates
  • Subjective fit based on the user’s lifestyle
  • The user’s preference weighting

For example, “The Inspire 3 is a good fit if battery life and sleep tracking matter more than smartwatch features.”
That’s better than presenting it as universally “best.”

6. Include confidence and caveats

Helpful decision support should note where information may vary:

  • Battery life depends on usage, notifications, and display settings
  • Sleep tracking quality varies by algorithm and user comfort
  • App quality and ecosystem matter a lot for long-term satisfaction

This improves realism and helps the user avoid surprises.

What the AI should consider to help the user make better decisions

1. Decision criteria hierarchy

The AI should help the user rank what matters most:

  • Must-have
  • Nice-to-have
  • Dealbreaker

That makes the decision more robust.

2. Hidden constraints

The AI should check for constraints such as:

  • Phone compatibility
  • Wrist comfort
  • Budget ceiling
  • Charging habits
  • Sensitivity to subscriptions
  • Preference for discrete versus bulky devices

3. Use-case fit

Different devices are optimized for different jobs:

  • Fitbit: health and wellness tracking
  • Garmin: battery and fitness focus
  • Apple Watch: smartwatch and ecosystem integration
  • Budget trackers: basic tracking at lower cost

The AI should map the device to the use case rather than just listing features.

4. Long-term satisfaction

The best purchase is not only the one with the most features, but the one the user will actually wear consistently.
So the AI should consider:

  • Ease of use
  • Comfort
  • Charge frequency
  • App engagement
  • Whether the device matches daily habits

5. Opportunity cost

If the user buys one tracker, what are they giving up?

  • More smartwatch functions
  • Better battery
  • Lower price
  • More advanced metrics

Thinking in terms of tradeoffs helps avoid regret.

A better decision-support interaction would do this

A strong version of the conversation would:

  1. Ask 3–5 key questions up front
  2. Rank the user’s priorities
  3. Compare a small set of relevant options
  4. Explain tradeoffs clearly
  5. End with a recommendation matched to the user’s specific needs

Bottom line

For this kind of product decision, the AI should help the user:

  • define priorities,
  • compare tradeoffs,
  • account for constraints,
  • and choose the option most likely to be used consistently.

If you want, I can also turn this into a short “ideal AI decision-making checklist” for future product recommendations.