mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 10:19:40 +08:00
✅ Fixed RAG Provider Selection Persistence: - get_current_provider() now reads from env directly (not cached) - Settings save button now saves environment variables - Backend persists changes to .env file - RAG provider selection survives page refreshes and server restarts ✅ Integrated Plugin System into Knowledge Base Upload Flow: - initializer.py: Use RAG-Anything for extraction + selected plugin for indexing - add_documents.py: Same hybrid approach for adding new documents - Both LightRAG and LlamaIndex work seamlessly end-to-end ✅ Plugin Storage Architecture: - LightRAG: data/knowledge_bases/{kb}/rag_storage/ - LlamaIndex: data/knowledge_bases/{kb}/llamaindex_storage/ - Both auto-create directories, no conflicts ✅ Complete Upload Flow: 1. User uploads files → saved to raw/ 2. System checks RAG_PROVIDER from .env 3. RAG-Anything extracts content (PDFs, images, tables) 4. Extracted text fed to selected RAG plugin 5. Plugin builds index in provider-specific directory ✅ Files Modified: - src/tools/rag_tool.py - Fixed get_current_provider() - web/app/settings/page.tsx - Save env vars in handleSave() - src/api/routers/settings.py - Persist to .env file - src/knowledge/initializer.py - Plugin integration - src/knowledge/add_documents.py - Plugin integration - src/rag/plugins/lightrag.py - Auto-create directories - src/rag/plugins/llamaindex.py - New plugin + auto-create dirs - requirements.txt - Added llama-index dependencies Result: Users can now seamlessly switch between LightRAG and LlamaIndex, upload documents via dashboard, and everything works perfectly from start to end.