Commit Graph

226 Commits

Author SHA1 Message Date
Tushar Khatri
9ef0a2a73e feat(kb): allow selecting RAG provider during KB create/upload 2026-01-14 22:34:35 +05:30
Bingxi Zhao (Frank)
e4e5c9b81c Merge pull request #128 from scrrlt/fix/docker-portability
fix/docker
2026-01-14 22:10:05 +08:00
scrrlt
8a9949cdea fix(docker): make Dockerfile portable (no heredoc COPY, ensure bash) 2026-01-14 23:29:02 +11:00
Bingxi Zhao (Frank)
126a0fb469 Merge pull request #126 from scrrlt/feat/precommit-ci
Feature/pre commit ci (#37)
2026-01-14 13:09:04 +08:00
Scarlet Moore
a0433d784e Feature/pre commit ci (#37)
* 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
2026-01-14 13:57:18 +11:00
Bingxi Zhao (Frank)
1447a5987b Merge pull request #118 from scrrlt/integrate/hk-dev
work/llm-error-framework
2026-01-13 14:43:23 +08:00
Scarlet Moore
cddc5160e8 work/llm-error-framework (#35)
* feat: enhance error handling and logging in DocumentAdder

* feat: implement robust error handling utilities for API exceptions

* style: fix formatting issues

* feat: implement retry logic for LLM API calls to handle rate limits and timeouts

* feat: enhance document validation and error handling in file uploads

* feat: enhance valid tools configuration and error handling in project structure

* feat: refactor error handling and validation functions for improved robustness

* fix: pre-commit format

* feat: implement configuration validation for tool consistency and enhance error handling in file uploads

* feat: add exception hierarchy for LLM service errors to improve error handling

* chore: update repo roster images [skip ci]

* chore: update repo roster images [skip ci]

* Integrate documentation updates and rebase onto upstream dev

* Implement error handling utilities and validation functions

* feat: implement multi-provider support with enhanced capability handling and model extraction

* fix: enhance error handling and validation across multiple modules

* chore: remove unused local environment configuration file

* commit

* fix: improve error handling and logging in utilities and error handler

* fix: enhance error handling and logging across multiple modules

* fix: enhance async initialization and validation in multiple modules

* feat: implement LLM error framework

- Add LLM-specific exception classes in exceptions.py
- Create error mapping utilities for standardized error handling
- Implement base provider interface with error handling
- Add OpenAI provider implementation with error mapping
- Define LLM types and response structures

* feat: add missing registry and telemetry modules

- Add registry.py for provider registration system
- Add telemetry.py for basic LLM call tracking
- Complete the LLM error framework implementation

* fix(llm): safer sync wrapper + smarter retries + optional openai mapping

* Fix LLM error framework and code quality improvements

* feat: update environment configuration and improve logging in LLM services

* Update README.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Refactor code structure for improved readability and maintainability

* chore: update documentation, improve error handling, and enhance file upload validation

* feat: enhance error handling and configuration validation across multiple modules

* feat: add configuration for pytest, improve error handling, and enhance byte formatting utilities

---------

Co-authored-by: scrrlt <smo0051@student.monash.edu>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-01-13 16:58:13 +11:00
Scarlet Moore
1010fb9112 Update README.md 2026-01-13 09:28:25 +11:00
github-actions[bot]
05dca48743 chore: update repo roster images [skip ci] 2026-01-12 12:36:49 +00:00
github-actions[bot]
55c7d4c946 chore: update repo roster images [skip ci] 2026-01-12 01:20:08 +00:00
Scarlet Moore
eafdf21dd0 Merge pull request #24 from HKUDS/dev
Dev
2026-01-12 11:12:31 +11:00
github-actions[bot]
9ba33f568a chore: update repo roster images [skip ci] 2026-01-11 12:30:57 +00:00
Bingxi Zhao (Frank)
258e49ac04 Merge pull request #98 from tusharkhatriofficial/feat/llamaindex-pipeline
feat: Implement LlamaIndex and LightRAG pipelines with complete loose coupling
2026-01-11 20:03:52 +08:00
Tushar Khatri
1d985d21cd Implement pure LightRAG pipeline with complete initialization
- Create LightRAGIndexer using LightRAG.ainsert() directly
- Create LightRAGRetriever using LightRAG.aquery() with QueryParam
- Use sync callbacks (LightRAG requirement) and EmbeddingFunc object
- Add 3-step init: create instance, initialize_storages, initialize_pipeline_status
- Remove chunker/embedder (LightRAG handles internally)
- Update factory.py for distinct pipeline implementations
- Fix graph.py imports

Performance: llamaindex 3s, lightrag 10-15s, raganything 60s+
All three pipelines now fully decoupled and functional.
2026-01-11 17:09:50 +05:30
Tushar Khatri
0146ec5e5d Implement true LlamaIndex integration with custom embedding adapter
- 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
2026-01-11 16:09:25 +05:30
Tushar Khatri
2de2772d43 Implement LlamaIndex RAG pipeline with dynamic provider selection
- 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
2026-01-11 15:34:22 +05:30
github-actions[bot]
54845f9dbb chore: update repo roster images [skip ci] 2026-01-11 01:23:19 +00:00
Scarlet Moore
d7d2728a7a Merge pull request #11 from HKUDS/dev
Dev
2026-01-11 11:51:39 +11:00
Bingxi Zhao (Frank)
fe4b973eb9 Merge pull request #95 from Andres77872/web-search-providers
Web search providers
2026-01-11 00:53:59 +08:00
Andres
e3b332fce4 Merge pull request #1 from Andres77872/dev
Dev
2026-01-10 10:34:20 -06:00
andres
56ec4c180b "Remove settings.py and associated settings classes as part of configuration cleanup." 2026-01-10 10:31:45 -06:00
github-actions[bot]
3eae7dc574 chore: update repo roster images [skip ci] 2026-01-10 12:30:09 +00:00
andres
239bc5dcc5 "Clean up formatting and fix code style inconsistencies across web search modules." 2026-01-10 00:49:45 -06:00
andres
a2ec0f202e "Remove deprecated web_search.py and update web search configuration with support for multiple providers." 2026-01-10 00:36:36 -06:00
Bingxi Zhao (Frank)
a41744133d Merge pull request #90 from scrrlt/docs/windows-lp-troubleshooting
docs: update
2026-01-10 12:49:45 +08:00
Scarlet Moore
e98e0f0b1b docs: update 2026-01-10 15:10:32 +11:00
github-actions[bot]
eacbad2061 chore: update repo roster images [skip ci] 2026-01-10 01:14:41 +00:00
Scarlet Moore
8f167c847e Merge branch 'dev' of https://github.com/HKUDS/DeepTutor into integrate/hk-dev 2026-01-10 01:06:21 +00:00
Bingxi Zhao
fe9c169939 fix 2026-01-10 01:54:18 +08:00
Pancake
1b3150e42e improve llm services 2026-01-10 01:08:21 +08:00
Pancake
093c98fbf7 Merge main into dev 2026-01-09 22:29:27 +08:00
Bingxi Zhao (Frank)
3afe109d8c Merge pull request #87 from scrrlt/feat/azure-openai-support
feat: azure openai support
2026-01-09 22:24:21 +08:00
Scarlet Moore
de0e2f27fd feat: enhance Azure OpenAI support in configuration and agent classes 2026-01-09 14:11:17 +00:00
github-actions[bot]
50d8eaf395 chore: update repo roster images [skip ci] 2026-01-09 12:53:28 +00:00
scrrlt
4d8f6bcd9b feat: implement comprehensive Azure OpenAI support across all modules 2026-01-09 23:31:06 +11:00
Bingxi Zhao (Frank)
c8f3363842 update 2026-01-09 16:20:05 +08:00
Pancake
dfd8254861 fix lint 2026-01-09 14:30:28 +08:00
Pancake
f7abd153ef Add sync branch 2026-01-09 14:25:20 +08:00
Pancake
3fab7154b0 fix: official web 2026-01-09 14:20:56 +08:00
Pancake
814bed7452 docs: update website 2026-01-09 14:08:56 +08:00
scrrlt
d8d7045592 tests: add ConfigManager tests for atomic write, deep-merge, env layering 2026-01-09 16:08:18 +11:00
scrrlt
caf059dd94 config: add schema/defaults/accessors; strict validation; atomic writes; env layering; test helpers 2026-01-09 16:08:14 +11:00
scrrlt
8161451d01 web: update lockfile (rebased on upstream/dev) 2026-01-09 16:07:59 +11:00
Pancake
1074cf2071 add CN_config 2026-01-09 13:05:38 +08:00
scrrlt
d35c517532 config: governance foundation (schema validation, atomic writes, env layering, logging) 2026-01-09 16:01:43 +11:00
Scarlet Moore
307c8fda6e Web audit scaffolding: add Playwright config, fix tsconfig types, harden error fallback check and baseURL handling in compliance suite; add audit scripts and devdep for @playwright/test. 2026-01-09 15:59:25 +11:00
github-actions[bot]
c5cc62ea9e chore: update repo roster images [skip ci] 2026-01-09 02:00:42 +00:00
Bingxi Zhao
8b5c45ddc7 docs: release ver0.4.1 v0.4.1 2026-01-09 09:57:00 +08:00
Bingxi Zhao
84509677f5 fix: docker deployment 2026-01-09 09:44:51 +08:00
Bingxi Zhao
df034d854b fix: llm providers, frontend 2026-01-09 09:29:17 +08:00