Skip to content

vero-code/valetudo-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🩺 Valetudo AI β€” Trusted Medical Answer Assistant

Valetudo AI is a Perplexity Sonar-powered assistant that delivers science-backed, fast, and clear medical answers. It helps reduce misinformation by providing citations from verified sources β€” with support for filters by date, country, and even image upload.

The name Valetudo comes from Latin and means β€œhealth” 🩺. The project is designed for conscious users seeking reliable medical information: caring parents, patients, and medical students. Ask about symptoms, drug interactions, or safe alternatives β€” and get trustworthy answers instantly.

πŸŽ₯ Demo Video

Watch Valetudo AI in action πŸ‘‡:

Watch the demo

🎯 Key Features

  • Chat with AI using Perplexity Sonar Pro
  • Answers with numbered scientific citations
  • Limited to 10 trusted sources for clarity
  • Filters by date and user location
  • Image upload for visual context (e.g. meds or conditions)
  • Prompt templates (7 categories) for common medical queries:
    • Symptom-based advice
    • Drug interaction checks
    • Safety timing
    • Safer treatments
    • Compare effectiveness
    • Recommended exercises
    • Latest research
  • Follow-up input to clarify or expand your question
  • Prioritization of local sources when a country is selected
  • Markdown formatting and clean tables
  • Easily copy and open source links
  • Simple and user-friendly interface

Ask questions. Get trusted answers in seconds.

Home screen

πŸ”§ Integrated Features (per Perplexity API documentation):

Feature API Field
Search Context Size search_context_size: medium
Domain Filtering search_domain_filter
Image Upload image_url
Date Filtering search_after/before_date_filter
User Location Filter user_location

Upload an image β€” AI will analyze it too.

Image Upload

🧠 Tech Stack

  • Frontend: React, Vite, Tailwind CSS
  • AI Integration: Perplexity Sonar Pro API
  • Markdown Renderer: React Markdown, rehype-raw
  • UI Framework: React Select, React Icons, React Datepicker
  • Image handling: base64 encoder and preview
  • Backend: Python, Flask (proxy for API calls)

πŸš€ Local Setup

1. Clone the repo

git clone https://github.com/vero-code/valetudo-ai.git
cd valetudo-ai

2. Set environment variables

Create a .env file inside the /backend folder:

PERPLEXITY_API_KEY=your_api_key_here

πŸ”’ Refer to /backend/.env.example

πŸ“˜ How to get your API key

⚠️ Never commit your .env file to version control.

3. Start the frontend

npm install 
npm run dev

4. Start the backend

cd backend
python -m venv venv
venv\Scripts\activate     # On Windows
# OR
source venv/bin/activate  # On macOS/Linux

pip install -r requirements.txt
python app.py

The app will be available at http://localhost:5173

πŸ§ͺ Testing the App

1. Ask a health question

  • Example: What to do if a 5-year-old has a fever?
  • Click "Ask AI" and expand the full answer
  • Hover over citation numbers to preview and copy links

2. Use filters

  • Click "Show advanced options"
  • Set a custom date range
  • Choose a country for localized results

3. Upload an image

  • Drag and drop an image or upload manually
  • Ask: What is this medication?
  • The AI will include visual analysis

4. Try prompt templates

  • Click "Try Prompts"
  • Choose a category, fill in the fields, and generate a ready-to-send query
  • Use the Follow-up input to deepen the conversation

Save time with prompts and follow-up questions.

Prompts screen

πŸ“ Project Structure

valetudo-ai/

β”œβ”€β”€ backend/         # Flask backend API
β”œβ”€β”€ public/          # Static files
β”œβ”€β”€ screenshots/     # UI Images
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ assets/        # Media resources
β”‚ β”œβ”€β”€ components/    # React components
β”‚ β”œβ”€β”€ constants/     # Mock data and templates
β”‚ β”œβ”€β”€ hooks/         # Custom React hooks
β”‚ β”œβ”€β”€ utils/         # Helper functions
β”‚ β”œβ”€β”€ App.jsx        # Routes
β”‚ β”œβ”€β”€ index.css      # Styles
β”‚ └── main.jsx       # App entry point
β”œβ”€β”€ index.html       # Main HTML file
β”œβ”€β”€ LICENSE          # License file
β”œβ”€β”€ package.json     # Dependencies
β”œβ”€β”€ README.md        # Documentation
└── vite.config.js   # Vite config

πŸ”§ Key Components

  • HeroSection β€” landing section with input, filters, and image upload
  • AskPage β€” category-based prompt system with follow-up form
  • QuickAnswerBox β€” renders AI response with Markdown + citation links

πŸ”’ Security

  • No user data is stored
  • .env securely manages API key
  • Rate limits and usage caps can be added in production

🧩 Limitations

  • Not a diagnostic tool β€” for informational use only
  • Response time may vary with filters or image uploads
  • Mobile layout is simplified (desktop-first)

Disclaimer: This is not a medical device. Always consult a doctor for clinical decisions.

🏁 License

MIT License β€” free to use, modify, and distribute, with attribution.

🀝 Attribution

Built with ❀️ for the Perplexity Global Hackathon

Powered by the Sonar API