A hackathon project that helps users overcome Solomon's Paradox by creating a Digital Twin using RAG and a Multi-Agent System for mindfulness and mentorship.
uofthacks/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── agents/ # LangGraph orchestrator and agents
│ │ ├── routers/ # API endpoints
│ │ ├── services/ # RAG and business logic
│ │ ├── models/ # Pydantic schemas
│ │ └── main.py # FastAPI app entry point
│ ├── requirements.txt
│ └── supabase_schema.sql
├── frontend/ # Next.js frontend
│ ├── app/ # App router pages
│ ├── components/ # React components
│ └── lib/ # Utilities
└── HACKATHON_EXECUTION_PLAN.md
- FastAPI backend with CORS configuration
- Supabase database schema with pgvector
- RAG pipeline for journal ingestion and similarity search
- LangGraph orchestrator with basic agent routing
- Core API endpoints (/api/journal, /api/chat)
- Next.js frontend with terminal aesthetic
- Chat interface with agent avatars
- Journal entry page
- Terminal-themed UI with scanline effects
- Python 3.10+
- Node.js 18+
- Supabase account
- OpenAI API key
-
Navigate to backend directory:
cd backend -
Create and activate virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Edit
.envand add your credentials:SUPABASE_URL=your_supabase_project_url SUPABASE_KEY=your_supabase_anon_key SUPABASE_SERVICE_KEY=your_supabase_service_role_key OPENAI_API_KEY=your_openai_api_key -
Set up Supabase database:
- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Run the contents of
supabase_schema.sql - This will create tables and enable pgvector
-
Run the backend:
python -m app.main
Backend will be available at
http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.local.example .env.local
Edit
.env.local:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_API_URL=http://localhost:8000 -
Run the development server:
npm run dev
Frontend will be available at
http://localhost:3000
Visit http://localhost:8000/docs to see the interactive API documentation.
Test the health endpoint:
curl http://localhost:8000/health- Go to
http://localhost:3000/journal - Write a journal entry (e.g., "I've been feeling anxious about my upcoming presentation")
- Click "SAVE ENTRY"
- You should see a success message
- Go to
http://localhost:3000/council - Type a message like "I'm feeling stressed about work"
- The Mindfulness Agent (The Empath) should respond with empathy
- FastAPI: REST API server
- LangGraph: Agent orchestration and state management
- Supabase + pgvector: Vector database for RAG
- OpenAI: Embeddings and chat completions
- Next.js 14: App Router for routing
- Tailwind CSS: Terminal-themed styling
- Framer Motion: Smooth animations
- Lucide React: Icons
- Orchestrator: Routes user queries to appropriate agents
- Mindfulness Agent (The Empath): Helps identify emotions and provides comfort
According to the execution plan, Phase 2 will add:
- Wise Mentor agent with RAG-powered context
- Historical persona selection
- WebSocket relay for OpenAI Realtime API
- Meditation session scaffold
- Make sure you're in the virtual environment:
source venv/bin/activate - Check that all environment variables are set in
.env - Verify Python version:
python --version(should be 3.10+)
- Delete
node_modulesand.next:rm -rf node_modules .next - Reinstall:
npm install - Check Node version:
node --version(should be 18+)
- Ensure pgvector extension is enabled in Supabase
- Check that the SQL schema was executed successfully
- Verify Supabase credentials in
.env
- Make sure backend is running on port 8000
- Check that
NEXT_PUBLIC_API_URLin frontend.env.localmatches backend URL - Verify CORS middleware is configured in backend
main.py
MIT - Built for UofT Hacks 2025