In the evolving landscape of artificial intelligence, creating agents that can intelligently interact with humans is paramount. A key aspect of this interaction is the ability to gather feedback dynamically, allowing the agent to refine its understanding, make better decisions, and personalize its responses. Microsoft Adaptive Cards offer a powerful and flexible way to achieve this, especially within sophisticated agentic frameworks. This guide explores how you can leverage Adaptive Cards to request user feedback based on chat context, enabling a more responsive and effective agentic flow.
Microsoft Adaptive Cards are platform-agnostic snippets of UI, authored in JSON, that apps and services can openly exchange. When delivered to a specific app, the JSON is transformed into native UI that automatically adapts to its surroundings. This makes them an ideal choice for embedding rich, interactive content directly within conversational interfaces like Microsoft Teams, Outlook, or custom AI agent frontends.
An Adaptive Card displaying dynamic information within a chat application.
Action.Submit), which then sends the collected information back to the agent or a connected service for processing.The method for integrating dynamic Adaptive Cards varies depending on the chosen agentic framework. Below, we explore approaches for Semantic Kernel, LangGraph, and the often-paired Microsoft Copilot Studio with Power Automate.
Semantic Kernel, an open-source SDK from Microsoft, is designed for building AI agents that can orchestrate AI models with existing code. Its modularity and extensibility make it well-suited for incorporating human-in-the-loop (HITL) scenarios, including dynamic Adaptive Card feedback.
Within Semantic Kernel, you can create "skills" or "plugins" that programmatically generate the JSON payload for an Adaptive Card. This JSON can be constructed based on the current conversation context, agent state, or specific data points you want user input on. For example, after an agent provides a complex answer, it could trigger a skill to generate an Adaptive Card asking for feedback on clarity, with a dropdown for "Very Clear," "Somewhat Clear," or "Not Clear."
// Conceptual C# example for generating dynamic card JSON in Semantic Kernel
public class FeedbackSkill {
[SKFunction, Description("Generates an Adaptive Card for feedback.")]
public string GenerateFeedbackCard([SKName("context")] string chatContext) {
// Logic to analyze chatContext and build dynamic elements
string dynamicPrompt = $"Based on our discussion about '{chatContext}', how would you rate the information?";
var card = new {
type = "AdaptiveCard",
version = "1.5",
body = new[] {
new { type = "TextBlock", text = dynamicPrompt, wrap = true },
new {
type = "Input.ChoiceSet",
id = "userFeedbackRating",
style = "compact",
choices = new[] {
new { title = "Excellent", value = "5" },
new { title = "Good", value = "4" },
new { title = "Fair", value = "3" },
new { title = "Poor", value = "2" }
}
},
new { type = "Input.Text", id = "userFeedbackComment", placeholder = "Any additional comments?", isMultiline = true }
},
actions = new[] {
new { type = "Action.Submit", title = "Submit Feedback", data = new { action = "submitFeedback" } }
}
};
return System.Text.Json.JsonSerializer.Serialize(card);
}
}
Once the JSON is generated, Semantic Kernel can use a connector (e.g., to Microsoft Teams or a custom chat interface) to send the card to the user. Upon submission, the feedback data is returned, which the agent can then process to influence its next steps, update its memory, or log for analysis.
For a more low-code/no-code approach, Microsoft Copilot Studio (formerly Power Virtual Agents) combined with Power Automate offers robust capabilities for dynamic Adaptive Card feedback.
Copilot Studio allows you to add "Ask with Adaptive Card" nodes directly into your conversation topics. You can use the built-in designer or paste JSON created with the online Adaptive Cards designer. Crucially, Copilot Studio supports Power Fx formulas to dynamically populate card content using topic or global variables. This means the questions, options in a dropdown, or pre-filled text can be tailored to the immediate chat context.
An Adaptive Card with a dropdown (Input.ChoiceSet) for structured user feedback.
When a user submits an Adaptive Card in Copilot Studio, the output (e.g., the selected dropdown value, text input) is stored in variables. These variables can then be passed to a Power Automate flow. Power Automate can then perform various actions, such as:
Actions like "Post an Adaptive Card to a Teams user and wait for a response" in Power Automate are particularly useful for scenarios where the agent needs to pause and await user input before proceeding.
This video demonstrates how Adaptive Cards can be used within Microsoft Copilot Studio to ask questions and collect user input, a core aspect of the dynamic feedback mechanism discussed.
LangGraph, an extension of LangChain, is designed for building stateful, multi-actor applications with LLMs. It excels at creating cyclical graphs and explicitly managing agent state, including human-in-the-loop interactions.
While LangGraph doesn't natively render UIs like Adaptive Cards, its architecture is well-suited for integrating them. A LangGraph agent can reach a state where human input is required. At this point, it can:
This approach leverages LangGraph's strength in flow control and HITL while delegating the UI aspects to specialized services.
CrewAI focuses on orchestrating collaborative autonomous AI agents. While the provided information doesn't detail specific, direct integrations for Microsoft Adaptive Cards in CrewAI for dynamic feedback based on chat context, its general design principles suggest that such functionality would be implemented via custom tools.
In CrewAI, an agent could be equipped with a custom tool that, when invoked:
This maintains CrewAI's agent and tool-based architecture, abstracting the Adaptive Card interaction into a reusable component.
To help visualize how these different frameworks and tools might suit your needs for implementing dynamic Adaptive Card feedback, the following radar chart offers a qualitative comparison across key dimensions. These are opinion-based interpretations derived from their general capabilities and the provided information.
Radar chart comparing Semantic Kernel, Copilot Studio + Power Automate, and LangGraph (with external integration) for dynamic Adaptive Card feedback.
Regardless of the specific framework, the overall process for implementing dynamic Adaptive Card feedback typically follows these steps. The mindmap below illustrates this cyclical flow:
Mindmap illustrating the process flow for dynamic Adaptive Card feedback in an agentic system.
The following table provides a side-by-side comparison of the discussed approaches for implementing dynamic Adaptive Card feedback:
| Feature | Semantic Kernel | Microsoft Copilot Studio + Power Automate | LangGraph (with external integration) |
|---|---|---|---|
| Card Generation Method | Programmatic JSON creation via code/plugins (C#, Python, Java) | Visual designer & Power Fx for dynamic content in Copilot Studio | API call to an external service or bot framework for generation |
| Dynamic Content Source | Chat context variables, agent state, function outputs | Topic/agent variables within Copilot Studio, Power Fx formulas | Context data passed from LangGraph to the external card service |
| Feedback Handling | Custom code in skills/plugins, event listeners, processing function outputs | Power Automate flows triggered by card submission to capture/process data | Webhook/callback to LangGraph agent, or polling updated state |
| Primary Integration | Deeply with Microsoft ecosystem (Azure AI, etc.), programmatic SDK | Seamlessly within Microsoft ecosystem (Teams, Dataverse, etc.), low-code | Via APIs, custom connectors, explicit Human-in-the-Loop nodes |
| Typical Complexity | Moderate to High (requires development effort in C#, Python, or Java) | Low to Moderate (visual tools, some Power Fx scripting) | Moderate to High (involves setting up integrations and API management) |
| Human-in-the-Loop (HITL) Support | Strong, integral to agent design and plugin architecture | Strong, core feature of conversational AI and Copilot Studio flows | Core design principle, explicitly managed through graph states and nodes |
Action.Submit button), the data entered or selected by the user (like a dropdown choice or text input) is sent back to the application or service that presented the card. The agent (or an intermediary like Power Automate) then captures this data. This data can be used to:
Integrating dynamic user feedback via Microsoft Adaptive Cards significantly enhances the capabilities of agentic frameworks. By tailoring feedback requests to the specific chat context, agents can gather more relevant information, leading to improved performance, user satisfaction, and more natural interactions. While Semantic Kernel and Microsoft Copilot Studio (with Power Automate) offer more direct pathways within the Microsoft ecosystem, frameworks like LangGraph and CrewAI can also achieve this through well-designed integrations and custom tooling. The key is to choose the approach that best aligns with your technical stack, development resources, and the specific requirements of your AI agent.