How mssnzxm/deer-flow2 works
DeerFlow is a super-agent harness: users submit work through the web app, API, or messaging channels; runs orchestrate an agent and its tools, then stream results and retain state. The map preserves documented skills, subagents, memory, sandboxing, scheduling, and integrations. Some subsystems are present in the tree but unsampled; their links are omitted or marked unverified rather than inferred from names.
Main entry points: agent.py Lead Agent · app.py API Gateway · services.py Run Services · manager.py Run Lifecycle
Components 21
User Interfaces
- Web App
frontend/src/app/page.tsx - Python Client
backend/packages/harness/deerflow/client.py - Terminal Workbench
backend/packages/harness/deerflow/tui/app.py
Gateway and Channels
- API Gateway
backend/app/gateway/app.py - Authentication
backend/app/gateway/auth_disabled.py - Run Services
backend/app/gateway/services.py - Messaging Channels
backend/app/channels/service.py - Channel Dispatch
backend/app/channels/manager.py
Agent Execution
- Lead Agent
backend/packages/harness/deerflow/agents/lead_agent/agent.py - Subagents
backend/packages/harness/deerflow/subagents/executor.py
Agent Capabilities
- Skills and Tools
backend/packages/harness/deerflow/skills/storage/skill_storage.py - Sandbox
backend/packages/harness/deerflow/sandbox/sandbox.py - Long-Term Memory
backend/packages/harness/deerflow/agents/memory/manager.py - Search Integrations
backend/packages/harness/deerflow/community/infoquest/tools.py - File Uploads
backend/packages/harness/deerflow/uploads/manager.py
State and Scheduling
- Run Lifecycle
backend/packages/harness/deerflow/runtime/runs/manager.py - Run Store
backend/packages/harness/deerflow/runtime/runs/store/base.py - SQL Persistence
backend/packages/harness/deerflow/persistence/engine.py - User Context
backend/packages/harness/deerflow/runtime/user_context.py - Scheduled Tasks
backend/app/scheduler/service.py
Other components
- User
Connections 20
- User → Web App: uses
README.md - Web App → API Gateway: calls API
- Python Client → API Gateway: calls API
- API Gateway → Authentication: configures auth
backend/app/gateway/app.py - API Gateway → Run Services: mounts routes
backend/app/gateway/app.py - Run Services → Lead Agent: invokes
backend/app/gateway/services.py - Run Services → Run Lifecycle: manages runs
- Run Lifecycle → Run Store: uses store
backend/packages/harness/deerflow/runtime/runs/manager.py - Messaging Channels → Channel Dispatch: starts manager
backend/app/channels/service.py - Channel Dispatch → Run Services: submits messages
- Lead Agent → Subagents: delegates
- Lead Agent → Skills and Tools: uses skills
- Lead Agent → Sandbox: executes safely
- Lead Agent → Long-Term Memory: uses memory
- Lead Agent → Search Integrations: searches
- Run Services → File Uploads: handles uploads
- Run Lifecycle → User Context: resolves identity
backend/packages/harness/deerflow/runtime/runs/manager.py - API Gateway → SQL Persistence: initializes storage
backend/app/gateway/app.py - Scheduled Tasks → Run Lifecycle: starts runs
- User → Terminal Workbench: uses
README.md