How dasrohit15/safespace works
SafeSpace is a mental-health chat application: a user submits a message through Streamlit, FastAPI passes it to a LangGraph agent, and the backend returns the agent’s response and reported tool name for display. The agent offers therapeutic guidance through Ollama/MedGemma, a hard-coded nearby-therapist response, and an emergency-call tool using Twilio. The README is empty, and the tree does not include the imported config module, so those details are not mapped. Edges reflect the provided excerpts; unsampled integrations are omitted.
Main entry points: ai_agent.py Agent runtime · main.py Ask API · frontend.py Chat UI · tools.py MedGemma client
Components 12
Chat interface
- Chat UI
frontend.py
API backend
- Ask API
main.py
Agent and tools
- Agent runtime
ai_agent.py - Therapeutic guidance
ai_agent.py - Emergency call tool
ai_agent.py - Therapist finder
ai_agent.py - MedGemma client
tools.py - Twilio client
tools.py
External services
- OpenRouter API
- Ollama service
- Twilio service
Other components
- User
Connections 13
- User → Chat UI: enters message
frontend.py - Chat UI → Ask API: POSTs message
frontend.py - Ask API → Agent runtime: streams request
main.py - Agent runtime → Ask API: parses stream
main.py - Ask API → Chat UI: returns response
main.py - Agent runtime → Therapeutic guidance: registers tool
ai_agent.py - Agent runtime → Emergency call tool: registers tool
ai_agent.py - Agent runtime → Therapist finder: registers tool
ai_agent.py - Agent runtime → OpenRouter API: configures model
ai_agent.py - Therapeutic guidance → MedGemma client: calls
ai_agent.py - MedGemma client → Ollama service: requests completion
tools.py - Emergency call tool → Twilio client: calls
ai_agent.py - Twilio client → Twilio service: places call
tools.py