--- title: PensionBot emoji: 🎤 colorFrom: blue colorTo: green sdk: docker sdk_version: "latest" app_file: app.py pinned: false --- # PensionBot - Voice Assistant 🎤 A sophisticated AI-powered voice assistant designed for government pension queries and document searches. Built with FastAPI, this backend provides comprehensive API endpoints for voice interaction, document processing, and intelligent responses. ## 🚀 Features - **Voice Processing**: Advanced ASR and TTS capabilities - **Document Search**: RAG-based government document knowledge base - **Hybrid AI**: Multiple LLM providers for optimal responses - **WebSocket Support**: Real-time communication - **Authentication**: JWT-based secure access ## 📡 API Endpoints - `GET /` - Service information and available endpoints - `GET /health` - Health check with service status - `POST /chat` - Text-based conversation interface - `WebSocket /ws` - Real-time voice and text communication - `GET /docs` - Interactive API documentation ## 🛠 Technology Stack - **FastAPI**: High-performance web framework - **LangChain**: AI orchestration and document processing - **LanceDB**: Vector database for document search - **Whisper**: Speech-to-text processing - **Edge-TTS**: Text-to-speech synthesis ## 🔗 Usage The API is accessible at the base URL of this space. Use the `/docs` endpoint to explore the interactive API documentation. ### Example Usage: ```bash # Health check curl https://chabhishek28-pensionbot.hf.space/health # Chat endpoint curl -X POST https://chabhishek28-pensionbot.hf.space/chat \ -H "Content-Type: application/json" \ -d '{"message": "Tell me about pension policies"}' ``` ## 📋 Environment Variables The following environment variables are required: - `GOOGLE_API_KEY`: Google Gemini API key - `GROQ_API_KEY`: Groq API key for Whisper - `TAVILY_API_KEY`: Tavily search API key - `JWT_SECRET_KEY`: JWT authentication secret ## 🔒 Security This API includes JWT-based authentication for secure access to protected endpoints. Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference