Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v18 or higher)
- npm or yarn
- Git
- A Hume AI account with API credentials
Get your API credentials
Sign up for Hume AI
Visit Hume AI and create an account if you don’t have one.
Generate API credentials
Navigate to your Hume AI dashboard and generate:
- API Key (for voice interface authentication)
- Secret Key (for backend OAuth2 token generation)
- Config ID (for your custom EVI configuration)
Clone and install
Install backend dependencies
Navigate to the backend directory and install dependencies:The backend uses Express.js and includes the following key dependencies:
express- Web server frameworkcors- Cross-origin resource sharingdotenv- Environment variable management
Configure environment variables
SvaraAI requires environment variables for both the frontend and backend.Environment variable breakdown
| Variable | Location | Purpose |
|---|---|---|
VITE_HUME_API_KEY | Frontend & Backend | Authenticates voice interface connections |
VITE_HUME_CONFIG_ID | Frontend | Specifies your custom EVI configuration |
HUME_SECRET_KEY | Backend | Generates OAuth2 access tokens |
GEMINI_API_KEY | Backend | Authenticates with Google Gemini API |
GEMINI_PROMPT | Backend | Template for therapeutic response generation |
PORT | Backend | Backend server port (defaults to 5000) |
Start the development servers
SvaraAI runs two separate servers: a backend API and a frontend React application.The frontend development server (Vite) automatically proxies
/api requests to the backend server at http://localhost:5000. This is configured in vite.config.ts.Start your first conversation
Open the application
Navigate to http://localhost:5173/playground in your browser.
Grant microphone permissions
When prompted, allow the application to access your microphone. This is required for voice-based therapy sessions.
Connect to the voice interface
Click the connect button to establish a connection with Hume AI’s Empathic Voice Interface (EVI). The application will:
- Authenticate using your API key
- Load your custom configuration
- Initialize the emotion detection models
Frontend/src/components/startCall.tsx
How it works
SvaraAI uses Hume AI’s Empathic Voice Interface to create emotion-aware conversations:Frontend/src/components/chat.tsx
Architecture overview
-
Frontend - React application with Hume AI voice SDK
- Real-time voice communication
- Emotion visualization
- Conversation history
-
Backend - Express.js API server
- OAuth2 token generation for secure API access
- Audio analysis endpoints
- Conversation data persistence
-
Hume AI EVI - Emotion detection and response generation
- Prosody analysis (voice tone, pitch, rhythm)
- Language sentiment analysis
- Context-aware empathetic responses
Available routes
SvaraAI provides several routes for different functionalities:| Route | Description |
|---|---|
/ | Landing page with product information |
/playground | Interactive voice therapy interface |
/insights | View conversation analytics and emotion insights |
Next steps
Voice emotion detection
Learn how SvaraAI detects emotions from voice using Hume AI.
Conversation insights
Learn how to interpret emotion data and conversation analytics.
API reference
Explore backend endpoints for audio analysis and conversation management.
Architecture overview
Understand how SvaraAI’s components work together.
Troubleshooting
Missing API credentials error
Missing API credentials error
If you see “Missing API credentials. Check your .env file”, ensure:
- Your
.envfile exists in the correct directory - Variable names match exactly (including
VITE_prefix) - No quotes around the values
- You’ve restarted the development server after adding variables
Unable to connect to voice interface
Unable to connect to voice interface
Connection failures are usually caused by:
- Microphone permissions denied - Check browser settings
- Invalid API key - Verify credentials in Hume AI dashboard
- Backend server not running - Ensure Express server is running on port 5000
- Network issues - Check your internet connection
Backend server fails to start
Backend server fails to start
If the backend fails with port conflicts:Either kill the process using port 5000 or change the
PORT variable in your .env file.Hume API authentication fails
Hume API authentication fails
The backend generates OAuth2 tokens using this flow:If authentication fails, verify both your API key and secret key are correct.
Backend/utils/humeClient.ts
Get help
If you encounter issues not covered here:- Check the GitHub Issues
- Join our Discord community
- Review Hume AI documentation