Streamlined Sitecore Agents with Microsoft Agent Framework

Published 11/12/2025
sitecoremicrosoft-agent-frameworkazure-openaiagentsconsole-app

Last week I shared a Gradio-based Sitecore Agent playground that demonstrated how to build interactive AI agents on top of the Sitecore Agent API. While that sample was great for understanding the concepts and creating demos, sometimes you need something lighterβ€”a simple console application that gets straight to the point.

Enter the MAF-Sitecore-Agent-API repository: another teaching example that uses Microsoft Agent Framework and Azure OpenAI to strip away the web UI complexity and focus purely on the agent mechanics. Like the Gradio version, this is educational code designed to help developers understand integration patterns, not a production-ready application.

Why Microsoft Agent Framework?

While LangChain is powerful and flexible, Microsoft Agent Framework offers a more opinionated, enterprise-ready approach that integrates seamlessly with Azure services. For teams already invested in the Microsoft ecosystem, it provides:

  • Native Azure OpenAI integration with built-in authentication and scaling
  • Simplified agent orchestration without the complexity of custom ReAct loops
  • Enterprise-grade logging and monitoring through Azure Application Insights
  • Consistent patterns that align with other Microsoft AI services

The tradeoff is less flexibility compared to LangChain, but for straightforward agent scenarios like Sitecore API automation, that’s often exactly what you want.

Architecture comparison

The Gradio version used LangChain’s ReAct pattern with custom tool generation. This Microsoft Agent Framework approach simplifies the stack:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Console Interface    β”‚
β”‚  - Natural language     β”‚
β”‚  - Command loop         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Microsoft Agent Frameworkβ”‚
β”‚  - Built-in reasoning   β”‚
β”‚  - Tool orchestration  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Azure OpenAI         β”‚
β”‚  - GPT-4o integration  β”‚
β”‚  - Managed scaling     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚
           β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Sitecore Agent API   β”‚
β”‚  - Auto-generated toolsβ”‚
β”‚  - OAuth authenticationβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Getting started

The setup is intentionally minimal. Clone the repo and configure three key pieces:

git clone https://github.com/kevinpbuckley/MAF-Sitecore-Agent-API.git
cd MAF-Sitecore-Agent-API
pip install -r requirements.txt
cp .env.sample .env

Edit .env with your credentials:

# Azure OpenAI
AZURE_OPENAI_API_KEY=your-azure-openai-key
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o

# Sitecore (from XM Cloud Deploy automation credentials)
SITECORE_CLIENT_ID=your-client-id
SITECORE_CLIENT_SECRET=your-client-secret

Then run:

python sitecore_agent.py

The agent downloads the latest Sitecore OpenAPI spec, generates tools for all 39 operations, and drops you into an interactive chat session.

Example interactions

The console interface accepts natural language commands and translates them into appropriate API calls:

  • β€œlist sites” β†’ Calls the sites endpoint and formats the response
  • β€œshow pages for nextjs-skate-park site” β†’ Retrieves pages for a specific site
  • β€œget site details for alaris” β†’ Fetches comprehensive site information
  • β€œsearch for content items with β€˜hero’ in the name” β†’ Queries content across the instance

Each command follows the same pattern: the agent parses your intent, selects the appropriate Sitecore operation, handles OAuth authentication, and returns formatted results.

Key differences from the Gradio version

AspectGradio SampleMAF Console
InterfaceWeb UI with chat + status indicatorsTerminal-only interaction
FrameworkLangChain with custom ReAct loopMicrosoft Agent Framework
ModelOpenAI API (various providers)Azure OpenAI only
DependenciesHeavy (Gradio + LangChain + Pydantic)Minimal (Agent Framework + requests)

Looking ahead

Both samples demonstrate the same core concept: modern AI agents can consume OpenAPI specifications and provide natural language interfaces to complex APIs. The choice between LangChain flexibility and Agent Framework opinions depends on your team’s priorities and existing infrastructure.

For teams exploring Sitecore automation you should probably explore Sitecore’s MCP Server and Agent Studio as well.