Bridging Ancient Wisdom with Modern AI Technology
A comprehensive multilingual AI system for Sanskrit, Hindi, and English spiritual literature, featuring advanced Retrieval-Augmented Generation (RAG), voice processing, and intuitive web interface. Built for profound spiritual inquiry and guidance through sacred texts like the Bhagavad Gita, Upanishads, and other Vedic scriptures.
DivyaVaani AI is an enterprise-grade spiritual intelligence platform that combines:
Frontend Layer
βββ Next.js 15 - React Framework
βββ TypeScript - Type Safety
βββ Tailwind CSS - Styling
βββ shadcn/ui - Component Library
βββ Real-time Chat Interface
βββ Analytics Dashboard
βββ Multilingual Support
API Layer
βββ FastAPI - High Performance
βββ Python 3.8+ - Core Language
βββ Multimodal Processing
βββ RAG System
βββ Voice Synthesis
βββ Advanced Caching
Knowledge Processing
βββ Multi-format Intake (PDF, CSV, Images)
βββ Automated Cleaning & Validation
βββ Embedding Generation
βββ Vector Storage (Chroma, FAISS)
βββ Semantic Retrieval
Scalable Services
βββ Docker & Docker Compose
βββ Redis Caching
βββ File-based Storage
βββ Health Monitoring
βββ API Documentation
# Clone repository
git clone https://github.com/YogeshKumar-saini/DivyaVaani-ai.git
cd DivyaVaani-ai
# Quick setup and run
make setup
make run
You can start the entire system (backend, frontend, and redis) using Docker Compose from the root directory:
# Start all services
docker compose up -d
# Build services
docker compose build
The individual services are:
[!NOTE] Ensure you have your
.envfile set up in thebackenddirectory before starting the services.
For local development without Docker:
# Install dependencies
make install
# Configure environment files
cp backend/.env.example backend/.env
echo "NEXT_PUBLIC_API_BASE_URL=http://localhost:8000" > frontend/.env.local
# Run development servers
make run
The project includes automated CI/CD with GitHub Actions:
Required Secrets for CD:
DOCKER_USERNAME: Docker Hub usernameDOCKER_PASSWORD: Docker Hub passwordSERVER_HOST: Production server hostnameSERVER_USER: SSH username for deploymentSERVER_SSH_KEY: Private SSH key for deploymentVisit http://localhost:3000 for the web interface.
# Navigate to backend
cd backend
# Install dependencies
pip install -r requirements-api.txt
pip install -r requirements-dev.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys and settings
# Start Redis cache
docker-compose up -d redis
# Run API server
python -m src.api.main
# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Configure environment
echo "NEXT_PUBLIC_API_BASE_URL=http://localhost:8000" > .env.local
# Start development server
npm run dev
# Backend (.env)
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=4
DATABASE_URL=sqlite:///./divyavaani.db
REDIS_URL=redis://localhost:6379
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
LLM_MODEL=minimax/minimax-m2:free
SUPPORTED_LANGUAGES=en,hi,san
DEFAULT_LANGUAGE=en
# Frontend (.env.local)
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_APP_NAME="DivyaVaani AI"
NEXT_PUBLIC_ENABLE_ANALYTICS=true
# Request
curl -X POST "http://localhost:8000/api/v1/text/query" \
-H "Content-Type: application/json" \
-d '{
"question": "What is karma yoga according to Bhagavad Gita?",
"language": "en",
"context": "user_background_beginner",
"include_references": true
}'
# Response
{
"answer": "Karma Yoga, as described in the Bhagavad Gita, is the path of selfless action...",
"references": [
{
"text": "Chapter 3, Verse 19: Therefore, without attachment to the results of activities...",
"source": "Bhagavad Gita",
"chapter": 3,
"verse": 19
}
],
"confidence": 0.95,
"language": "en",
"processing_time": 1.2
}
# Upload audio file (WAV/MP3 format)
curl -X POST "http://localhost:8000/api/v1/voice/query" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "language=en"
# Response includes both transcription and answer
{
"transcription": "What does Krishna say about detachment?",
"answer": "Lord Krishna explains that true detachment means performing duties...",
"audio_response_url": "/api/v1/audio/response_123.mp3",
"references": [...],
"processing_time": 2.1
}
curl -X POST "http://localhost:8000/api/v1/voice/tts" \
-H "Content-Type: application/json" \
-d '{
"text": "You must perform your prescribed duty, for action is better than inaction...",
"language": "en",
"voice": "spiritual_guide",
"speed": 1.0
}'
# Returns audio file URL for playback
curl "http://localhost:8000/analytics"
# Response with system metrics
{
"total_queries": 15420,
"queries_today": 234,
"popular_topics": [
{"topic": "Karma Yoga", "count": 1240},
{"topic": "Bhakti", "count": 890}
],
"response_times": {
"average": 1.3,
"95th_percentile": 2.8
},
"system_health": {
"status": "healthy",
"uptime": "99.8%",
"memory_usage": "2.3GB"
}
}
curl -X POST "http://localhost:8000/api/v1/text/analyze" \
-H "Content-Type: application/json" \
-d '{
"text": "Om Shanti",
"analysis_type": "semantic",
"include_pronunciation": true
}'
# Detailed analysis response
{
"semantic_analysis": {
"meaning": "Peace invocation",
"sanskrit_root": "ΰ€Άΰ€Ύΰ€¨ΰ₯ΰ€€ΰ€Ώ (shanti)",
"philosophical_context": "Spiritual peace and harmony"
},
"pronunciation": {
"transliteration": "Om Shaan-tee",
"ipa": "/oΚm ΚΙΛnti/",
"audio_guide": "/audio/pronunciation.mp3"
}
}
POST /api/v1/text/query - Spiritual text queriesPOST /api/v1/text/analyze - Text analysis and insightsPOST /api/v1/voice/stt - Convert speech to textPOST /api/v1/voice/tts - Convert text to speechPOST /api/v1/voice/query - Voice-based queriesGET /analytics - System usage statisticsGET /health - API health statusInteractive API Docs: http://localhost:8000/docs
# Add spiritual texts to backend/data/
# Supported formats: PDF, CSV, Excel, Images, Text
# Run data pipeline
cd backend && python scripts/build_pipeline.py
# Embeddings will be generated automatically
# Vectors stored in configured vector database
# Configure in .env
EMBEDDING_MODEL=all-MiniLM-L6-v2
LLM_MODEL=minimax/minimax-m2:free
# For local models
LOCAL_LLM_MODEL=mistral-7b-instruct
USE_LOCAL_LLM=true
# Multiple API workers
API_WORKERS=8
# Distribute across servers
# Configure Redis cluster for embeddings cache
# Use load balancer for multiple API instances
# Backend tests
cd backend
python tests/run_complete_test.py
pytest src/api/tests/ -v
# Frontend tests
cd frontend
npm test
npm run test:e2e
# Integration tests
python tests/integration/test_voice_agent_integration.py
# Build and deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d --build
# Or use Makefile
make deploy-prod
# Scale services
docker-compose up -d --scale api=3 --scale redis=2
# Monitor deployment
docker-compose logs -f api
# Using AWS ECS
aws ecs create-cluster --cluster-name divyavaani-cluster
aws ecs register-task-definition --family divyavaani-api --container-definitions file://api-container.json
# Using Docker Swarm
docker swarm init
docker stack deploy -c docker-compose.swarm.yml divyavaani
# Kubernetes deployment
kubectl apply -f kubernetes/
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /api {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# Using Let's Encrypt
certbot --nginx -d yourdomain.com
# Or manually with OpenSSL
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
# Check if API is running
curl http://localhost:8000/health
# View API logs
docker-compose logs api
# Restart services
docker-compose restart api
.env# Rebuild vector database
cd backend && python scripts/rebuild_embeddings.py
# Check vector store health
curl http://localhost:8000/health/vectors
# Clear Redis cache if corrupted
docker-compose exec redis redis-cli FLUSHALL
# Clear Next.js cache
cd frontend && rm -rf .next node_modules
npm install && npm run build
# Check Node.js version
node --version # Should be 18+
# Verify environment variables
cat .env.local
docker statsAPI_WORKERS=8 in .env# Full system status
make status
# Complete log aggregation
docker-compose logs --tail=100 -f
# API performance profiling
curl "http://localhost:8000/debug/profile"
# Database query analysis
python -c "from src.database import inspect_queries; inspect_queries()"
/docs for detailed guidesmake diagnose for automated troubleshooting# Health checks
GET /health # System health
GET /health/api # API service status
GET /health/database # Database connectivity
GET /health/cache # Redis status
# Metrics endpoints
GET /metrics # Prometheus metrics
GET /analytics # Application analytics
GET /debug/info # System information
# Log aggregation (ELK Stack)
- Elasticsearch: Document storage
- Logstash: Log processing
- Kibana: Visualization dashboard
We welcome contributions to enhance spiritual technology accessibility!
Fork & Clone
git clone https://github.com/YogeshKumar-saini/DivyaVaani-ai.git
cd DivyaVaani-ai
Set up Development Environment
make setup # Backend dependencies
cd frontend && npm install
Create Feature Branch
git checkout -b feature/spiritual-guidance-enhancement
Follow Code Standards
make lint # Python linting
cd frontend && npm run lint # TypeScript linting
Add Tests & Documentation
make test # Run all tests
# Update docs in backend/docs/
Submit Pull Request
git push origin feature/spiritual-guidance-enhancement
# Create PR with detailed description
DivyaVaani-ai/
βββ README.md # This file - Project overview
βββ docker-compose.yml # Container orchestration
βββ Makefile # Build automation
β
βββ backend/ # Python FastAPI backend
β βββ src/ # Source code
β βββ data/ # Knowledge base (gitignored)
β βββ docs/ # API documentation
β βββ requirements*.txt # Dependencies
β βββ tests/ # Test suites
β
βββ frontend/ # Next.js TypeScript frontend
β βββ app/ # Next.js App Router
β βββ components/ # UI components
β βββ lib/ # Utilities
β βββ public/ # Static assets
β βββ tests/ # Frontend tests
β
βββ scripts/ # Utility scripts
This project is licensed under the MIT License - see the LICENSE file for details.
The spiritual texts included are in the public domain and provided for educational purposes.
Special thanks to contributors who are dedicated to making spiritual wisdom accessible through technology.
/docsποΈ May this technology serve the highest good, bridging eternal wisdom with contemporary understanding. Om Shanti. π
DivyaVaani AI - Illuminating the path to spiritual awakening through intelligent technology.
Bridging Ancient Wisdom with Modern AI Technology
A comprehensive multilingual AI system for Sanskrit, Hindi, and English spiritual literature, featuring advanced Retrieval-Augmented Generation (RAG), voice processing, and intuitive web interface. Built for profound spiritual inquiry and guidance through sacred texts like the Bhagavad Gita, Upanishads, and other Vedic scriptures.
DivyaVaani AI is an enterprise-grade spiritual intelligence platform that combines:
Frontend Layer
βββ Next.js 15 - React Framework
βββ TypeScript - Type Safety
βββ Tailwind CSS - Styling
βββ shadcn/ui - Component Library
βββ Real-time Chat Interface
βββ Analytics Dashboard
βββ Multilingual Support
API Layer
βββ FastAPI - High Performance
βββ Python 3.8+ - Core Language
βββ Multimodal Processing
βββ RAG System
βββ Voice Synthesis
βββ Advanced Caching
Knowledge Processing
βββ Multi-format Intake (PDF, CSV, Images)
βββ Automated Cleaning & Validation
βββ Embedding Generation
βββ Vector Storage (Chroma, FAISS)
βββ Semantic Retrieval
Scalable Services
βββ Docker & Docker Compose
βββ Redis Caching
βββ File-based Storage
βββ Health Monitoring
βββ API Documentation
# Clone repository
git clone https://github.com/YogeshKumar-saini/DivyaVaani-ai.git
cd DivyaVaani-ai
# Quick setup and run
make setup
make run
You can start the entire system (backend, frontend, and redis) using Docker Compose from the root directory:
# Start all services
docker compose up -d
# Build services
docker compose build
The individual services are:
[!NOTE] Ensure you have your
.envfile set up in thebackenddirectory before starting the services.
For local development without Docker:
# Install dependencies
make install
# Configure environment files
cp backend/.env.example backend/.env
echo "NEXT_PUBLIC_API_BASE_URL=http://localhost:8000" > frontend/.env.local
# Run development servers
make run
The project includes automated CI/CD with GitHub Actions:
Required Secrets for CD:
DOCKER_USERNAME: Docker Hub usernameDOCKER_PASSWORD: Docker Hub passwordSERVER_HOST: Production server hostnameSERVER_USER: SSH username for deploymentSERVER_SSH_KEY: Private SSH key for deploymentVisit http://localhost:3000 for the web interface.
# Navigate to backend
cd backend
# Install dependencies
pip install -r requirements-api.txt
pip install -r requirements-dev.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys and settings
# Start Redis cache
docker-compose up -d redis
# Run API server
python -m src.api.main
# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Configure environment
echo "NEXT_PUBLIC_API_BASE_URL=http://localhost:8000" > .env.local
# Start development server
npm run dev
# Backend (.env)
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=4
DATABASE_URL=sqlite:///./divyavaani.db
REDIS_URL=redis://localhost:6379
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
LLM_MODEL=minimax/minimax-m2:free
SUPPORTED_LANGUAGES=en,hi,san
DEFAULT_LANGUAGE=en
# Frontend (.env.local)
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000
NEXT_PUBLIC_APP_NAME="DivyaVaani AI"
NEXT_PUBLIC_ENABLE_ANALYTICS=true
# Request
curl -X POST "http://localhost:8000/api/v1/text/query" \
-H "Content-Type: application/json" \
-d '{
"question": "What is karma yoga according to Bhagavad Gita?",
"language": "en",
"context": "user_background_beginner",
"include_references": true
}'
# Response
{
"answer": "Karma Yoga, as described in the Bhagavad Gita, is the path of selfless action...",
"references": [
{
"text": "Chapter 3, Verse 19: Therefore, without attachment to the results of activities...",
"source": "Bhagavad Gita",
"chapter": 3,
"verse": 19
}
],
"confidence": 0.95,
"language": "en",
"processing_time": 1.2
}
# Upload audio file (WAV/MP3 format)
curl -X POST "http://localhost:8000/api/v1/voice/query" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "language=en"
# Response includes both transcription and answer
{
"transcription": "What does Krishna say about detachment?",
"answer": "Lord Krishna explains that true detachment means performing duties...",
"audio_response_url": "/api/v1/audio/response_123.mp3",
"references": [...],
"processing_time": 2.1
}
curl -X POST "http://localhost:8000/api/v1/voice/tts" \
-H "Content-Type: application/json" \
-d '{
"text": "You must perform your prescribed duty, for action is better than inaction...",
"language": "en",
"voice": "spiritual_guide",
"speed": 1.0
}'
# Returns audio file URL for playback
curl "http://localhost:8000/analytics"
# Response with system metrics
{
"total_queries": 15420,
"queries_today": 234,
"popular_topics": [
{"topic": "Karma Yoga", "count": 1240},
{"topic": "Bhakti", "count": 890}
],
"response_times": {
"average": 1.3,
"95th_percentile": 2.8
},
"system_health": {
"status": "healthy",
"uptime": "99.8%",
"memory_usage": "2.3GB"
}
}
curl -X POST "http://localhost:8000/api/v1/text/analyze" \
-H "Content-Type: application/json" \
-d '{
"text": "Om Shanti",
"analysis_type": "semantic",
"include_pronunciation": true
}'
# Detailed analysis response
{
"semantic_analysis": {
"meaning": "Peace invocation",
"sanskrit_root": "ΰ€Άΰ€Ύΰ€¨ΰ₯ΰ€€ΰ€Ώ (shanti)",
"philosophical_context": "Spiritual peace and harmony"
},
"pronunciation": {
"transliteration": "Om Shaan-tee",
"ipa": "/oΚm ΚΙΛnti/",
"audio_guide": "/audio/pronunciation.mp3"
}
}
POST /api/v1/text/query - Spiritual text queriesPOST /api/v1/text/analyze - Text analysis and insightsPOST /api/v1/voice/stt - Convert speech to textPOST /api/v1/voice/tts - Convert text to speechPOST /api/v1/voice/query - Voice-based queriesGET /analytics - System usage statisticsGET /health - API health statusInteractive API Docs: http://localhost:8000/docs
# Add spiritual texts to backend/data/
# Supported formats: PDF, CSV, Excel, Images, Text
# Run data pipeline
cd backend && python scripts/build_pipeline.py
# Embeddings will be generated automatically
# Vectors stored in configured vector database
# Configure in .env
EMBEDDING_MODEL=all-MiniLM-L6-v2
LLM_MODEL=minimax/minimax-m2:free
# For local models
LOCAL_LLM_MODEL=mistral-7b-instruct
USE_LOCAL_LLM=true
# Multiple API workers
API_WORKERS=8
# Distribute across servers
# Configure Redis cluster for embeddings cache
# Use load balancer for multiple API instances
# Backend tests
cd backend
python tests/run_complete_test.py
pytest src/api/tests/ -v
# Frontend tests
cd frontend
npm test
npm run test:e2e
# Integration tests
python tests/integration/test_voice_agent_integration.py
# Build and deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d --build
# Or use Makefile
make deploy-prod
# Scale services
docker-compose up -d --scale api=3 --scale redis=2
# Monitor deployment
docker-compose logs -f api
# Using AWS ECS
aws ecs create-cluster --cluster-name divyavaani-cluster
aws ecs register-task-definition --family divyavaani-api --container-definitions file://api-container.json
# Using Docker Swarm
docker swarm init
docker stack deploy -c docker-compose.swarm.yml divyavaani
# Kubernetes deployment
kubectl apply -f kubernetes/
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /api {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# Using Let's Encrypt
certbot --nginx -d yourdomain.com
# Or manually with OpenSSL
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
# Check if API is running
curl http://localhost:8000/health
# View API logs
docker-compose logs api
# Restart services
docker-compose restart api
.env# Rebuild vector database
cd backend && python scripts/rebuild_embeddings.py
# Check vector store health
curl http://localhost:8000/health/vectors
# Clear Redis cache if corrupted
docker-compose exec redis redis-cli FLUSHALL
# Clear Next.js cache
cd frontend && rm -rf .next node_modules
npm install && npm run build
# Check Node.js version
node --version # Should be 18+
# Verify environment variables
cat .env.local
docker statsAPI_WORKERS=8 in .env# Full system status
make status
# Complete log aggregation
docker-compose logs --tail=100 -f
# API performance profiling
curl "http://localhost:8000/debug/profile"
# Database query analysis
python -c "from src.database import inspect_queries; inspect_queries()"
/docs for detailed guidesmake diagnose for automated troubleshooting# Health checks
GET /health # System health
GET /health/api # API service status
GET /health/database # Database connectivity
GET /health/cache # Redis status
# Metrics endpoints
GET /metrics # Prometheus metrics
GET /analytics # Application analytics
GET /debug/info # System information
# Log aggregation (ELK Stack)
- Elasticsearch: Document storage
- Logstash: Log processing
- Kibana: Visualization dashboard
We welcome contributions to enhance spiritual technology accessibility!
Fork & Clone
git clone https://github.com/YogeshKumar-saini/DivyaVaani-ai.git
cd DivyaVaani-ai
Set up Development Environment
make setup # Backend dependencies
cd frontend && npm install
Create Feature Branch
git checkout -b feature/spiritual-guidance-enhancement
Follow Code Standards
make lint # Python linting
cd frontend && npm run lint # TypeScript linting
Add Tests & Documentation
make test # Run all tests
# Update docs in backend/docs/
Submit Pull Request
git push origin feature/spiritual-guidance-enhancement
# Create PR with detailed description
DivyaVaani-ai/
βββ README.md # This file - Project overview
βββ docker-compose.yml # Container orchestration
βββ Makefile # Build automation
β
βββ backend/ # Python FastAPI backend
β βββ src/ # Source code
β βββ data/ # Knowledge base (gitignored)
β βββ docs/ # API documentation
β βββ requirements*.txt # Dependencies
β βββ tests/ # Test suites
β
βββ frontend/ # Next.js TypeScript frontend
β βββ app/ # Next.js App Router
β βββ components/ # UI components
β βββ lib/ # Utilities
β βββ public/ # Static assets
β βββ tests/ # Frontend tests
β
βββ scripts/ # Utility scripts
This project is licensed under the MIT License - see the LICENSE file for details.
The spiritual texts included are in the public domain and provided for educational purposes.
Special thanks to contributors who are dedicated to making spiritual wisdom accessible through technology.
/docsποΈ May this technology serve the highest good, bridging eternal wisdom with contemporary understanding. Om Shanti. π
DivyaVaani AI - Illuminating the path to spiritual awakening through intelligent technology.