Skip to content

Conversation

Copy link

Copilot AI commented Oct 8, 2025

Architecture Decision Record (ADR) exploring how SemanticPluginForge can support context-aware plugin metadata customization through a flexible, extensible interface design. While designed with Semantic Kernel's agentic framework in mind, the solution supports any context-based scenario including multi-tenancy, user-specific configurations, and session-based customizations.

Changes Made

  • Created ADR-0001 (adr/0001-agentic-framework-integration.md) following Architecture Decision Record conventions with:

    • Status: Proposed
    • Context: Explains the need for context-aware metadata customization in modern plugin scenarios
    • Decision: Proposed IPluginContext interface pattern with extensible context types
    • Consequences: Analysis of positive, negative, and neutral outcomes
  • Architecture and Design:

    • Introduced IPluginContext interface as base for all context types, enabling custom implementations
    • AgentContext implements IPluginContext for agent-specific scenarios
    • Created IContextAwarePluginMetadataProvider interface (with IAgentPluginMetadataProvider as convenience alias)
    • Context is passed at plugin registration time, eliminating the need for kernel-level state storage
  • API Extensions:

    • AddFromTypeWithContext<T>(IPluginContext context) - general method for any context type
    • AddFromTypeForAgent<T>(string agentName) - convenience method for agent scenarios
    • Full dependency injection support with fallback for non-DI scenarios
    • All examples demonstrate proper DI registration with services.AddSingleton<IContextAwarePluginMetadataProvider>()
  • Documented use cases:

    • Agent-based plugin capabilities (different agents see different metadata based on agent name)
    • Agent group chat with specialized capabilities per agent
    • Dynamic capability management with runtime control
    • Agent channel integration for agent-to-agent communication
    • Custom context example (TenantContext) demonstrating multi-tenancy support
  • Implementation considerations:

    • Context passing at registration time (no global state)
    • Performance optimization with caching
    • Agent lifecycle management and metadata refresh
    • Multi-agent coordination approaches
  • Simplified Design:

    • AgentContext contains only AgentName and Properties (removed AgentId and AgentRole)
    • Agent name serves as the primary identifier for all metadata decisions
    • No kernel-level context storage - context is explicit at plugin registration
    • Eliminated redundancy - context specified once at registration time
  • Extensibility Features:

    • Custom context types supported through IPluginContext interface
    • Type-safe context objects with intellisense support
    • Backward compatible with existing IPluginMetadataProvider for context-unaware scenarios
  • Migration path: Shows how existing SemanticPluginForge users can adopt context-aware plugins while maintaining backward compatibility

  • Testing strategy: Includes unit tests, integration tests, and multi-agent scenario tests

  • ADR infrastructure: Created adr/README.md to document the ADR directory structure and index

The ADR provides a complete blueprint for extending SemanticPluginForge with flexible, context-aware metadata customization that supports agents, multi-tenancy, user-specific configurations, and any custom context scenario through a clean, extensible interface design.

Fixes #23

Original prompt

This section details on the original issue you should resolve

<issue_title>Research on how it would work</issue_title>
<issue_description></issue_description>

<agent_instructions>Create a markdown document describing how it would work</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #23

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@lsiddiquee
Copy link
Owner

@copilot This issue is not about how the current solution works. But design adding support for the newly release agentic framework in semantic kernel and how that would work.!!

Copy link
Author

Copilot AI commented Oct 8, 2025

@copilot This issue is not about how the current solution works. But design adding support for the newly release agentic framework in semantic kernel and how that would work.!!

Understood. I'll create a design document exploring how SemanticPluginForge could integrate with Semantic Kernel's newly released agentic framework, rather than documenting the current solution's internals.

Co-authored-by: lsiddiquee <15940466+lsiddiquee@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation on how it would work Add Agentic Framework Integration Design Documentation Oct 8, 2025
@lsiddiquee
Copy link
Owner

@copilot this shoudl not be in docs but in adr folder

Co-authored-by: lsiddiquee <15940466+lsiddiquee@users.noreply.github.com>
Copy link
Author

Copilot AI commented Oct 8, 2025

@copilot this shoudl not be in docs but in adr folder

Moved to adr/0001-agentic-framework-integration.md with proper ADR format including Status, Context, Decision, and Consequences sections. Also added adr/README.md to document the ADR directory structure. (commit c81ed04)

Copilot AI changed the title Add Agentic Framework Integration Design Documentation Add Agentic Framework Integration Architecture Decision Record Oct 8, 2025
Co-authored-by: lsiddiquee <15940466+lsiddiquee@users.noreply.github.com>
Co-authored-by: lsiddiquee <15940466+lsiddiquee@users.noreply.github.com>
var kernel = builder.Build();

// Register agent context for plugin resolution
kernel.Data[AgentContextKey] = new AgentContext
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why is this agent context required here? I assume that the agentcontext is passed when the plugin is registered.

Also generalizing, what if we create an interface IPluginContext and use that for context and we can create a concrete AgentContext which can be used for Agentic this will allow users to pass any custom metadata/context they want?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to introduce IPluginContext interface for extensibility. Context is now passed only at plugin registration time via AddFromTypeWithContext() or AddFromTypeForAgent(). Removed kernel-level context storage entirely - no more global state. AgentContext is now just one implementation of IPluginContext, enabling custom context types for multi-tenancy, user-specific configs, or any other scenario. (commit in progress)

…egistration

Co-authored-by: lsiddiquee <15940466+lsiddiquee@users.noreply.github.com>
Copilot AI changed the title Add Agentic Framework Integration Architecture Decision Record Add Context-Aware Plugin Metadata Architecture Decision Record Oct 12, 2025
Copilot AI requested a review from lsiddiquee October 12, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Research on how it would work

2 participants