How suwtyunwei/weftrix works
Weftrix is a self-hosted agent platform: users work in a Vue workspace, send chat or agent requests through the FastAPI backend, and receive streamed answers, tool activity, and deliverable files. The backend adapts requests to the DSH SDK runtime or its local fallback, with optional knowledge retrieval and team coordination. Separate product branches provide identity and permissions, scheduling, skills/plugins/MCP, model and preset administration, and audit/traceability. Edges use README statements or the shown source references; several subsystem internals were not sampled, so their detailed call paths are omitted.
Main entry points: run_manager.py Run Manager · dsh_runtime.py DSH Runtime Adapter · database.py Application Database · scheduled_tasks.py Task Scheduler
Components 26
User Workspace
- Vue Workspace
frontend/src/views/chat/ChatView.vue - Chat API
backend/app/api/chat.py - Session API
backend/app/api/sessions.py - Workspace Files
backend/app/core/workspace_tools.py
Agent Execution
- Run Manager
backend/app/core/run_manager.py - DSH Runtime Adapter
backend/app/core/dsh_runtime.py - Local Runtime
backend/app/core/local_runtime.py - Team Orchestrator
backend/app/core/agent_team.py - Model Routing
backend/app/core/model_router.py
Platform Capabilities
- Knowledge APIs
backend/app/api/kb.py - Knowledge Retrieval
backend/app/core/knowledge_base.py - Weaviate Store
backend/app/core/weaviate_store.py - Skills And Plugins
backend/app/core/plugins.py - MCP Integration
backend/app/core/mcp_bridge.py - Platform MCP Server
backend/app/mcp_server/platform_server.py - Task Scheduler
backend/app/core/scheduled_tasks.py - Schedule API
backend/app/api/scheduled_tasks.py
Identity And Governance
- Authentication API
backend/app/api/auth.py - Token Security
backend/app/core/security.py - RBAC Enforcement
backend/app/core/rbac.py - Audit Logging
backend/app/core/audit.py - Run Traces
backend/app/core/trajectory.py - Long-Term Memory
backend/app/core/memory_service.py
Platform State
- Application Database
backend/app/database.py - Domain Models
backend/app/models.py
Other components
- Platform User
Connections 26
- Platform User → Vue Workspace: uses
- Vue Workspace → Chat API: sends requests
- Chat API → Run Manager: starts runs
- Run Manager → DSH Runtime Adapter: dispatches runs
backend/app/core/run_manager.py - Run Manager → Local Runtime: fallback runs
backend/app/core/run_manager.py - Run Manager → Team Orchestrator: coordinates teams
backend/app/core/run_manager.py - Run Manager → Knowledge Retrieval: prefetches retrieval
backend/app/core/run_manager.py - Run Manager → Run Traces: records events
backend/app/core/run_manager.py - Run Manager → Workspace Files: delivers files
- DSH Runtime Adapter → MCP Integration: bridges tools
backend/app/core/dsh_runtime.py - DSH Runtime Adapter → Local Runtime: falls back
backend/app/core/dsh_runtime.py - Model Routing → DSH Runtime Adapter: supplies model
- Knowledge APIs → Knowledge Retrieval: manages knowledge
- Knowledge Retrieval → Weaviate Store: stores vectors
- DSH Runtime Adapter → Skills And Plugins: loads capabilities
backend/app/core/dsh_runtime.py - DSH Runtime Adapter → Platform MCP Server: exposes platform tools
- Schedule API → Task Scheduler: manages schedules
backend/app/api/scheduled_tasks.py - Task Scheduler → Run Manager: executes tasks
backend/app/core/scheduled_tasks.py - Authentication API → Token Security: issues identity
backend/app/api/auth.py - Token Security → RBAC Enforcement: resolves permissions
backend/app/core/security.py - RBAC Enforcement → Application Database: loads roles
backend/app/core/rbac.py - Audit Logging → Application Database: persists records
backend/app/core/audit.py - Long-Term Memory → Application Database: persists memory
backend/app/core/memory_service.py - Application Database → Domain Models: uses mappings
backend/app/database.py - Task Scheduler → Application Database: reads and writes
backend/app/core/scheduled_tasks.py - Session API → Application Database: manages sessions