Cerebral AI is a highly advanced, educational medical AI assistant built for a science fair project. It takes complex medical terminology and explains it in simple, easy-to-understand language. It strictly adheres to safety protocols by refusing to diagnose users, instantly recommending emergency care for severe symptoms, and refusing to guess on unverified medical data.
- Google Gemini 2.5 Flash Integration: Operates with a custom, highly-optimized system prompt that strictly enforces medical safety rules and provides high-speed, empathetic responses.
- Conversation Memory: Maintains complete chat history during your session so the AI always has the context of your previous questions.
- ElevenLabs Text-to-Speech (TTS): Features ultra-fast voice synthesis (
eleven_turbo_v2) utilizing a custom Voice ID. - Cinematic Audio UI: Clicking the "Listen" button launches an immersive, fullscreen blurred overlay with a spinning gradient orb that pulses as the audio plays.
- Premium SaaS Aesthetic: Built entirely with Next.js App Router, Tailwind CSS, and Framer Motion for glassmorphic effects, beautiful gradients, and smooth scroll animations.
- Framework: Next.js 16 (App Router)
- UI/Styling: Tailwind CSS v4 & Framer Motion
- Icons: Lucide React
- AI Engine: @google/generative-ai (Gemini API)
- Voice Engine: ElevenLabs API
- Frontend Pages (
website/app/)page.js: The root landing page featuring a stunning hero section, Bento-grid feature cards, and scroll animations.chat/page.js: The core chat interface. Manages conversation memory state, handles the ElevenLabs TTS audio buffering, and renders the fullscreen audio overlay.
- Backend APIs (
website/app/api/)chat/route.js: Securely communicates with the Gemini model. It prepends the strict medical system instructions, parses the chat history, and returns the AI's response.tts/route.js: A secure proxy route that takes the AI's text and streams it to the ElevenLabs API, returning an optimizedaudio/mpegbuffer to the client.
Ensure you have Node.js (v18+) installed. You will also need active API keys for Google Gemini and ElevenLabs.
Clone the repository and install the dependencies:
git clone https://github.com/Eyadmb/Cerebral-AI.git
cd Cerebral-AI/website
npm installCreate a .env.local file inside the website/ directory and add your API keys:
GEMINI_API_KEY="your_gemini_api_key_here"
ELEVENLABS_API_KEY="your_elevenlabs_api_key_here"Start the local server:
npm run devOpen http://localhost:3000 in your browser to view the application.
Cerebral AI is an educational science fair project and is NOT a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.