Forwarded props flowing from the React provider into the Microsoft Agent Framework agent's system prompt on every turn. The agent adapts tone, assumed expertise, and response length based on selector state — no code change, no conversation restart.
- Pick a tone, expertise level, and response length from the config card.
- Send any message (e.g. "Explain how a database index works").
- Change one of the selects and send a follow-up ("Explain it again").
- Compare the two responses — the second reflects the new settings.
Provider properties are passed via <CopilotKit properties={{...}}>.
CopilotKit serializes them into the AG-UI forwardedProps field on every
agent run.
Backend — src/agents/agent_config_agent.py defines
AgentConfigFrameworkAgent, a subclass of AgentFrameworkAgent that
overrides run_agent:
- Reads
forwardedPropsfrom the AG-UI input dict with defensive defaults. - Composes a system prompt from three small rulebooks (tone / expertise / length).
- Prepends that prompt as a system message before delegating to the default orchestrator chain.
The underlying MS Agent Framework Agent is static — per-turn customization
rides in as an injected leading system message rather than by rebuilding the
agent.
Dedicated route — this demo has its own runtime at
/api/copilotkit-agent-config proxying to the backend's /agent-config
FastAPI endpoint. Scoping keeps the dynamic-prompt behaviour out of the
shared agent used by other demos.