Study-Pilot is an AI-powered study assistant that explains concepts in different personalities (modes), generates flashcards, and optionally converts explanations into audio.
Built for fast learning, engagement, and experimentation with AI personalities.
-
🧠 AI Study Assistant
- Clear, beginner-friendly explanations
- Step-by-step reasoning
-
🎭 Multiple Personality Modes
study-buddymr-brokecaptain-quizhookgym-brodetective-chalksleep-deprived-gradcustomer-supportunpaid-intern
-
🔊 Text-to-Speech (Optional)
- Converts AI responses into audio via a private Hugging Face TTS Space
- Audio served statically via FastAPI
-
🧾 Conversation Memory
- PostgreSQL-backed storage
- Persistent conversations and modes
-
🗂️ Flashcard Generation
- Generate summaries and flashcards from conversations
-
🌐 Frontend
- React + Vite + TailwindCSS
study-pilot/
│
├── backend/
│ ├── main.py # FastAPI app
│ ├── main_ai.py # AI-only testing entry
│ ├── llm_utils.py # Prompt building, modes, TTS logic
│ ├── prompts.py # System + mode prompts
│ ├── database.py # DB connection
│ ├── database_models.py # SQLAlchemy models
│ ├── models.py # Pydantic schemas
│ └── init.py # DB initialization
│
├── frontend/
│ ├── index.html
│ ├── src/
│ ├── package.json
│ └── vite.config.js
│
└── README.md
- FastAPI
- OpenAI API (
gpt-4o-mini) - PostgreSQL
- SQLAlchemy
- Hugging Face Spaces (TTS via Gradio Client)
- React
- Vite
- TailwindCSS
git clone <your-repo-url>
cd study-pilotpip install fastapi uvicorn sqlalchemy psycopg2 openai gradio-clientUpdate database.py with your PostgreSQL credentials:
db_url = "postgresql://USER:PASSWORD@localhost:5432/FastAPI"python init.pySet your OpenAI key (recommended via environment variable):
export OPENAI_API_KEY="your-key-here"
⚠️ Do NOT hardcode API keys in production.
uvicorn main:app --reloadBackend:
http://localhost:8000
cd frontend
npm install
npm run devFrontend:
http://localhost:5173
- Uses a private Hugging Face Space
- Audio generated via
gradio_client - Saved to:
static/audio/ - Served at:
/static/audio/<filename>.wav
⚠️ Depends on GPU availability and Space uptime.
| Mode | Description |
|---|---|
| study-buddy | Friendly and patient |
| mr-broke | Dramatic, money metaphors |
| captain-quizhook | Pirate-themed |
| gym-bro | High-energy motivation |
| detective-chalk | Noir detective |
| sleep-deprived-grad | Chaotic but smart |
| customer-support | Calm and professional |
| unpaid-intern | Bitter but competent |
Modes influence prompt style, temperature, and penalties.
POST /study
{
"user_text": "What is RAM?",
"mode": "gym-bro"
}Response
{
"response": "RAM is like your brain during a workout...",
"audio_file_path": "/static/audio/example.wav"
}- Hugging Face GPU quotas
- Cold-start latency
- Audio length may truncate based on model behavior
- Streaming audio
- More voices
- Auth + user profiles
- Docker deployment
- Hackathons
- Learning tools
- AI experimentation
- Educational demos
If it teaches you and makes you laugh — it’s working.