From 64089f8f3498e9966d6bc019ee2ccaa74b7bdf01 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 28 Feb 2026 19:23:43 -0500 Subject: [PATCH] Update summary.md for session: intent fixes, note picker, model default fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes documented: - search_web over-triggering fix: _PRIOR_WORK_REFS fast-path in intent.py skips LLM when user references prior notes/research; search_web scoped to genuine real-time lookups only; creative/brainstorming → null (chat) - Intent model default updated to qwen2.5:7b - Note picker now adds to persistent includedNotes (not one-shot attachedNote) - Default model empty-string fix: delete_setting() + or Config.OLLAMA_MODEL guards Co-Authored-By: Claude Sonnet 4.6 --- summary.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/summary.md b/summary.md index 54c074c..36174b8 100644 --- a/summary.md +++ b/summary.md @@ -12,7 +12,7 @@ > Include file-level details in the commit body when the change is non-trivial. ## Last Updated -2026-02-27 — Phase 22: SearXNG web research pipeline + performance improvements (parallel fetching, streaming synthesis, intent skip heuristic, intent num_ctx) +2026-02-28 — Intent routing fixes (search_web over-triggering, prior-work fast-path), note picker → persistent context, intent model upgrade to qwen2.5:7b, default model setting fix ## Project Overview Fabled Assistant is a self-hosted note-taking and task-tracking application with @@ -572,11 +572,11 @@ When adding a new migration, follow these conventions: - Note-aware context building: current note + keyword search for related notes + URL fetching - **Context sidebar (Phase 21):** Right panel in ChatView shows two sections: **Suggested** (auto-found by semantic/keyword search — click `+` to include) and **In Context** (explicitly included by user — - click `×` to remove). Removing an included note moves it back to Suggested. Manually attached note - appears with 📌 pin in the In Context section, clears after send. Hidden on mobile (≤768px). + click `×` to remove). Removing an included note moves it back to Suggested. Hidden on mobile (≤768px). Auto-found notes are shown as sidebar candidates only — they are NOT injected into the system prompt automatically, keeping the system prompt prefix stable for Ollama KV cache reuse. -- Note picker (paperclip) in chat input; attached note title passed to store for optimistic render. +- Note picker (paperclip) in chat input adds notes directly to **persistent** `includedNotes` (not a + one-shot attachment) — picked notes appear in "In Context" and remain for the entire conversation. `context_note_title` synthesised server-side at conversation load via batch `get_notes_by_ids()`; message badge shows note title instead of "Note #N". - LLM-generated conversation titles (re-generated every 10th message) @@ -638,7 +638,7 @@ When adding a new migration, follow these conventions: No optimistic streaming queue or race — eliminates wasted GPU prefill when intent won the race. `IntentResult.ack` (one-sentence acknowledgment) is embedded in the intent JSON output, so no additional LLM call is needed for acknowledgment. Intent model `max_tokens` 350 (was 200). - Dedicated intent model configurable via `OLLAMA_INTENT_MODEL` env var (default `qwen2.5:1.5b`) + Dedicated intent model configurable via `OLLAMA_INTENT_MODEL` env var (default `qwen2.5:7b`) or per-user `intent_model` setting — smaller/faster model for routing. Main model default is `qwen3:latest` (configurable via `OLLAMA_MODEL` env var or per-user `default_model` setting — both settable as dropdowns in the Settings UI populated from installed models). @@ -659,6 +659,19 @@ When adding a new migration, follow these conventions: "can you explain that?", "okay" without risking missed tool calls on longer or action-verb messages. - **Intent `num_ctx=4096`:** Intent classification calls use a 4k context window (override) instead of the default, reducing VRAM pressure and prefill time on every request. + - **Prior-work fast-path:** `_PRIOR_WORK_REFS` regex in `intent.py` detects phrases like "research + you did", "note you made", "using your research", "based on the research" etc. and returns no-tool + immediately — skips the LLM call entirely so the main model answers using `search_notes`/context + instead of firing a web search. Prevents `search_web` being triggered when the user references + existing notes. + - **`search_web` scoping rules:** Intent prompt explicitly prohibits `search_web` for creative/ + brainstorming requests, game design, writing help, or when the user references existing notes. + Creative/ideation requests ("think of", "come up with", "brainstorm") always route to null (chat). + `search_web` is only for genuinely new real-time facts not in the user's notes. +- **Default model setting fix:** `delete_setting()` added to `services/settings.py` — saving an empty + model value in Settings now deletes the DB row rather than storing `""`, so `get_setting()` falls + back to the `Config` default. Safety net `or Config.OLLAMA_MODEL` guards added in `routes/chat.py` + status, message, and summarize routes to prevent empty-string model from breaking readiness indicator. - **Web research pipeline (Phase 22):** `research.py` implements a full autonomous research pipeline triggered by "research X and make a note" (intent routes to `research_topic` tool) or via the 🔍 Research button in ChatView (sends "Research: {topic}" message).