79 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
2745e8bde9 feat(book): introduce book capability and restructure guide/co_writer modules
- Add new `deeptutor/book/` module with multi-agent pipeline
  (ideation, spine, page planner, source explorer, synthesizer)
  and rich block system (text, code, figure, quiz, flash cards,
  callout, deep dive, timeline, animation, concept graph, etc.)
- Add `/api/routers/book.py` and `deeptutor_cli/book.py` entry points
- Add web UI under `web/app/(workspace)/book/` with sidebar,
  chat panel, page reader, spine editor, progress timeline, and
  block renderers
- Move `deeptutor/agents/co_writer` -> `deeptutor/co_writer` and
  `deeptutor/agents/guide` -> `deeptutor/guide` (then remove guide
  entirely now superseded by book)
- Remove legacy guide UI, hooks, types, and API router
- Update visualize agents/prompts, notebook service, prompt manager,
  session turn runtime, and shared services to support new flows
- Refresh chat composer, sidebar, notebook selector, and locales

Made-with: Cursor
2026-04-20 00:33:33 +08:00
Bingxi Zhao (Frank)
100576da69 release: v1.1.2 — schema-driven channels, secret masking, RAG simplification, KB-consistency hardening
* TutorBot Channels tab is now schema-driven across every built-in & plugin channel
  (GET /api/v1/tutorbot/channels/schema), with per-field secret reveal toggles.
* Channel secrets are masked end-to-end; raw values only surface via the explicit
  ?include_secrets=true edit-form route. PATCH validates ChannelsConfig at the API
  boundary and returns 422 on bad payloads. reload_channels is serialised by an
  asyncio.Lock and records last_reload_error for the UI.
* Collapsed services/rag/ to a single LlamaIndex pipeline: removed ~2.6k lines of
  unused components/* + pipeline.py + types.py + utils/ + parsers/. rag_provider
  is now a stub; legacy values silently coerce to llamaindex.
* Centralised file routing into services/rag/file_routing.py (FileTypeRouter /
  DocumentType / FileClassification); dropped per-provider extension helpers.
* Defensive RAG/KB consistency: deep_solve / deep_research strip rag/kb when no
  KB is attached; SolveToolRuntime + ResearchPipeline + DecomposeAgent
  short-circuit instead of falling back to non-existent default KBs (DE-all,
  ai_textbook).
* Externalised AgenticChatPipeline prompts into agentic_chat.yaml (zh + en).
* Added Thai README (#337).
* New test modules: file_routing, knowledge_base_config, channel_schema,
  channel_secrets, rag_consistency, research_pipeline_rag.

Full notes: assets/releases/ver1-1-2.md

Made-with: Cursor
2026-04-18 11:33:53 +08:00
Srinivas R Kulkarni
0166009c0b feat(tutorbot): Channels tab, Telegram UI, API channel reload, token reveal (#338)
- Return full channels on GET /tutorbot/{id}; keep list view as channel names only
- PATCH bot when stopped (disk config); PATCH running applies channels + hot-reload listeners
- Add Channels tab: delivery toggles, Telegram fields, merge-safe save, show/hide token
- Extend tutorbot router tests (GET stopped, PATCH stopped/running + reload)
2026-04-18 10:36:45 +08:00
Bingxi Zhao (Frank)
4ef783066c feat(answer-now): per-capability fast paths instead of forced chat reroute
Each capability now owns its own answer-now branch so the early-exit
respects the capability's natural output shape:

- chat            -> synthesize markdown answer (existing behavior)
- deep_solve      -> skip planning + reasoning, jump to writer
- deep_question   -> skip ideation, emit full quiz JSON in one structured call
- deep_research   -> skip rephrase/decompose/research, write report directly
- math_animator   -> skip analysis/design/summary, KEEP code-gen + render
- visualize       -> skip analysis/review, emit renderable code in one call

The orchestrator no longer rewrites answer_now turns into chat. It now
preserves active_capability and only falls back to chat when the
originally selected capability is missing from the registry.

Shared plumbing lives in deeptutor/capabilities/_answer_now.py
(extract gate, trace summary formatter, skip notice, LLM stream
wrapper, chunk joiner). Each fast-path preserves the same result
envelope so QuizViewer / MathAnimatorViewer / VisualizationViewer
render unchanged, and prepends a "Skipped X stage(s)" notice so the
user knows it was a best-effort early exit.

Frontend: handleAnswerNow no longer overrides snapshot.capability.

Tests: rewrote the orchestrator routing tests for the new contract;
added tests/capabilities/test_answer_now.py with 28 cases covering
the helpers and every per-capability fast-path (including unparseable
JSON / invalid render_type / fence-wrapped JSON recovery, and a
math_animator test that verifies analysis/design/summary are NOT
invoked while code-gen + render ARE).

Updated v1.1.1 release notes to reflect the new design.

Made-with: Cursor
2026-04-17 23:32:45 +08:00
Bingxi Zhao (Frank)
e8aa57d737 release: v1.1.1 — universal answer-now, co-writer scroll sync, notebook system unification, tutorbot config refactor
- Promote "Answer now" to a universal escape hatch via answer_now_context;
  orchestrator re-routes any capability to chat._stage_answer_now.
- Co-Writer: draggable split + persistent ratio + line-anchored
  bidirectional scroll sync using a hidden mirror for wrap-aware editor y.
- SaveToNotebookModal: optional message-selection mode with quick presets;
  rebuild transcript / userQuery from the selected subset.
- Adopt the real notebook API (/api/v1/notebook/*) across Knowledge tab,
  guide notebook picker, and save-to-notebook flow; new typed helpers in
  web/lib/notebook-api.ts (listNotebooks/getNotebook/createNotebook/...).
- Extract CollapsibleConfigSection; unify Quiz / Math Animator / Visualize
  / Deep Research panels behind one collapsed-summary header.
- Replace streaming spinner with a dedicated Stop button; persistent
  composer header; mask-gradient on messages container.
- TutorBotManager: public load/save/merge API; atomic write via temp +
  Path.replace; merge_bot_config with explicit-clear semantics; new
  tests/services/tutorbot/test_manager_config.py.
- MarkdownRenderer: trackSourceLines passes data-source-line through;
  RichCodeBlock skips Prism for unlabeled/plaintext fences; mermaid
  detection includes flow/seq/sequence editor.md fences.
- UI/theme: deeper foregrounds + warmer borders for light/Snow themes;
  /guide migrated off hardcoded slate/indigo to design tokens;
  HistorySessionPicker themed and timestamp-seconds bug fixed.
- Filter system messages out of UnifiedChatContext.hydrateMessages and
  ChatMessageList so backend grounding context never renders as a bubble.
- Bug fixes (already merged earlier in dev):
  * tutorbot config wipe on restart (#332)
  * selective_access_log middleware unpack crash (#334/#335)
  * 15 npm security vulnerabilities — jspdf/next/mermaid (#330)
- Drive-by: remove "// README" typo from .env.example_CN.
- Add v1.1.1 release notes and update README.

Made-with: Cursor
2026-04-17 22:43:52 +08:00
Bingxi Zhao (Frank)
9544075d60 v1.1.0-beta
URL-based chat routing, Snow theme, WebSocket heartbeat & auto-reconnect,
ChatComposer perf optimization, embedding provider registry overhaul,
Serper search provider, streaming idle timeout, and expanded test suite.

Made-with: Cursor
2026-04-14 22:11:48 +08:00
jiakeboge
5f0553e3e9 perf(web): fix severe input lag in long conversations (#317)
- Memoize ChatMessageList, UserMessage, and ReferenceChips components.
- Stabilize onRetryMessage callback using useCallback in HomePage.
- Prevent unnecessary re-renders of the entire message history during text input.
2026-04-14 20:10:08 +08:00
Bingxi Zhao (Frank)
8659d996f5 v1.0.3
Question Notebook with bookmarks & categories, Mermaid diagram support
in Visualize, embedding mismatch detection refinement, system message
merging for Qwen/vLLM, LM Studio & llama.cpp providers, Glass theme,
reporting agent retry resilience, and docs migration.

Made-with: Cursor
2026-04-13 03:18:26 +08:00
cskwork
95b0609605 feat: add wrong-answer note for cross-session quiz review
Persist structured quiz mistakes on submission and expose them in a
new review page accessible from the utility sidebar.

Backend:
- New wrong_answers SQLite table (cascade on session delete) with
  add/list/count/update/delete store methods
- Hook POST /api/v1/sessions/{id}/quiz-results to also insert one row
  per incorrect answer, preserving the existing [Quiz Performance]
  text message consumed by the LLM context builder
- New GET /api/v1/wrong-answers (resolved filter + pagination),
  PATCH /{id} (resolved toggle), DELETE /{id}

Frontend:
- New /wrong-answers page under the (utility) route group with
  unresolved/all filter, mark-as-resolved, delete, and session link
- Sidebar nav entry using the NotebookPen icon
- English and Chinese i18n strings for all new UI text

Tests:
- 8 store tests covering filter, cascade, resolved toggle, delete
- 6 router tests including a regression test that record_quiz_results
  still writes the [Quiz Performance] text message
2026-04-12 00:40:06 +09:00
Bingxi Zhao (Frank)
4799aaeef0 fix: improve provider switch 2026-04-11 13:00:54 +08:00
Bingxi Zhao (Frank)
5384224932 fix: leakage repair 2026-04-11 12:23:32 +08:00
Bingxi Zhao (Frank)
445e7622e9 fix: docker, chat with refs 2026-04-10 22:54:58 +08:00
Bingxi Zhao (Frank)
df844b8216 feat: add visualize capability with Chart.js/SVG rendering pipeline
- Add visualize agent pipeline (analysis → code generation → review)
- Add VisualizeCapability with request config and registry wiring
- Add frontend VisualizeConfigPanel, VisualizationViewer components
- Add chart.js and react-chartjs-2 dependencies
- Improve math_animator YON_IMAGE anchor block prompts (en/zh)
- Add minimax model override (supports_response_format: false)
- Suppress noisy uvicorn WebSocket connection logs
- Add selective HTTP access logging middleware (non-200 only)

Made-with: Cursor
2026-04-10 20:09:36 +08:00
Bingxi Zhao (Frank)
d988be7757 Merge commit 'refs/pull/266/head' of github.com:HKUDS/DeepTutor into dev
Made-with: Cursor

# Conflicts:
#	deeptutor/agents/math_animator/renderer.py
2026-04-08 20:08:19 +08:00
Bingxi Zhao (Frank)
5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00
kevin
f6a081812e fix(guide): prevent polling from overwriting user's tab navigation
Backend poll (fetchPageStatuses) returns current_index=0 from
start_learning, which mergePageState unconditionally applied — causing
the UI to snap back to page 1 whenever the user clicked another tab.

Only accept server's current_index when user hasn't navigated yet
(current_index < 0), preserving tab selection during polling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:12:03 +08:00
kevin
055c467a40 fix(guide): fix KaTeX math rendering in Guided Learning pages
- Configure $...$ and $$...$$ delimiters in auto-render (KaTeX default
  only recognizes $$..$$ and \(\..\))
- Remove broken SRI integrity hashes from CDN links (hash mismatch blocks
  resource loading)
- Add parent-window fallback rendering: detects bare LaTeX text nodes
  (e.g. \underbrace, \mathbb without $ wrapping), auto-wraps them,
  then calls renderMathInElement — handles cases where inline init script
  gets corrupted by page content containing </script> strings
- Increase guide agent max_tokens 8192->16384 to prevent HTML truncation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 16:12:03 +08:00
Bingxi Zhao (Frank)
c15e22a4b3 chore: stable fix, add tutorbot 2026-03-20 20:27:17 +08:00
Bingxi Zhao (Frank)
9e8cea8294 fix: update embeddings config & provide perplexity search 2026-03-14 00:37:52 +08:00
Bingxi Zhao (Frank)
f3779138ae fix: remove lightrag and unify llm & search config 2026-03-13 23:48:49 +08:00
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00
Bingxi Zhao (Frank)
91197f3729 chore: deeptutor 2.0 2026-03-13 01:47:38 +08:00
Bingxi Zhao (Frank)
6ff107d960 Merge branch 'dev' into feat/vision_slover 2026-03-09 14:47:53 +08:00
Bingxi Zhao
e1bedcb336 refact solver+questiongen, add base module for personalization 2026-02-12 12:29:16 +08:00
logo
bb01d13d85 实现用于图像分析和 GeoGebra 可视化的视觉求解器模块
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 00:36:22 +08:00
Pancake
0d860a2d12 fix: lint 2026-01-23 01:42:25 +08:00
Pancake
543b507395 feat: add document incrementally 2026-01-22 23:54:45 +08:00
Pancake
100ae27105 feat: add Chinese, frontend persistence, flexible import of rag library 2026-01-21 21:05:48 +08:00
Pancake
cd09c424fe fix: frontend session persistence 2026-01-19 15:48:02 +08:00
Pancake
51902b1491 fix: temperature issues & dockek npm build problem 2026-01-19 14:38:46 +08:00
Bingxi Zhao
3f40ce4301 fix: web lint 2026-01-18 17:40:10 +08:00
Bingxi Zhao
0a96e701ec fix docker & KB init 2026-01-18 17:20:35 +08:00
Bingxi Zhao
1e9cc6b26d fix: KB init & migrate, code structure 2026-01-18 15:30:28 +08:00
Bingxi Zhao
93b5018501 fix: DB init & migrate 2026-01-18 14:49:07 +08:00
Bingxi Zhao
c1752f0512 fix: rag-provider 2026-01-18 13:52:29 +08:00
Bingxi Zhao
b3f511d45f feat: enhance RAG pipeline with Docling support and improve CI/CD workflows 2026-01-18 12:25:45 +08:00
Bingxi Zhao
5a546b53f6 feat: enhance RAG pipeline with Docling support and improve CI/CD workflows 2026-01-18 12:25:45 +08:00
Bingxi Zhao
12a5172a8b fix:docker 2026-01-18 02:59:55 +08:00
Bingxi Zhao
1578a77af6 merge: resolve conflicts from origin/dev 2026-01-15 22:29:30 +08:00
Bingxi Zhao
fdd0aea3a9 refactor: code cleanup and improvements
- Backend: knowledge router, add_documents, initializer, manager updates
- Config: knowledge_base_config, RAG routing improvements
- Frontend: guide components, hooks, knowledge page updates
- Context providers and type definitions cleanup
2026-01-15 22:28:22 +08:00
Pancake
f5b7a2e2df fix: env, file upload, web refactor, llm details 2026-01-15 21:05:16 +08:00
Bingxi Zhao
388bc1359a refactor frontend & rag 2026-01-15 18:41:30 +08:00
Bingxi Zhao
a9be64a0d8 Merge origin/main into dev 2026-01-15 14:09:51 +08:00
Bingxi Zhao (Frank)
74c8d14af0 Merge pull request #127 from ahmedjawedaj/feature/folder-sync-refactored
feat: folder sync with improved architecture (supersedes #122)
2026-01-15 13:31:21 +08:00
Bingxi Zhao
563ceb7724 fix: bandit 2026-01-15 03:21:25 +08:00
Bingxi Zhao
5ffa8405a9 update 2026-01-15 02:55:11 +08:00
Bingxi Zhao
efa3c9ed92 ver0.5.0 2026-01-15 02:51:32 +08:00
Bingxi Zhao
16bc0f4656 ver0.5.0-dev 2026-01-15 02:49:17 +08:00
Tushar Khatri
9ef0a2a73e feat(kb): allow selecting RAG provider during KB create/upload 2026-01-14 22:34:35 +05:30
ahmedjawedaj
accfcb1d8e feat: refactor UX with toast notifications and FolderSyncManager component
- Replace all alert() calls with toast notifications for better UX
- Extract FolderSyncManager component to reduce page.tsx complexity
- Add toast notification system with success/error/info states
- Add missing icons (CheckCircle2, AlertCircle) for toast UI
- Improve code organization per PR #122 feedback

Addresses PR #122 reviewer comments on architecture and UX
2026-01-14 13:32:48 +05:00