How phessophissy/deer-flow works
DeerFlow is a super-agent harness exposed through a web API and workspace. Users submit requests through the frontend or connected messaging channels; the Gateway manages runs, whose harness can use models, sub-agents, tools, memory, skills, and sandboxes, then returns results. The graph preserves documented capabilities and the sampled Gateway, run, channel, storage, and configuration layers. Several feature implementations were not sampled, so those subsystem paths and links are limited to what the tree or README supports.
Main entry points: agent.py Agent Harness · app.py API Gateway · manager.py Run Manager · skill_storage.py Extensible Skills
Components 22
User Access
- Web Workspace
frontend/src/app - API Gateway
backend/app/gateway/app.py - Authentication
backend/app/gateway/auth_disabled.py - Messaging Channels
backend/app/channels/service.py
Agent Execution
- Run Services
backend/app/gateway/services.py - Run Manager
backend/packages/harness/deerflow/runtime/runs/manager.py - Agent Harness
backend/packages/harness/deerflow/agents/lead_agent/agent.py - Message Dispatch
backend/app/channels/manager.py - Scheduled Tasks
backend/app/scheduler/service.py
Agent Capabilities
- Extensible Skills
backend/packages/harness/deerflow/skills/storage/skill_storage.py - Sub-agents
backend/packages/harness/deerflow/agents - Long-term Memory
backend/packages/harness/deerflow/agents/memory/manager.py - Sandbox Tools
backend/packages/harness/deerflow/sandbox/sandbox.py - MCP Tools
backend/packages/harness/deerflow/mcp/tools.py - Model Providers
backend/packages/harness/deerflow/models/factory.py
State and Persistence
- Skill Files
backend/packages/harness/deerflow/skills/storage/user_scoped_skill_storage.py - Application Database
backend/packages/harness/deerflow/persistence/engine.py - Runtime Configuration
backend/packages/harness/deerflow/config/app_config.py - Runtime Paths
backend/packages/harness/deerflow/config/paths.py
Other components
- User
- Messaging Platforms
- Model APIs
Connections 23
- User → Web Workspace: submits requests
README.md - Web Workspace → API Gateway: calls API
README.md - API Gateway → Authentication: authenticates
backend/app/gateway/app.py - API Gateway → Run Services: routes requests
backend/app/gateway/app.py - Run Services → Run Manager: manages runs
backend/app/gateway/services.py - Run Manager → Agent Harness: runs agent
- Agent Harness → Extensible Skills: uses skills
README.md - Agent Harness → Sub-agents: delegates work
README.md - Agent Harness → Long-term Memory: uses memory
README.md - Agent Harness → Sandbox Tools: executes tools
README.md - Agent Harness → MCP Tools: uses tools
README.md - Agent Harness → Model Providers: queries models
README.md - Model Providers → Model APIs: sends prompts
README.md - Extensible Skills → Skill Files: reads and writes
backend/packages/harness/deerflow/skills/storage/user_scoped_skill_storage.py - API Gateway → Messaging Channels: starts service
backend/app/gateway/app.py - Messaging Channels → Message Dispatch: dispatches messages
backend/app/channels/service.py - Messaging Platforms → Messaging Channels: sends messages
README.md - Message Dispatch → Run Manager: launches runs
backend/app/channels/manager.py - Scheduled Tasks → Run Manager: launches scheduled runs
backend/app/scheduler/service.py - API Gateway → Application Database: initializes storage
backend/app/gateway/app.py - Application Database → Runtime Configuration: reads database settings
backend/packages/harness/deerflow/persistence/engine.py - Extensible Skills → Runtime Paths: resolves skill paths
backend/packages/harness/deerflow/skills/storage/user_scoped_skill_storage.py - Runtime Configuration → Runtime Paths: configures directories