- 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
- Refactor knowledge base initialization to support dynamic RAG provider selection
based on RAG_PROVIDER environment variable instead of hardcoded RAGAnything
- Implement VectorIndexer component for dense vector storage
* Support FAISS for fast similarity search when available
* Fallback to pickle-based storage with numpy cosine similarity
* Store normalized vectors and metadata separately
* Create vector_store directory structure for LlamaIndex KBs
- Implement DenseRetriever component for vector-based search
* FAISS-based fast search when available
* Numpy cosine similarity fallback
* Return clean, formatted context without truncation or relevance prefixes
* Compatible with existing RAG pipeline interface
- Update LlamaIndexPipeline to use PDFParser instead of TextParser
* PDFParser uses PyMuPDF for reliable PDF text extraction
* Supports both MinerU pre-parsed content and direct PDF parsing
* Prevents raw PDF binary data from being indexed
- Modify KnowledgeBaseInitializer to use RAGService
* Remove direct RAGAnything instantiation and configuration
* Use RAGService which respects RAG_PROVIDER environment variable
* Support all registered providers: raganything, lightrag, llamaindex, academic
* Add generic statistics display for provider-agnostic KB info
* Reduce initialization code from ~200 to ~90 lines
- Add PyMuPDF dependency for PDF text extraction
* Required for PDFParser to extract clean text from PDF files
* Version constraint: PyMuPDF>=1.23.0
- Fix DenseRetriever output formatting
* Remove relevance score prefixes from retrieved chunks
* Remove 800-character truncation limit
* Use clean newline separators for better LLM context
* Return formatted content suitable for direct LLM consumption
Storage structure comparison:
- RAGAnything/LightRAG: Uses rag_storage/ with knowledge graph files
- LlamaIndex: Uses vector_store/ with FAISS index or pickle embeddings
Key differences:
- RAGAnything: Makes 50-100+ LLM calls during KB creation for entity/relation extraction
- LlamaIndex: Makes 0 LLM calls during KB creation, only embedding API calls
- LlamaIndex is faster, cheaper, and avoids rate limits during indexing
- LLM only used during search/chat to generate final answers from retrieved context
Tested with:
- PDF document parsing and indexing
- Vector similarity search and retrieval
- Dynamic provider switching via environment variable
- Fallback to numpy when FAISS unavailable