# zmy15/deepseek-for-visualstudio architecture

> Architecture diagram of the GitHub repository zmy15/deepseek-for-visualstudio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zmy15/deepseek-for-visualstudio
- Repository: https://github.com/zmy15/deepseek-for-visualstudio

## Overview

DeepSeek for Visual Studio is an IDE-native AI coding assistant. The main workflow starts in the chat panel, builds conversation context, routes work through cooperating agents and tools, calls a configured model provider, and presents results or reviewed code changes in Visual Studio. Separate branches support inline editing and Ghost Text completion. The README documents broader MCP, Skills, memory, multimodal, search, and build capabilities; links for these are shown at subsystem level where source excerpts do not establish finer wiring.

Main entry points: [`Services/Agents/AgentFactory.cs`](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/Agents/AgentFactory.cs) (Agent orchestration), [`View/DeepSeekChatControl.xaml.cs`](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/View/DeepSeekChatControl.xaml.cs) (Chat panel), [`Services/DeepSeekApiService.cs`](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/DeepSeekApiService.cs) (Chat API service), [`Services/BuiltInTools`](https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/BuiltInTools) (IDE tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ide["IDE interaction"]
  node_chat["Chat panel"]
  node_commands["IDE commands"]
  node_inlinecmd["Inline edit command"]
  node_completion["Ghost Text completion"]
end

subgraph group_agents["Agent workflow"]
  node_agents["Agent orchestration<br/>[AgentFactory.cs]"]
  node_agentroles["Ask / Explore / Plan / Edit / Build"]
  node_toolservice["Tool dispatch"]
end

subgraph group_editing["Context and edits"]
  node_context["Conversation context"]
  node_compressor["Context compression"]
  node_inlineedit["Inline rewrite"]
  node_editpatch["Patch and edit services"]
  node_diff["Diff review"]
end

subgraph group_integrations["Models and tools"]
  node_api["Chat API service"]
  node_providers["Model providers"]
  node_tools["IDE tools"]
  node_parser["File and multimodal parsing"]
  node_mcp["MCP servers"]
  node_search["Web search"]
  node_rag["RAG retrieval<br/>[RagService.cs]"]
end

subgraph group_state["Persistence and settings"]
  node_memory["Project memory<br/>[MemoryService.cs]"]
  node_skills["Reusable Skills<br/>[SkillService.cs]"]
  node_persistence["Chat persistence"]
  node_settings["Settings and API keys"]
end

node_developer(("Developer"))
node_modelservice(("Model endpoint"))
node_solution(("Solution and terminal"))

node_developer -->|"sends prompts"| node_chat
node_developer -->|"opens chat"| node_commands
node_developer -->|"requests edit"| node_inlinecmd
node_chat -->|"records conversation"| node_context
node_chat -->|"dispatches task"| node_agents
node_agents -->|"selects agent"| node_agentroles
node_agents -->|"uses context"| node_context
node_agents -->|"dispatches tools"| node_toolservice
node_toolservice -->|"runs tools"| node_tools
node_tools -->|"inspects or changes"| node_solution
node_context -->|"compresses history"| node_compressor
node_agents -->|"requests completion"| node_api
node_completion -->|"requests prediction"| node_api
node_inlinecmd -->|"requests rewrite"| node_inlineedit
node_inlineedit -->|"requests completion"| node_api
node_agentroles -->|"applies edits"| node_editpatch
node_editpatch -->|"previews changes"| node_diff
node_diff -->|"presents review"| node_developer
node_api -->|"uses provider"| node_providers
node_providers -->|"sends requests"| node_modelservice
node_settings -->|"configures access"| node_api
node_chat -->|"saves sessions"| node_persistence
node_context -->|"injects notes"| node_memory
node_chat -->|"routes skill requests"| node_skills
node_tools -->|"parses files"| node_parser
node_tools -->|"searches web"| node_search
node_agents -.->|"retrieves context"| node_rag
node_toolservice -.->|"dispatches MCP tools"| node_mcp

click node_chat "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/View/DeepSeekChatControl.xaml.cs"
click node_commands "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Commands/ShowChatWindowCommand.cs"
click node_inlinecmd "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Commands/InlineAiEditCommand.cs"
click node_completion "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/CodeCompletion/InlinePredictionManager.cs"
click node_agents "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/Agents/AgentFactory.cs"
click node_agentroles "https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/Agents"
click node_toolservice "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/BuiltInToolService.cs"
click node_context "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ConversationContextManager.cs"
click node_compressor "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ContextCompressorService.cs"
click node_inlineedit "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/InlineEdit/InlineEditService.cs"
click node_editpatch "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/EditPatchService.cs"
click node_diff "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/DiffViewerService.cs"
click node_api "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/DeepSeekApiService.cs"
click node_providers "https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/Providers"
click node_tools "https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/BuiltInTools"
click node_parser "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/FileParserService.cs"
click node_mcp "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/McpManagerService.cs"
click node_search "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/WebSearchService.cs"
click node_rag "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/RagService.cs"
click node_memory "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/MemoryService.cs"
click node_skills "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/SkillService.cs"
click node_persistence "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ChatPersistenceService.cs"
click node_settings "https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Settings/DeepSeekUnifiedSettings.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chat,node_commands,node_inlinecmd,node_completion toneBlue
class node_agents,node_agentroles,node_toolservice toneAmber
class node_context,node_compressor,node_inlineedit,node_editpatch,node_diff toneMint
class node_api,node_providers,node_tools,node_parser,node_mcp,node_search,node_rag toneRose
class node_memory,node_skills,node_persistence,node_settings,node_developer,node_modelservice,node_solution toneIndigo
```

## Components

### IDE interaction

- [Chat panel](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/View/DeepSeekChatControl.xaml.cs): `View/DeepSeekChatControl.xaml.cs`
- [IDE commands](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Commands/ShowChatWindowCommand.cs): `Commands/ShowChatWindowCommand.cs`
- [Inline edit command](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Commands/InlineAiEditCommand.cs): `Commands/InlineAiEditCommand.cs`
- [Ghost Text completion](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/CodeCompletion/InlinePredictionManager.cs): `CodeCompletion/InlinePredictionManager.cs`

### Agent workflow

- [Agent orchestration](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/Agents/AgentFactory.cs): `Services/Agents/AgentFactory.cs`
- [Ask / Explore / Plan / Edit / Build](https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/Agents): `Services/Agents`
- [Tool dispatch](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/BuiltInToolService.cs): `Services/BuiltInToolService.cs`

### Context and edits

- [Conversation context](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ConversationContextManager.cs): `Services/ConversationContextManager.cs`
- [Context compression](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ContextCompressorService.cs): `Services/ContextCompressorService.cs`
- [Inline rewrite](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/InlineEdit/InlineEditService.cs): `Services/InlineEdit/InlineEditService.cs`
- [Patch and edit services](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/EditPatchService.cs): `Services/EditPatchService.cs`
- [Diff review](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/DiffViewerService.cs): `Services/DiffViewerService.cs`

### Models and tools

- [Chat API service](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/DeepSeekApiService.cs): `Services/DeepSeekApiService.cs`
- [Model providers](https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/Providers): `Services/Providers`
- [IDE tools](https://github.com/zmy15/deepseek-for-visualstudio/tree/master/Services/BuiltInTools): `Services/BuiltInTools`
- [File and multimodal parsing](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/FileParserService.cs): `Services/FileParserService.cs`
- [MCP servers](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/McpManagerService.cs): `Services/McpManagerService.cs`
- [Web search](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/WebSearchService.cs): `Services/WebSearchService.cs`
- [RAG retrieval](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/RagService.cs): `Services/RagService.cs`

### Persistence and settings

- [Project memory](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/MemoryService.cs): `Services/MemoryService.cs`
- [Reusable Skills](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/SkillService.cs): `Services/SkillService.cs`
- [Chat persistence](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Services/ChatPersistenceService.cs): `Services/ChatPersistenceService.cs`
- [Settings and API keys](https://github.com/zmy15/deepseek-for-visualstudio/blob/master/Settings/DeepSeekUnifiedSettings.cs): `Settings/DeepSeekUnifiedSettings.cs`

### Other components

- **Developer**
- **Model endpoint**
- **Solution and terminal**

## Connections

- Developer → Chat panel: sends prompts
- Developer → IDE commands: opens chat
- Developer → Inline edit command: requests edit
- Chat panel → Conversation context: records conversation
- Chat panel → Agent orchestration: dispatches task
- Agent orchestration → Ask / Explore / Plan / Edit / Build: selects agent
- Agent orchestration → Conversation context: uses context
- Agent orchestration → Tool dispatch: dispatches tools
- Tool dispatch → IDE tools: runs tools
- IDE tools → Solution and terminal: inspects or changes
- Conversation context → Context compression: compresses history
- Agent orchestration → Chat API service: requests completion
- Ghost Text completion → Chat API service: requests prediction
- Inline edit command → Inline rewrite: requests rewrite
- Inline rewrite → Chat API service: requests completion
- Ask / Explore / Plan / Edit / Build → Patch and edit services: applies edits
- Patch and edit services → Diff review: previews changes
- Diff review → Developer: presents review
- Chat API service → Model providers: uses provider
- Model providers → Model endpoint: sends requests
- Settings and API keys → Chat API service: configures access
- Chat panel → Chat persistence: saves sessions
- Conversation context → Project memory: injects notes
- Chat panel → Reusable Skills: routes skill requests
- IDE tools → File and multimodal parsing: parses files
- IDE tools → Web search: searches web
- Agent orchestration → RAG retrieval: retrieves context
- Tool dispatch → MCP servers: dispatches MCP tools
