microsoft / microsoft/agent-framework

.NET Agent Prompt Templates and Versioning

Open
#2,689 4 comments 0 reactions 0 assignees View on GitHub
.NET question
Dominant language
Python
Stars
13.6k
Forks
2.3k
Avg merge
2d 45m
Merged PRs (30d)
358

Description

Current Behavior: Prompts are hardcoded strings in agent creation. No built-in template support or versioning.

Problem: Production systems need to:

Test different prompt variations
Version prompts separately from code
A/B test agent behaviors
Centralize prompt management
Recommended Changes:

Add PromptTemplate abstraction
Support variable substitution
Enable external prompt management (files, config, database)
Provide prompt versioning and rollback
Example Desired API:

```
// Define template
var template = PromptTemplate.FromFile("prompts/analyst-v2.txt");

// Create agent with template
var agent = chatClient.CreateAIAgent(
name: "Analyst",
promptTemplate: template,
tools: tools);

// Runtime variable substitution
var result = await agent.RunAsync(
template.Render(new { childId = "child-123", status = "Nice" }));
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the .NET agent-creation path behind CreateAIAgent and the existing hardcoded prompt handling. Review how prompt inputs are currently passed to agents, then define the scope for templates, variable substitution, external sources, versioning, and rollback. Done should include an agreed API and coverage for the requested prompt-management behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.