Empowering hospitals, shelters, transport services, and social workers through Fetch.ai agents, Bright Data intelligence, and Vapi voice coordination.
calhacks12/
βββ frontend/ # Next.js Frontend
β βββ src/
β β βββ app/ # Next.js App Router
β β βββ components/ # React Components
β βββ public/ # Static Assets
β βββ package.json # Frontend Dependencies
β βββ next.config.mjs # Next.js Configuration
βββ backend/ # FastAPI Backend
β βββ main.py # FastAPI Application
β βββ agents.py # Fetch.ai Agents
β βββ requirements.txt # Python Dependencies
β βββ venv/ # Python Virtual Environment
βββ package.json # Root Package Management
βββ start-dev.sh # Development Startup Script
βββ README.md # This File
- Frontend: Next.js with TypeScript and Tailwind CSS
- Backend: FastAPI with Python
- AI Agents: Fetch.ai uAgents for coordination
- Voice AI: Vapi for voice communication
- Data Intelligence: Bright Data for real-time information
- Maps: Mapbox for interactive shelter mapping
- UI/UX: Framer Motion for smooth animations
Every day, hospitals discharge unhoused patients with nowhere safe to go. Manual coordination between hospitals, shelters, transport providers, and social workers is slow, fragmented, and error-prone.
π Studies show that over 50β70% of homeless patients in U.S. hospitals are discharged to unsafe or unstable environments without a clear care plan.
CareLink is a decentralized, voice-enabled coordination system that connects hospitals, shelters, transport services, and social workers through Fetch.ai agents, Bright Data, and Vapi voice calls.
It automates discharge planning, verifies real shelter availability, arranges transportation, and connects social workers β all through a human-centered, AI-assisted workflow.
Ensure every unhoused patient leaving a hospital has:
- A verified shelter placement
- A coordinated transport route
- A connected social worker for continuity of care
- Access to basic post-discharge needs like meals, clothing, and medication
All orchestrated seamlessly through voice, automation, and community data.
| Agent | Role | Port |
|---|---|---|
| π₯ HospitalAgent | Collects discharge details and starts coordination | 8001 |
| π§ CoordinatorAgent | Manages agent communication and Bright Data queries | 8002 |
| π ShelterAgent | Manages capacity info retrieved from Bright Data or voice calls | 8003 |
| π TransportAgent | Schedules transport and tracks progress | 8004 |
| π§βπ€βπ§ SocialWorkerAgent | Connects to follow-up care and approves placement | 8005 |
| β€οΈ FollowUpCareAgent | Conducts post-discharge check-ins via voice | 8006 |
| Agent | Role | Port |
|---|---|---|
| π ParserAgent | Parses discharge documents with LlamaParse + Gemini to autofill intake | 8011 |
| π₯£ ResourceAgent | Coordinates food, hygiene kits, and clothing post-discharge | 8007 |
| π PharmacyAgent | Ensures medication continuity via pharmacy coordination | 8008 |
| π§Ύ EligibilityAgent | Automates benefit verification (Medi-Cal, GA, SNAP) | 8009 |
| π AnalyticsAgent | Collects non-PII metrics for system optimization | 8010 |
Agent Network Architecture:
Parser β Hospital β Coordinator β [Shelter, Transport, SocialWorker, FollowUp]
β β β
[Resource, Pharmacy, Eligibility]
β
Analytics
Instead of relying on static or outdated lists, Bright Data continuously retrieves and refreshes real-world information such as:
- Live San Francisco shelter listings from HSH and other local sources
- Publicly available community resource databases (food banks, medical respite, outreach centers)
- Transport provider schedules (municipal and nonprofit)
Vapi powers the human interaction layer β ensuring accessibility for shelters and social workers who rely on phone communication.
- Shelter Availability Calls: Vapi contacts shelters automatically each evening
- Social Worker Outreach: Vapi calls social workers to confirm patient assignments
- Transport Coordination: Calls transport providers to schedule patient pickup/drop-off
- Follow-Up Calls: Conducts post-discharge voice check-ins with patients
- Node.js 18+
- Python 3.9+
- Git
-
Clone the repository
git clone <repository-url> cd calhacks12
-
Install dependencies
# Install frontend dependencies cd frontend && npm install && cd .. # Install backend dependencies cd backend && python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt && cd ..
-
Set up environment variables
cp backend/env.example backend/.env # Edit backend/.env with your API keys -
Start the development servers
# Use the startup script (recommended) ./start-dev.sh # OR start manually: # Terminal 1: cd frontend && npm run dev # Terminal 2: cd backend && source venv/bin/activate && python main.py
This will start:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Fetch.ai Agents: Ports 8001-8011 (11 agents)
- Framework: FastAPI 0.120.0, Uvicorn 0.30.6
- AI Agents: uAgents 0.22.10, cosmpy 0.9.3
- Document Parsing: llama-parse 0.5.17, google-generativeai 0.8.3
- HTTP/Async: requests 2.32.5, httpx 0.28.1, aiohttp 3.13.1
- Data: pydantic 2.8.2, pydantic-settings 2.6.1
- Database: SQLAlchemy 2.0.25, Alembic 1.13.1
- Testing: pytest 8.3.3, pytest-asyncio 0.24.0, pytest-cov 5.0.0
- Code Quality: black 25.1.0, ruff 0.10.2, mypy 1.15.0
- Framework: Next.js 14.2.5, React 18.3.1, TypeScript 5.8.2
- Maps: Mapbox GL 3.6.0, react-map-gl 7.1.7
- UI/Animation: Framer Motion 11.5.0, Lucide React 0.400.0
- Styling: Tailwind CSS 3.4.1, PostCSS 8.4.38, Autoprefixer 10.4.21
- Automatic form autofill from discharge documents
- LlamaParse integration for accurate document extraction
- Gemini AI for intelligent data structuring
- Confidence scoring for parsed data quality
- Manual review flagging for low-confidence results
- Real-time shelter mapping with Mapbox GL JS
- Dynamic markers showing shelter availability
- Interactive popups with detailed shelter information
- Live workflow tracking on the map
- Responsive design for all screen sizes
- Real-time agent status with live progress bars
- Animated workflow timeline showing step-by-step progress
- Agent communication logs with message history
- Visual indicators for agent states (idle, working, completed, error)
- Interactive agent selection to view detailed activity
- Smooth animations powered by Framer Motion
- Responsive design with Tailwind CSS
- Interactive components with hover effects
- Real-time updates without page refresh
- Accessible design following WCAG guidelines
| Layer | Technology | Purpose |
|---|---|---|
| AI Agents | Fetch.ai uAgents | Decentralized, autonomous coordination |
| Voice AI | Vapi | Voice communication with real-world entities |
| Data Intelligence | Bright Data | Live web data on shelters & resources |
| Backend | FastAPI + ngrok | Agent orchestration + Vapi webhook handling |
| Frontend | React + Tailwind + Framer Motion + React Leaflet | Interactive visualization |
| Data Source | San Francisco HSH + Bright Data | Real-world sample environment |
- Patient info form (medical condition, accessibility, dietary needs, social needs)
- Option to attach files (medications, discharge summary)
- "Start Coordination" triggers Fetch.ai agents
- Stepwise vertical animation: Discharge β Shelter Matching β Social Worker β Transport β Follow-Up
- Status chips ("In Progress", "Confirmed", "Awaiting Voice Verification")
- Hovering over a step opens transcript snippets or agent logs
- Interactive map of HSH shelter locations and social service providers
- Shelter pins glow based on capacity (green = open, red = full)
- Click a pin β shows Bright Data-sourced info + latest Vapi transcript
- Animated vehicle path from hospital β shelter
- Real-time ETA updates via TransportAgent
- Compact summary card with patient name, shelter assigned, social worker contact
- Transport route + ETA, follow-up schedule
- Click "Expand" β full chat-style feed of agent communications and voice call transcripts
cd frontend
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintcd backend
source venv/bin/activate
python main.py # Start development server
uvicorn main:app --reload # Alternative start command
python agents.py # Run Fetch.ai agents./start-dev.sh # Start both frontend and backendcarelink/
βββ src/
β βββ app/ # Next.js app directory
β βββ components/ # React components
βββ backend/
β βββ main.py # FastAPI server
β βββ agents.py # Fetch.ai agents
β βββ requirements.txt # Python dependencies
β βββ env.example # Environment variables template
βββ package.json # Node.js dependencies
CareLink connects:
- Hospitals initiating safe discharge
- Shelters updating real-time availability
- Social workers ensuring continuity of care
- Transport providers guaranteeing safe arrival
- Patients who communicate via simple phone conversations
It's the digital backbone for community-based healthcare coordination β scalable, voice-driven, and human-centered.
- 60-70% reduction in case coordination time (4-5hr β 1-2hr)
- 83% reduction in staff manual work (3hr β 30min per case)
- $500 cost savings per case ($700 β $200)
- 67% reduction in medication-related ER readmissions (15% β 5%)
- π° $500K cost savings
- β° 2,500 staff hours saved
- π₯ 100 fewer ER readmissions
β
Prevents unsafe discharges for unhoused patients
β
Automates coordination among hospitals, shelters, and social workers
β
Uses live data to ensure real-time accuracy
β
Enables low-tech accessibility via voice calls
β
Ensures medication continuity and resource access
β
Automates benefit eligibility verification
β
Provides system-wide analytics for continuous improvement
MIT License - see LICENSE file for details
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For questions or support, please open an issue on GitHub or contact the development team.