An MVP backend that automates interview slot suggestions by combining candidate and interviewer availability.
- Python 3.10+
- FastAPI
- Gemini API (Google Generative AI)
app/
main.py
models/
schemas.py
services/
gemini_client.py
availability_parser.py
scheduler.py
recommendation_service.py
streamlit_app.py
sample_run.py
requirements.txt
.env.example
- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
copy .env.example .envSet your Gemini key in .env:
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-1.5-flashIf running python prints a Microsoft Store message, Python is not installed (or only the alias exists).
- Install Python 3.10+ from python.org or with winget:
winget install Python.Python.3.12- Restart terminal and verify:
python --version- Then run project setup:
python -m venv .venv
.\.venv\Scripts\python -m pip install -r requirements.txtuvicorn app.main:app --reloadOpen:
http://127.0.0.1:8000/docshttp://127.0.0.1:8000/health
streamlit run streamlit_app.pyThe UI includes:
- Natural language and structured JSON input modes
- Interactive interviewer table editor
- Sample-data autofill
- Top-slot cards, conflicts, reasoning, and strict JSON output preview
- Run history panel
Input example:
{
"candidate_availability": "Tue-Thu 2-5 PM, Fri 9 AM-12 PM",
"interviewer_availability": {
"Interviewer A": "Tue 3-6 PM",
"Interviewer B": "Tue 1-4 PM",
"Interviewer C": "Wed 2-5 PM"
},
"timezone": "UTC"
}Strict output format:
{
"top_slots": [],
"conflicts": [],
"final_recommendation": "",
"reasoning": ""
}Run:
python sample_run.pyExpected behavior for sample input:
- Top slots include
Tue 3 PM-4 PM. - Final recommendation prefers max interviewer overlap and earliest slot.
- Input Parser
- Uses Gemini to parse natural language into
{day, start, end}. - Includes deterministic regex fallback.
- Time Normalization Engine
- Converts to 24-hour format.
- Splits into 1-hour slots.
- Overlap Detection Engine
- Computes candidate and interviewer intersections.
- Scores by interviewer count.
- Ranking Algorithm
- Sorts by highest overlap, then earliest day/time.
- Returns top 3.
- Conflict Detection
- Flags missing, partial, and no-overlap conditions.
- LLM Reasoning Layer
- Gemini generates human-readable reasoning and fallback suggestions.
- Uses deterministic fallback reasoning if Gemini is unavailable.