IDE Agents + Redis + Azure AI Foundry · ArchitectureAI-Native Software Engineer

IDE Agents with Redis and Azure AI Foundry

Paula Silva · AI-Native Software Engineer, Microsoftlinkedin.com/in/paulanunes05 Jun 2026 · v1.0 · Architecture plan (companion)

IDE Agents with Redis and Azure AI Foundry - Architecture Plan

AI-Native Software Engineer · Paula Silva · linkedin.com/in/paulanunes · v1.0 · 2026-06-05

Companion to "GitHub Agents Platform with Redis and Azure AI Foundry". That document covers the GitHub-hosted cloud agents (coding agent, code review, CLI). This one covers the IDE agents: Agent Mode and the Agents window in Visual Studio Code, and the equivalent in Visual Studio and the GitHub Copilot app.

Executive Summary

The IDE agent runs on the developer's machine, inside the editor, operating on the open workspace, the terminal, and editor context. It is interactive and developer-in-the-loop, unlike the cloud coding agent that runs autonomously in a GitHub-hosted ephemeral environment. That single difference changes where Redis and Foundry plug in.

The short answers:

Code completions are a separate path: they stay on GitHub Copilot's own infrastructure, remain included, and are not affected by BYOK or by the agent model choice.1

Cloud coding agent versus IDE agent

Dimension Cloud coding agent IDE agent (Agent Mode / Agents window)
Runtime location GitHub-hosted ephemeral environment on GitHub Actions Developer machine, inside the editor
Interaction Autonomous, background, draft pull request Interactive, developer in the loop, edits the open workspace
Context source Cloned repo, RAG over GitHub code search Open workspace, editor selection, terminal, attached context
Memory GitHub-hosted Copilot Memory (repo facts, user prefs) Local memory tool (global and workspace scopes); Copilot Memory where the surface uses it
Model selection Auto and the model set allowed by policy Model picker, Auto, BYOK providers and local models
Where Redis fits In the serving plane the agent calls Via Custom Endpoint to an AI Gateway, or via MCP tools backed by Redis
Billing GitHub AI Credits (and Actions minutes for review) AI Credits on default models; BYOK billed by the provider, not credits
Governance Control plane, branch protections, Azure Policy Organization policy (BYOK, models, preview features), content exclusion, MCP allowlist

The new Agents window in VS Code brings an agent-first surface to the editor, with multiple parallel sessions and the ability to remotely control longer-running sessions.2

System Context

System Context Diagram

PAULA SILVASOFTWARE GLOBAL BLACK BELTIDE agents with Redis and Azure AI FoundrySystem context. The IDE agent runs on the developer machine. Three model paths.DeveloperIDE AGENT (VS CODE, VISUAL STUDIO, COPILOT APP)Agent Mode and Agents windowModel picker (Auto, BYOK)Local memory toolPrimitivescopilot-instructions, instructions, prompts, customagentsLocal workspacefiles, terminal, editorMCP serverslocal and internal (Azure)GitHub-managed backenddefault models, completionsBYOK providersAnthropic, OpenAI, Gemini,Azure, OpenRouter, FoundryLocal, OllamaAI Gateway (API Management)via Custom EndpointAzure AI FoundryModel Router, modelsAzure Managed Redissemantic cache, vector, memoryOrganization policy and Entra IDuseseditstoolsdefaultBYOKCustom Endpointroutescachesvector/memgovernsFoundationModel planeTools / contextCache / memoryExternal / neutralPaula Silva | AI-Native Software Engineerlinkedin.com/in/paulanunes

Overview. The IDE agent sits on the developer's machine between the developer and the model and tool plane. It can reach models three ways: the GitHub-managed backend, a BYOK provider directly, or a BYOK Custom Endpoint that targets your own AI Gateway.

Key components. Inside the IDE: Agent Mode and the Agents window, the model picker, the local memory tool, and the file-based primitives. Outside: the local workspace, MCP servers, the GitHub-managed backend, BYOK providers, the AI Gateway, Azure AI Foundry, Azure Managed Redis, and organization policy with Entra ID.

Relationships. The agent operates on the local workspace and calls MCP tools. For inference it uses the picked model: default backend, a BYOK provider, or a Custom Endpoint to the gateway. The gateway fronts Foundry and Redis. MCP servers can also be backed by Redis and Foundry.

Design decisions. The Custom Endpoint is the clean enterprise integration point: it lets a team insert caching, routing and policy in front of the IDE without changing the developer experience. MCP is the second integration point, for retrieval and memory tools.

NFR considerations. Scalability: the gateway and Redis scale server-side, independent of the editor. Performance: Redis short-circuits repeated requests; local models cut latency further. Security: BYOK can run air-gapped; organization policy controls providers; content exclusion limits what leaves the machine. Reliability: the default backend remains a fallback. Maintainability: model choice is configuration, not code.

Trade-offs. BYOK direct to a provider is simplest but bypasses your gateway, so it has no shared cache or central policy. Routing through a Custom Endpoint adds a hop but regains caching, routing and governance.

Risks and mitigations. Risk: developers send sensitive code to an unapproved BYOK provider. Mitigation: the organization BYOK policy (off by default for the org until enabled) and content exclusion; prefer the Custom Endpoint to a governed gateway.1

Deployment and Topology

Topology Diagram

PAULA SILVASOFTWARE GLOBAL BLACK BELTIDE topology: three model paths and one tool pathPath A default backend. Path B BYOK direct. Path C governed via Custom Endpoint.DEVELOPER MACHINEIDE: Agent Mode, Agents windowLocal MCP serversLocal memory filesglobal, workspaceFoundry Local or Ollama (optional)PATH A: GITHUB-MANAGED (DEFAULT)Copilot backend and modelsCode completions (always here, free)PATH B: BYOK DIRECTAnthropic, OpenAI, Gemini, OpenRouter,AzurePATH C: AZURE GOVERNED (CUSTOM ENDPOINT)API Management AI GatewayFoundry Model RouterFoundry modelAzure Managed Redis: semantic cache, vector, memoryInternal MCP serversAzure AI Search, Foundry IQEntra ID, org policy, Azure PolicycompletionsdefaultBYOKCustom EndpointcachetoolsPaula Silva | AI-Native Software Engineerlinkedin.com/in/paulanunes

Overview. Three model paths and one tool path. Path A is the default GitHub-managed backend. Path B is BYOK directly to a provider or a local model. Path C is the governed path: a Custom Endpoint to an API Management AI Gateway that fronts the Foundry Model Router and Azure Managed Redis. MCP tools, local or internal, are the tool path; internal MCP servers are backed by Redis and search.

Key components. On the machine: the editor, local MCP servers, local memory files, and optional local models through Foundry Local or Ollama. In Azure: the AI Gateway, the Model Router, Azure Managed Redis, internal MCP servers, Azure AI Search and Foundry IQ, and Entra ID with organization and Azure Policy.

Relationships. Completions always go to the GitHub backend. The agent's inference goes to whichever model the picker selects. The Custom Endpoint sends governed traffic through the gateway, which caches in Redis and routes through Foundry. MCP tools reach internal servers that use Redis and search.

Design decisions. Foundry Local and Ollama give an air-gapped or low-latency local option. The internal MCP servers are where Redis serves the IDE agent as a vector and memory store without changing the model path. The gateway centralizes semantic caching so every developer benefits, rather than each editor caching alone.8

NFR considerations. Scalability: server-side components scale independently of the number of editors. Performance: local models and the Redis cache both cut latency. Security: air-gapped BYOK and content exclusion; private networking for the Azure path. Reliability: three model paths provide natural failover. Maintainability: paths are selected by configuration and policy.

Trade-offs. Local models trade quality and capability for latency, privacy and zero per-token cost. The gateway path trades a network hop for caching and governance.

Risks and mitigations. Risk: inconsistent model choice across a team inflates cost. Mitigation: pin the model tier in custom agents, set the utility-task model for cheap operations like commit messages, and govern providers with policy.2

Data Flow

Data Flow Diagram (governed path with semantic cache)

PAULA SILVASOFTWARE GLOBAL BLACK BELTIDE request data flowOnly the Custom Endpoint path runs through the semantic cache. Completions never enter this flow.IDE agent requestnon-completionModelpath?GitHub backendAI CreditsBYOK providerprovider billedAI Gateway (CustomEndpoint)EmbeddingRedis semantic cachelookupSimilarentry?Foundry Model RouterModelStore in RedisResponse to editordefaultBYOK directCustom EndpointyesnoPaula Silva | AI-Native Software Engineerlinkedin.com/in/paulanunes

Overview. A non-completion agent request follows the selected path. Only the Custom Endpoint path runs through the semantic cache and the Foundry Model Router. Code completions never enter this flow; they stay on the GitHub backend.

Key components and flow. The request, the path decision, the three model paths, and on the governed path the embedding, the Redis lookup, the hit decision, the router, the model, and the write-back. The IDE reports real token usage in the context window for BYOK models.2

Design decisions. Putting the cache and router behind the Custom Endpoint means the IDE experience is unchanged while the team gains caching, routing and policy. Semantic caching uses embeddings, so paraphrased prompts hit the same entry.8

NFR considerations. Performance: cache hits return fast and free. Security: the gateway enforces policy and the cache respects access controls. Reliability: a miss degrades to the model; an unreachable gateway falls back to default or BYOK direct. Maintainability: the cache and router evolve without touching editors.

Risks and mitigations. Risk: stale cache answers in an interactive session. Mitigation: tune the similarity threshold and TTL; do not cache user-specific final edits, only reusable sub-results.

Key Workflows

Sequence Diagram: an Agent Mode task with MCP and gateway

PAULA SILVASOFTWARE GLOBAL BLACK BELTKey workflow: IDE Agent Mode taskLocal context and memory, MCP grounding, governed inference with a cache short-circuit.ALTCache hitelse Cache missDeveloperIDE Agent ModeLocal memory +instructionsMCP tool(Redis-backed)AI Gateway (CustomEndpoint)Redis semanticcacheFoundry modelPrompt a task in Agent ModeLoad instructions, agent, memoryGather workspace and editor contextCall tool for internal knowledgeVector lookup or memory readGrounded contextInference via Custom EndpointSemantic cache checkCached responseRoute and inferCompletionStore responseResultPropose edits, run testsReview and accept inlinePaula Silva | AI-Native Software Engineerlinkedin.com/in/paulanunes

Overview. The interactive task: the agent loads local context and memory, grounds itself through a Redis-backed MCP tool, runs inference through the governed gateway with a cache short-circuit, proposes edits locally, and the developer reviews inline.

Design decisions and NFRs. Memory, instructions and MCP grounding happen before inference to cut tokens. The developer stays in the loop, which is the safety control for IDE agents. Performance benefits from both the MCP-side and gateway-side caches.

Risks and mitigations. Risk: the agent runs many tool and model calls in a tight loop. Mitigation: scoped context, reasoning-effort control in the model picker, and a per-task token budget from the validation gate.2

Memory, Governance and Economy for IDE agents

Memory. IDE Agent Mode primarily uses the local memory tool, which stores notes as local files in two scopes: a global scope whose first lines load into context at the start of every session, and a workspace scope that persists across conversations but applies only in that project. This is distinct from the GitHub-hosted Copilot Memory used by the cloud agent, code review and CLI. A Redis-backed MCP memory server is the option when you want shared, server-side agent memory in the IDE.6

Governance. Organization policy controls whether BYOK is allowed in VS Code (the "Bring Your Own Language Model Key in VS Code" policy), which models and providers are available, and editor preview features. Content exclusion limits what the agent can read. Custom agents, instructions and prompts are version-controlled in the repository and published only from the internal catalog. MCP servers are allowlisted per repository and workspace.13

Economy. The IDE adds levers the cloud agent does not have. BYOK shifts heavy workloads off GitHub AI Credits onto direct provider billing, which can be cheaper at volume. Local models through Foundry Local or Ollama cost nothing per token. The model picker exposes a reasoning-effort control to balance quality, latency and cost, and a separate utility-task model setting routes cheap operations like commit-message generation to a lightweight model. Completions stay free on the GitHub backend.24

Phased Development

Phase 1: IDE MVP (default, no Azure infrastructure)

PAULA SILVASOFTWARE GLOBAL BLACK BELTIDE Phase 1 MVP: default, no Azure infrastructureDefault Copilot models with the picker, primitives, local memory and local MCP.DeveloperRepo and editor configcopilot-instructions, AGENTS.md, instructions,prompts, custom agentsIDE Agent ModeModel picker and AutoLocal memory toolLocal MCP toolsOrg policy and content exclusiongoverns models, providers, accesspromptsconfiguresselectsusescallsgovernsPaula Silva | AI-Native Software Engineerlinkedin.com/in/paulanunes

Approach. Ships immediately. Default Copilot models with Auto and the model picker, the file-based primitives, the local memory tool, local MCP tools, and governance through organization policy and content exclusion. Cost levers: pick a cheaper model per task, use the reasoning-effort control, set the utility-task model, and keep output terse.

Phase 2: IDE enterprise (Redis and Foundry)

Adds. BYOK with a Custom Endpoint pointing at an API Management AI Gateway that fronts the Foundry Model Router and an Azure Managed Redis semantic cache; internal MCP servers backed by Redis as a vector and memory store; Foundry Local for air-gapped or low-latency local inference. Air-gapped BYOK supports isolated environments.2

Migration path

  1. Keep Phase 1 as the fallback.
  2. Enable the organization BYOK policy for the teams that need it.
  3. Stand up the AI Gateway, Foundry Model Router and Azure Managed Redis (reuse the Phase 2 Azure plane from the cloud-agent architecture).
  4. Configure a Custom Endpoint in the IDE that points at the gateway; pin it in custom agents.
  5. Stand up internal MCP servers backed by Redis for retrieval and shared memory.
  6. Measure token usage with the IDE context-window reporting and the validation-gate budgets before broad rollout.

References


Paula Silva AI-Native Software Engineer, Microsoft linkedin.com/in/paulanunes


  1. Bring your own language model key in VS Code now available (GitHub Changelog, Apr 2026) 

  2. GitHub Copilot in VS Code, May releases (GitHub Changelog, Jun 2026) 

  3. AI language models in VS Code (VS Code Docs) 

  4. Expanding Model Choice in VS Code with Bring Your Own Key (VS Code Blog) 

  5. Using OpenAI Models in VS Code with GitHub Copilot BYOK (Ben Abt) 

  6. Memory in VS Code agents (VS Code Docs) 

  7. Azure Managed Redis for AI Agents (ITNext) 

  8. Accelerate AI Applications with Semantic Caching on Azure Managed Redis (Microsoft DevBlogs) 

  9. Improving agent quality to optimize AI usage (GitHub Docs) 

Paula Silva
AI-Native Software Engineer, Microsoft
linkedin.com/in/paulanunes
Agentic DevOps Hub
PDF
ENESPT