How iwindy/cherry-studio works
Cherry Studio is a cross-platform AI desktop client. Its principal workflow is selecting an assistant or model, sending a conversation turn, and receiving a response from a cloud or local provider. The repository also supports knowledge-base ingestion and search, MCP tools, resource management, and document-oriented UI features. The excerpts show details for knowledge processing and AI-provider/plugin internals; many application-level links are not sampled, so those are marked unverified rather than treated as observed calls.
Main entry points: runtime AI runtime · pluginEngine.ts Plugin engine · useConversationTurnController.ts Conversation turn · createAgent.ts Agent core
Components 19
Conversations and AI
- Conversation turn
src/renderer/hooks/useConversationTurnController.ts - AI runtime
src/main/ai/runtime - Agent core
packages/aiCore/src/core/agents/createAgent.ts - Plugin engine
packages/aiCore/src/core/runtime/pluginEngine.ts - Plugin manager
packages/aiCore/src/core/plugins/manager.ts
Knowledge management
- Document ingestion
src/main/features/knowledge/ingestion/KnowledgeIngestionService.ts - Knowledge file storage
src/main/features/knowledge/pathStorage.ts - Knowledge search
src/main/features/knowledge/query/KnowledgeQueryService.ts - Knowledge index
src/main/features/knowledge/pipeline/vectorstore
Providers and integrations
- Provider registry
packages/provider-registry/src/registry-loader.ts - Provider extensions
packages/aiCore/src/core/providers/core/ExtensionRegistry.ts - Local models
src/main/ai/localModel - MCP servers
src/main/ai/runtime/agentMcpServers.ts - Remote protocol
packages/remote-protocol/src/connection.ts
Desktop experience
- Resource catalog
src/renderer/hooks/resourceCatalog/useResourceCatalogController.ts - Conversation history
src/renderer/components/history/useHistoryRecordsController.ts - Markdown rendering
packages/ui/src/components/composites/markdown/markdown.tsx - File management
src/main/services/FileStorage.ts
Other components
- Desktop user
Connections 18
- Desktop user → Conversation turn: sends turn
- Conversation turn → AI runtime: requests response
- AI runtime → Agent core: runs agent
- Agent core → Plugin engine: uses runtime
- Plugin engine → Plugin manager: executes hooks
packages/aiCore/src/core/runtime/pluginEngine.ts - Plugin engine → Provider extensions: resolves model
- Provider extensions → Provider registry: uses catalog
- AI runtime → Local models: supports local models
- AI runtime → MCP servers: uses MCP tools
src/main/ai/runtime/claudeCode/ClaudeCodeWarmQueryManager.ts - Desktop user → Document ingestion: adds documents
- Document ingestion → Knowledge file storage: copies and checks files
src/main/features/knowledge/ingestion/KnowledgeIngestionService.ts - Desktop user → Knowledge search: searches knowledge
- Knowledge search → Knowledge index: queries index
src/main/features/knowledge/query/KnowledgeQueryService.ts - Desktop user → Resource catalog: manages resources
- Desktop user → Conversation history: reviews conversations
- AI runtime → Markdown rendering: renders response
- Desktop user → File management: manages files
- AI runtime → Remote protocol: supports remote access