A voice-enabled hotel booking assistant application. The assistant helps users book hotel rooms, check availability, and manage bookings through both text and voice interactions.
- User authentication (signup/login)
- Text chat with AI assistant for hotel bookings
- Voice input for natural conversation
- Room availability checking
- Room booking
- Booking management (view, update, cancel)
- Email confirmations for bookings
- FastAPI
- SQLAlchemy ORM
- PostgreSQL database
- LangChain + OpenAI for AI conversation
- Deepgram for voice transcription
- Alembic for database migrations
- React
- MediaRecorder API for voice recording
- Python 3.8+
- Node.js 14+
- PostgreSQL database
- OpenAI API key
- Deepgram API key
- SMTP server for email notifications
Create a .env
file in the root directory with:
POSTGRES_URL=your_postgres_url
OPENAI_API_KEY=your_openai_api_key
DEEPGRAM_API_KEY=your_deepgram_api_key
SMTP_HOST=your_smtp_host
SMTP_PORT=your_smtp_port
SMTP_USER=your_smtp_username
SMTP_PASSWORD=your_smtp_password
EMAIL_FROM=your_sender_email
ELEVENLABS_API_KEY=your_elevellabs_api
- Install dependencies:
pip install -r requirements.txt
- Run database migrations:
alembic upgrade head
- Start the backend server:
uvicorn main:app --reload
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the frontend development server:
npm start
- Open your browser to
http://localhost:3000
- Sign up for a new account or login
- Create a new conversation
- Start chatting with the hotel assistant using text or voice
- For voice input, click the microphone button, speak your request, then click the stop button
- The assistant will process your voice, transcribe it, and respond
/signup
- Create a new user account/login
- Authenticate user/conversations
- Create a new conversation/chat
- Send and receive text messages/voice-chat
- Send voice recordings for processing/play-audio
- Plays the response as audio from AI
The application follows a client-server architecture:
- The React frontend captures user input (text or voice)
- For voice, the MediaRecorder API records audio and sends it to the backend
- The backend uses Deepgram to transcribe voice to text
- The text is processed by the AI assistant using LangChain and OpenAI
- The assistant uses tools to query and manipulate the database
- Responses are sent back to the frontend
- Email confirmations are sent for completed bookings