Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Cerebral AI

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.

🚀 Features

  • 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.

💻 Tech Stack


🏗️ Architecture & Routing

  1. 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.
  2. 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 optimized audio/mpeg buffer to the client.

🛠️ Getting Started

1. Prerequisites

Ensure you have Node.js (v18+) installed. You will also need active API keys for Google Gemini and ElevenLabs.

2. Installation

Clone the repository and install the dependencies:

git clone https://github.com/Eyadmb/Cerebral-AI.git
cd Cerebral-AI/website
npm install

3. Environment Variables

Create 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"

4. Run the Development Server

Start the local server:

npm run dev

Open http://localhost:3000 in your browser to view the application.


⚠️ Medical Disclaimer

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.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages