Spaces:
Sleeping
Sleeping
Commit History
-
fix: Round 14 — 28 Tier 1 + Tier 2 bugs fixed across 17 source files
Anti-hallucination integrity (T1): - #100: Detect verification LLM system failure (all calls fail → refuse) - #101: Fix validate_citations SQL/web source matching (dead code → working) - #102: Citation count uses chunks (citable units) not unique files - #103: Clamp max_iterations to min 1 (can't bypass via iterations=0) Pre-release quality (T2 HIGH): - #104: Add LIKE ESCAPE in all SQL fallback paths - #105: Gemini safety block returns "" (was bypassing stack) - #106: Cap reasoning model budget at 128000 - #107: Handle non-numeric temperature/max_tokens gracefully - #108: Fix clarification history duplication Pre-release quality (T2 MEDIUM): - #109: Anthropic temperature clamp to 1.0 - #110: SQL query 10-second timeout via progress handler - #111: Rich markup escape for user/LLM content - #112: All 6 readers wrapped in try/except (corrupt files don't abort) - #113: Collection cache invalidation after re-ingestion - #114: Web UI message history capped at 200 - #115: Setup wizard confi…f95cdb7 -
fix: pre-release audit round 12 — 33 bugs fixed across all tiers
Tier 1 (ship-blockers): - README/verifier layer count corrected to 7-layer/10-point - SQL keyword regex now strips quoted strings before checking - validate_citations counts unique sources, extracts from body only - Provider-specific error messages for all 3 LLM backends - Missing config error handling in ingest.py entry point Tier 2 (quality): - SQL injection: alphanumeric validation on interpolated values - LIKE wildcard escaping with ESCAPE clause - Fallback builds fresh keyword query instead of re-running failed SQL - NaN/NaT/inf filtering across all tabular readers - Merged docx table cells deduplicated via element identity - .env double-escaping fix in setup wizard - Verification LLM exceptions skip correction instead of triggering it - References check handles SQL and web sources - Dead pre-loop validate_citations removed - KB meta extension detection uses Path.suffix - QU prompt omits SQL fields when no schema available - Redundant collection.count() eliminated - Row padding f…fbd18c8
-
feat: brief KB overview for system prompt + original query cross-check
- System prompt now uses a concise 3-5 sentence KB overview instead of the full detailed listing, saving tokens for actual context - QU prompt still gets the full detailed overview for routing decisions - Response LLM now sees the original raw input alongside the reformulated display_query so it can cross-check intent if QU misunderstood Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c23d859 -
fix: SQL fuzzy matching fallback for country names with alternate forms
Exact match (=) tried first; if 0 rows, auto-retries with LIKE '%...%'. Match type (exact/fuzzy) transparently reported in UI source summaries. Fixes queries like "South Korea" matching "South Korea (Republic of Korea)". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>6b689a5 -
feat: LLM-generated welcome summary for knowledge base contents
Replace raw KB overview on welcome page with a concise, friendly LLM-generated summary that highlights available topics, data volume, and suggests example questions. Falls back to truncated raw text if LLM call fails. Web UI caches summary in session state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>7e9f52f -
feat: show KB overview summary on welcome page in both CLI and web UI
Loads the KB meta overview (generated during ingestion) and displays it when the chatbot starts, so users immediately see what is in their knowledge base. - CLI: KB summary shown in the welcome panel (truncated to ~600 chars) - Web: KB summary shown in an expandable section before the first message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>89e2c52 -
fix: Round 8 audit — 15 bugs fixed across 10 files (1 CRITICAL, 7 HIGH, 3 MEDIUM, 4 LOW)
Security fixes: - CRITICAL: execute comment-stripped SQL query (not original) to prevent injection bypass - HIGH: iterative comment stripping to handle nested comment attacks - HIGH: expand dangerous SQL keyword blocklist from 11 to 23 entries - HIGH: data loss prevention — deferred clear only on first successful embed Robustness fixes: - HIGH: parse_verification_result(None) crash guard - HIGH: try/except on all verification loop generate() calls - HIGH: empty rows guard in Excel reader - MEDIUM: strict boolean normalization for verification pass/fail - MEDIUM: R-style "na" added to null string detection - MEDIUM: broad exception handling for Gemini API errors Minor fixes: - LOW: distinct error message for empty LLM response vs no sources - LOW: bounds check on setup wizard model selection - LOW: route/sql_query keys in CLI and web fallback dicts - LOW: SQL fallback extended to route="both" Cross-checked by 2 verification agents — all fixes confirmed correct. 165/165 tests passing,…9093d8f -
fix: 10 bugs (4 HIGH + 6 MEDIUM) from comprehensive codebase audit
HIGH fixes: - H1: Gemini blocked-response detection in verifier (safety filter short-circuit) - H2: Config load crash guard in app_web.py (st.stop instead of traceback) - H3: Brace-escape user text in kb_meta.py prompts (prevent KeyError) - H4: Web UI clarification state tracking (pending_clarification_question) MEDIUM fixes: - M1: Preserve leading zeros as TEXT in sql_ingest type inference - M2: Deferred clearing in ingest.py prevents data loss on total failure - M3: Strip markdown fences from LLM-generated SQL in sql_retriever - M4: max_iterations=0 guard in verifier (skip verification, do not refuse) - M5: Add clarification QA to conversation history for pronoun resolution - M6: Remove hardcoded knowledge_base/ prefix in retriever source paths Also adds CLAUDE.md, docs/plans/, full test suite (162 tests, 17 files), and updates WORKLOG.md with audit results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1330e5c
-
fix: harden source display, subdirectory paths, and chunk ID uniqueness
- app_cli: _format_sources now includes SQL results in /sources output - ingest: source_name uses full relative path (preserves subdirectories) - ingest: chunk IDs use full path prefix to prevent collisions - kb_meta: import _escape_braces from prompts instead of duplicating Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>01b9f34 -
fix: improve clarification context and meta-question routing
- Include clarification Q&A in combined query string so the QU layer gets full context (app_cli.py + app_web.py) - Route meta-questions about data availability to vector search, not SQL (src/prompts.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>c014da5 -
fix: prevent NameError when QU disabled and fix connection leak
- Add route="vector" and sql_query=None defaults before the `if qu_enabled:` block in both app_cli.py and app_web.py, preventing NameError when query understanding is disabled. - Wrap sqlite3 connection in try/finally in sql_retriever.py to ensure conn.close() runs even if execute/fetchmany raises. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>39c2d11 -
feat: wire SQL routing through CLI and web UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>20d594f -
fix: harden codebase against format injection, empty responses, and unsafe config access
- Add _escape_braces() to all prompt builders to prevent str.format() crash when user documents contain {placeholder} patterns - Fix app_web.py display_query fallback to preserve clarification context - Add empty-response guards to all 3 LLM providers (openai, anthropic, gemini) - Replace all remaining direct dict access with .get() + defaults - Add 2 regression tests for curly-brace format injection - Expand query engine tests with display_query coverage - 62 tests pass across 13 test files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9815e49 -
feat: add query understanding layer for better retrieval
Pre-retrieval LLM step that reformulates user queries into search-optimized forms (expanded keywords, resolved pronouns, domain-aware terms) and optionally asks clarification questions. - New src/query_engine.py with understand_query() + JSON parsing - New prompt template in src/prompts.py - CLI: query understanding + conversation history + clarification flow - Web UI: query understanding + pending_clarification state - Config: query_understanding.enabled/max_history/max_clarifications - 10 new tests (59 total, all passing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>ebd834c -
style: hide distance scores from /sources output
Distance scores are an internal metric not useful for end users. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>06249fb -
feat: show web search status in welcome panel
Displays whether web search is ON or OFF with color indicator, and tells the user how to toggle it with /websearch on|off. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>44c8a3e -
style: make welcome message more personal and conversational
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>e47c16c -
feat: add chatbot introduction to CLI welcome panel
Adds a short description of what the chatbot does: answers from your documents only, cites every claim, uses 6-layer verification, and refuses rather than guessing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>fb04f6f -
Initial commit: RAG Research Chatbot Template
Citation-verified research assistant with 6-layer anti-hallucination stack, 15 file format readers, 3 LLM providers, and dual CLI/Web interfaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0017280