How pranjalchirmade09326-hash/mindspace works
MindSpace is a mental-wellbeing and peer-support platform with five role workspaces. A member uses wellbeing tools or a voice companion; deterministic crisis screening precedes AI processing, and AI operations go through authenticated REST APIs rather than direct database access. The platform also supports peer matching, listener supervision, safety operations, and clinical-record services. The graph reflects README-documented capabilities and the sampled entry points; many routes and service internals were not sampled, so uncertain connections are omitted or dashed.
Main entry points: frontend Role Workspaces · orchestrator.py Agent Orchestrator · app/main.py Core Health API · src/main.py Agent Service
Components 23
Web and Identity
- Role Workspaces
frontend - Workflow API
frontend/src/app/api/workflow - Identity Service
backend/mindspace-iam-py/app/main.py
Wellbeing Agents
- Agent Service
agents/src/main.py - Agent Orchestrator
agents/src/orchestrator.py - Crisis Sentinel
agents/src/nodes/safety_sentinel.py - Wellbeing Intake
agents/src/nodes/intake_agent.py - AI Companion
agents/src/nodes/companion_agent.py - LLM Gateway
agents/src/nodes/llm_client.py - Voice Service
agents/src/nodes/voice_service.py
MindSpace Core
- Core Health API
backend/mindspace-fastapi/app/main.py - Peer and Safety Operations
backend/mindspace-fastapi/app/services/operations_service.py - Conversation WebSockets
backend/mindspace-fastapi/app/core/websocket_manager.py
FHIR Services
- FHIR GraphQL and REST
backend/fhir-gql/app/main.py - FHIR Resource Routes
backend/fhir-gql/app/routers - FHIR Server
backend/fhir-server/app/main.py - Record Staging
backend/fhir-staging/app/main.py - FHIR MCP Service
backend/fhir-mcp/app/main.py
Persistence and Integrations
- Health PostgreSQL
backend/mindspace-fastapi/app/core/database.py - FHIR PostgreSQL
backend/fhir-server/app/core/database.py - Frontend PostgreSQL
frontend/prisma/db.ts
Other components
- Member
- Peer Listener
Connections 23
- Member → Role Workspaces: uses
- Role Workspaces → Workflow API: submits workflows
frontend/src/app/api/workflow/route.ts - Role Workspaces → Identity Service: authenticates
- Role Workspaces → Agent Service: requests wellbeing support
- Agent Service → Agent Orchestrator: dispatches
agents/src/main.py - Agent Orchestrator → Crisis Sentinel: screens first
- Agent Orchestrator → Wellbeing Intake: dispatches intake
- Agent Orchestrator → AI Companion: dispatches support
- AI Companion → LLM Gateway: requests completion
- Agent Service → Voice Service: serves voice
agents/src/main.py - Voice Service → Member: streams speech
- Role Workspaces → Core Health API: calls REST API
- Core Health API → Peer and Safety Operations: exposes operations
- Core Health API → Health PostgreSQL: initializes database
backend/mindspace-fastapi/app/main.py - Peer Listener → Role Workspaces: uses listener workspace
- Peer and Safety Operations → Health PostgreSQL: reads and writes
- Core Health API → Conversation WebSockets: supports live conversations
- FHIR GraphQL and REST → FHIR Resource Routes: mounts routes
backend/fhir-gql/app/main.py - FHIR GraphQL and REST → FHIR Server: uses FHIR services
- FHIR Server → FHIR PostgreSQL: connects database
backend/fhir-server/app/main.py - Record Staging → FHIR PostgreSQL: stores staged records
backend/fhir-staging/app/main.py - FHIR MCP Service → FHIR Server: connects to FHIR
- Role Workspaces → Frontend PostgreSQL: uses application data