All skills
microsoft avatar

/microsoft-foundry

@04110d9
by microsoftmicrosoft/skills3.1k stars
351

Build, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and resources end to end. USE FOR: foundry, azd ai agent, azd provision/deploy, hosted agent scaffold/develop/run/deploy/troubleshoot, prompt agent create, create agent, update agent, add tool to agent, invoke agent, agent.yaml, agent insights, pull agent insights, evaluate agent, batch eval, continuous eval, continuous monitoring, agent CI/CD, optimize prompt, improve prompt, prompt optimizer, optimize agent instructions, Agent Optimizer scaffold, dataset curation from traces, deploy model, model fine-tuning (SFT/DPO/RFT), Foundry project, RBAC, role assignment, permissions, quota, capacity, region, deployment failure, AI Services, create Foundry resource, knowledge index, customize deployment, onboard, availability, training-data, grader, distillation, large file upload. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure-prepare).

Use this Skill: https://skilld.dev/gh/microsoft/skills/microsoft-foundry

This session only. Nothing lands on disk.

foundry-agentcreatereferencestoolsprompt-agenttool-memory.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Agent Memory

Managed long-term memory for Foundry agents. Enables agent continuity across sessions, devices, and workflows. Agents retain user preferences, conversation history, and deliver personalized experiences. Memory is stored in your project's owned storage.

Prerequisites

  • A Foundry project with authorization configured
  • A chat model deployment (e.g., gpt-5.2)
  • An embedding model deployment (e.g., text-embedding-3-small) — see Check Embedding Model below
  • Python packages: pip install azure-ai-projects azure-identity

Check Embedding Model

An embedding model is required before enabling memory. Check if one is already deployed:

Use foundry_models_list MCP tool to list all deployments and look for an embedding model (e.g., text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002).

Result Action
✅ Embedding model found Note the deployment name and proceed
❌ No embedding model Deploy one before enabling memory — see below

Deploy Embedding Model

If no embedding model exists, use foundry_models_deploy MCP tool with:

  • deploymentName: text-embedding-3-small (or preferred name)
  • modelName: text-embedding-3-small
  • modelFormat: OpenAI

Authorization and Permissions

Role Scope Purpose
Foundry User AI Services resource Assigned to project managed identity
System-assigned managed identity Project Must be enabled on the project

Setup steps:

  1. In Azure portal → project → Resource Management → Identity → enable system-assigned managed identity
  2. On the AI Services resource → Access control (IAM) → assign Foundry User to the project managed identity

Workflow

User wants agent memory
    │
    ▼
Step 1: Check for embedding model deployment
    │  ├─ ✅ Found → Continue
    │  └─ ❌ Not found → Deploy one (ask user)
    │
    ▼
Step 2: Create memory store
    │
    ▼
Step 3: Attach memory tool to agent
    │
    ▼
Step 4: Test with conversation

Key Concepts

Memory Store Options

Option Description
chat_summary_enabled Summarize conversations for memory
user_profile_enabled Build and maintain user profile
user_profile_details Control what data gets stored (e.g., "Avoid sensitive data such as age, financials, location, credentials")

💡 Tip: Use user_profile_details to control what the agent stores — e.g., "flight carrier preference and dietary restrictions" for a travel agent, or exclude sensitive data.

Scope

The scope parameter partitions memory per user:

Scope Value Behavior
{{$userId}} Auto-extracts TID+OID from auth token (recommended)
"user_123" Static identifier — you manage user mapping

Memory Store Operations

Operation Description
Create Initialize a memory store with chat/embedding models and options
List List all memory stores in the project
Update Update memory store description or configuration
Delete scope Delete memories for a specific user scope
Delete store Delete entire memory store (irreversible — all scopes lost)

⚠️ Warning: Deleting a memory store removes all memories across all scopes. Agents with attached memory stores lose access to historical context.

Troubleshooting

Issue Cause Resolution
Auth/authorization error Identity or managed identity lacks required roles Verify roles in Authorization section; refresh access token for REST
Memories don't appear after conversation Updates are debounced or still processing Increase wait time or call update API with update_delay=0
Memory search returns no results Scope mismatch between update and search Use same scope value for storing and retrieving memories
Agent response ignores stored memory Agent not configured with memory search tool Confirm agent definition includes MemorySearchPreviewTool with correct store name
No embedding model available Embedding deployment missing Deploy an embedding model — see Check Embedding Model section

References

Source: SKILL.md on GitHub

2 warnings3d4 checks · Risk SAFE
  • Gen Agent Trust Hub3d

    This skill provides a comprehensive environment for managing the end-to-end lifecycle of AI agents, models, and infrastructure on Microsoft Foundry. It includes sub-skills for deployment, evaluation, fine-tuning, and troubleshooting. The skill utilizes dynamic code execution and shell command wrappers, which are used within the context of local development and cloud orchestration. All external resources and dependencies originate from trusted organizations and well-known services.

  • Socket3d

    2 alerts: gptSecurity, gptAnomaly

  • Snyk3d

    Risk: LOW · No issues

  • Runlayer7mo

    36/36 files flagged

Signed by skilld at 04110d9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week
metadata
{
  "author": "Microsoft",
  "version": "1.2.26"
}

README badge

README badge for microsoft/skills/microsoft-foundry