How ghhghhghh/autochat works
AutoChat is a desktop customer-service workspace combining a Vue interface, Electron-embedded shop browsers, and a Python API/automation backend. The main workflow is platform selection and login, followed by per-platform message polling, customer-memory lookup, reply generation, and automatic or human-approved sending. The README documents model, platform, script, browser-query, and real-time-event capabilities. Several of those implementation details are unsampled, so their links are documented at subsystem level; only evidenced calls are drawn as solid edges.
Main entry points: agent_service.py Agent orchestrator · main.py FastAPI app · agent_controller.py Agent controller · platform.ts Platform state
Components 30
Desktop shell
- Electron main
electron/main.ts - Shop BrowserViews
electron/browser-view-manager.ts - IPC handlers
electron/ipc-handlers.ts - Python process
electron/python-manager.ts
Workspace UI
- Vue workspace
src/App.vue - Platform management
src/views/platforms/Platforms.vue - Platform state
src/stores/platform.ts - Model settings
src/views/settings/Settings.vue - Script manager
src/views/scripts/ScriptManager.vue - Browser controls
src/components/BrowserToolbar.vue - Frontend API
src/api/index.ts
API and configuration
- FastAPI app
python_backend/main.py - Platform service
python_backend/controllers/platform_controller.py - Model service
python_backend/controllers/model_controller.py - Script service
python_backend/controllers/script_controller.py - SQLite configuration
python_backend/models/database.py - Script executor
python_backend/services/script_runner.py
Reply automation
- Agent orchestrator
python_backend/agent/agent_service.py - Message detector
python_backend/agent/message_detector.py - Chat agent
python_backend/agent/chat_agent.py - Browser tools
python_backend/agent/browser_tools.py - Playwright client
python_backend/mcp/playwright_client.py - Customer memory
python_backend/services/memory_service.py - MCP tools
python_backend/mcp_server/tools.py - Agent controller
python_backend/controllers/agent_controller.py - Agent routes
python_backend/views/agent_view.py - Live events
python_backend/views/websocket_view.py
Other components
- Operator
- E-commerce sites
- Model provider
Connections 36
- Operator → Vue workspace: uses
- Vue workspace → Platform state: loads platforms
src/App.vue - Platform management → Platform state: manages platforms
src/views/platforms/Platforms.vue - Platform state → Frontend API: requests data
src/stores/platform.ts - Platform state → IPC handlers: switches browser
src/stores/platform.ts - Browser controls → IPC handlers: controls browser
- IPC handlers → Shop BrowserViews: dispatches controls
- Electron main → Python process: starts backend
electron/main.ts - Python process → FastAPI app: launches
electron/python-manager.ts - Shop BrowserViews → E-commerce sites: embeds sessions
- Frontend API → FastAPI app: HTTP requests
- Model settings → Frontend API: configures models
- Script manager → Frontend API: manages scripts
- FastAPI app → SQLite configuration: initializes
python_backend/main.py - FastAPI app → Platform service: registers routes
python_backend/main.py - FastAPI app → Model service: registers routes
python_backend/main.py - FastAPI app → Script service: registers routes
python_backend/main.py - FastAPI app → Agent routes: registers routes
python_backend/main.py - FastAPI app → Agent orchestrator: initializes
python_backend/main.py - Platform service → SQLite configuration: reads and writes
python_backend/controllers/platform_controller.py - Model service → SQLite configuration: reads and writes
python_backend/controllers/model_controller.py - Script service → SQLite configuration: reads and writes
python_backend/controllers/script_controller.py - Script service → Script executor: runs scripts
python_backend/controllers/script_controller.py - Agent routes → Agent controller: routes requests
- Agent controller → Model service: gets default model
python_backend/controllers/agent_controller.py - Agent controller → MCP tools: sends replies
python_backend/controllers/agent_controller.py - Agent controller → Live events: pushes preview
python_backend/controllers/agent_controller.py - Agent orchestrator → Playwright client: starts client
python_backend/agent/agent_service.py - Agent orchestrator → Customer memory: initializes memory
python_backend/agent/agent_service.py - Agent orchestrator → Message detector: polls messages
python_backend/agent/agent_service.py - Agent orchestrator → Chat agent: requests replies
python_backend/agent/agent_service.py - Chat agent → Browser tools: uses tools
python_backend/agent/chat_agent.py - Agent orchestrator → E-commerce sites: automates conversations
- Agent orchestrator → Customer memory: retrieves and saves
python_backend/agent/agent_service.py - Chat agent → Model provider: generates replies
- Agent orchestrator → Live events: publishes events