No description
Two bugs in /routines/suggest where the LLM could override hard constraints: 1. Products with min_interval_hours (e.g. retinol at 72h) were passed to the LLM even if used too recently. The LLM reasoned away the constraint in at least one observed case. Fix: added _filter_products_by_interval() which removes ineligible products before the prompt is built, so they don't appear in AVAILABLE PRODUCTS at all. 2. Minoxidil was included in the available products list regardless of the include_minoxidil_beard flag. Only the objectives context was gated, leaving the product visible to the LLM which would include it based on recent usage history. Fix: added include_minoxidil param to _get_available_products() and threaded it through suggest_routine and suggest_batch. Also refactored _build_products_context() to accept a pre-supplied products list instead of calling _get_available_products() internally, ensuring the tool handler and context text always use the same filtered set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| backend | ||
| docs | ||
| frontend | ||
| nginx | ||
| systemd | ||
| .gitignore | ||
| AGENTS.md | ||
| deploy.sh | ||
| README.md | ||
innercontext
Personal health and skincare data hub. Collects structured data (products, routines, lab results, medications, skin snapshots) and exposes it via a REST API and a web UI to an LLM agent.
Repository layout
backend/ Python backend — FastAPI REST API + SQLModel models
frontend/ SvelteKit web UI (Svelte 5, TypeScript, Tailwind CSS v4)
docs/ Deployment guides
nginx/ nginx config for production
systemd/ systemd service units
Backend quick start
Requirements: Python 3.12+, PostgreSQL, uv
cd backend
# Install dependencies
uv sync
# Set database URL (defaults to postgresql+psycopg://localhost/innercontext)
export DATABASE_URL=postgresql+psycopg://user:password@localhost/innercontext
# Start the API server (creates tables on first run)
uv run uvicorn main:app --reload
API docs available at http://localhost:8000/docs.
Frontend quick start
Requirements: Node.js 24 LTS+, pnpm
cd frontend
# Install dependencies
pnpm install
# Start dev server (proxies API calls to localhost:8000)
pnpm dev
UI available at http://localhost:5173.
API overview
| Prefix | Resource |
|---|---|
/products |
Skincare / medication products + inventory |
/inventory |
Individual inventory entries |
/health/medications |
Medication entries and usage history |
/health/lab-results |
Lab test results |
/routines |
AM/PM skincare routines and steps |
/routines/grooming-schedule |
Weekly grooming schedule |
/skincare |
Weekly skin condition snapshots |
/profile |
User profile (birth date, sex at birth) |
/health-check |
Liveness probe |
Frontend routes
| Route | Description |
|---|---|
/ |
Dashboard |
/products |
Product list |
/products/new |
Add product |
/products/[id] |
Product detail / edit |
/routines |
Routine list |
/routines/new |
Create routine |
/routines/[id] |
Routine detail |
/health/medications |
Medications |
/health/lab-results |
Lab results |
/skin |
Skin condition snapshots |
/profile |
User profile |
Development
cd backend
# Lint
uv run ruff check .
# Format
uv run black .
uv run isort .
# Tests
uv run pytest
Stack
- Backend: Python 3.12, FastAPI, Uvicorn, SQLModel 0.0.37 + SQLAlchemy, Pydantic v2, PostgreSQL (psycopg3)
- Frontend: SvelteKit 2, Svelte 5 (Runes), TypeScript, Tailwind CSS v4, shadcn-svelte
Deployment
See docs/DEPLOYMENT.md for a step-by-step guide for a Proxmox LXC setup (Debian 13, nginx, systemd services).