AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

microsoft-foundry

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, managed harness agent, Copilot harness, voice agent, create/update/invoke/evaluate agent, add tool to agent, agent insights, batch/continuous eval, continuous monitoring, agent CI/CD, optimize/improve prompt, optimize agent instructions, Agent Optimizer, 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).

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read microsoft--microsoft-foundry at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 151

foundry-agent/create/references/tools/prompt-agent/tool-memory.md

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