- 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
* feat: add comprehensive pre-commit CI hooks
- Add safety for dependency vulnerability scanning
- Add bandit for Python security linting with appropriate skips
- Add interrogate for docstring coverage checking (60% threshold)
- Add mypy for type checking with permissive CI configuration
- Update requirements.txt with safety and bandit dependencies
- Configure all tools for CI compatibility (non-blocking for initial setup)
* security: add hardening measures based on upstream issues
- Add .gitattributes rules to force LF line endings for critical files (fixes CRLF security issues)
- Enhance document validator with MIME type validation and stricter PDF size limits
- Fix subprocess security issues by adding shell=False to prevent command injection
- Add resource exhaustion protection with separate PDF size limits (50MB vs 100MB general limit)
Addresses upstream issues:
- #97: Cross-platform deployment failures due to CRLF line endings
- #31: Large PDF processing failures and resource exhaustion
- Security hardening for subprocess calls to prevent injection attacks
* docs: streamline contribution process and pre-commit checks
- Update and format CONTRIBUTING.md for clarity
- Simplify pull request template
- Adjust pre-commit config to be more lenient locally
* chore: update .gitignore, .secrets.baseline, pyproject.toml, and requirements.txt for improved configuration and dependency management
- Replace custom components with llama-index-core library
- Add CustomEmbedding for OpenAI-compatible APIs (Gemini, OpenAI, Azure)
- Use thread pool executor for async/sync compatibility
- Switch to retriever (no OpenAI LLM required)
- Add PyMuPDF for PDF parsing
- Native llamaindex_storage/ format for ecosystem compatibility
- 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