From 3de7c5eed5ba262abf0d746211e33800db6d66df Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Fri, 8 May 2026 03:24:36 -0700 Subject: Add recipe suggestions, chat tab, and major workflow improvements - Replace 7-day grid menu with browsable recipe suggestion cards (swap, remove, make this) - Add Chat tab: conversational AI with full pantry/menu/grocery context - Grocery list works without a menu (pantry-only mode) - Individual grocery checkboxes auto-add items to pantry - Swap modal with optional preference input - User notes textarea on menu and grocery generation - Clear button for menu and grocery list - LLM notes/summary displayed after generation, persisted to DB - Favicon linked in HTML - Category dropdown styled for dark theme - System prompt configurable via SYSTEM_PROMPT in .env - Fix startup error (ollama_timeout default), DB migration for menu_plans.notes - Simplify: batch N+1 queries, extract _current_monday(), merge chat sync fns, asyncio.get_running_loop(), fix currentGroceryId bug, cap chat history Co-Authored-By: Claude Sonnet 4.6 --- README.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2674b7b..fd7eb8f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # Commis -An AI-powered personal chef that tracks your pantry, logs what you've eaten, and generates a rotating weekly menu and grocery list — all running locally via Ollama. +An AI-powered personal chef that tracks your pantry, logs what you've eaten, and generates recipe suggestions and grocery lists — all running locally via Ollama. ## Requirements - Python 3.11+ -- [Ollama](https://ollama.com) running locally with a model pulled (e.g. `ollama pull llama3`) +- [Ollama](https://ollama.com) running locally with a model pulled (e.g. `ollama pull llama3.1`) ## Setup ```bash pip install -r requirements.txt -cp .env.example .env # or edit .env directly +cp .env.example .env # then edit .env uvicorn main:app --reload ``` @@ -21,23 +21,28 @@ Open [http://localhost:8000](http://localhost:8000). ``` OLLAMA_HOST=http://localhost:11434 -MODEL_NAME=llama3 +MODEL_NAME=llama3.1 DATABASE_URL=sqlite:///./chef.db +OLLAMA_TIMEOUT=120 +SYSTEM_PROMPT=You are a professional chef assistant... ``` -Change `MODEL_NAME` to any model you have pulled locally (`mistral`, `llama3.1`, etc.). +`MODEL_NAME` can be any model you have pulled locally. `SYSTEM_PROMPT` controls the AI's priorities for recipe and grocery generation — edit it to change the style, dietary focus, or constraints. The chat tab uses its own dynamic prompt built from your kitchen context. ## Features -**Pantry** — Add ingredients with quantities, units, categories, and expiry dates. Items expiring within 7 days are highlighted; within 2 days flagged red. +**Pantry** — Add ingredients with quantities, units, categories, and expiry dates. Items expiring within 7 days are highlighted. -**Meal Log** — Record what you eat. Commis tracks the last 14 days of history so the AI knows what to avoid repeating. +**Meal Log** — Record what you eat with optional ingredient tracking. Commis uses the last 14 days of history to avoid recommending things you've recently had. -**Weekly Menu** — Hit "Generate Menu" and Ollama builds a 7-day breakfast/lunch/dinner plan based on what's in your pantry, prioritizing ingredients expiring soon and avoiding recent repeats. +**Recipe Suggestions** — "Generate Menu" asks Ollama for 8–12 diverse recipe ideas based on your pantry and meal history. Recipes use a type badge (breakfast / lunch / dinner), show time and serving estimates, and display full ingredients and instructions. Each card has: +- **Make This** — jumps to the meal log pre-filled with the recipe +- **Swap** — opens a prompt where you can optionally describe what you want, then replaces that card with a new AI suggestion +- **Remove** — removes the recipe from this week's suggestions -**Grocery List** — After generating a menu, "Generate List" diffs the menu's ingredient needs against your pantry and produces a cost-estimated shopping list grouped by store section. "Mark All Purchased" auto-updates your pantry. +**Grocery List** — "Generate List" produces a cost-estimated shopping list grouped by store section (produce, dairy, protein, etc.). If a weekly menu exists, the list is scoped to those recipes and subtracts what you already have. Without a menu it suggests general pantry staples. Checking off an individual item immediately adds it to your pantry. "Mark All Purchased" does the same for everything at once. -**Quick Recipe** — `POST /api/ai/suggest-recipe` returns one recipe you can make right now from what's on hand. +**Chat** — A persistent chat tab where you can talk to Commis directly. It has full visibility into your current pantry, this week's recipes, and your grocery list, and maintains conversation history for the duration of the browser session. ## API -- cgit v1.3-2-g0d8e