Feat: Released FastAPI Service for RAG-Anything#190
Feat: Released FastAPI Service for RAG-Anything#190LaansDole wants to merge 57 commits intoHKUDS:mainfrom
Conversation
- Add documentation for running in an offline environment. - Add a script to create a local tiktoken model cache. - Update env.example with TIKTOKEN_CACHE_DIR.
Sync fork
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9d6e35d54
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if name: | ||
| converted_lines.append( | ||
| f"{name}<|#|>{entity_type}<|#|>{description}" | ||
| ) |
There was a problem hiding this comment.
Emit LightRAG entity prefix in format conversion
When converting multimodal JSON responses, _convert_to_lightrag_format emits lines like name<|#|>TYPE<|#|>desc without the entity<|#|> prefix that LightRAG-format strings use elsewhere in this repo (see BaseModalProcessor._convert_to_lightrag_format in raganything/modalprocessors.py). Because _process_extraction_result expects the tagged tuple format, these untagged lines are treated as invalid and the extracted entities/relations for multimodal chunks end up empty; this shows up whenever the LLM returns JSON entities/relations and this conversion path runs.
Useful? React with 👍 / 👎.
| """Cancel all background tasks""" | ||
| tasks_to_cancel = [task for task in background_tasks if not task.done()] | ||
| if tasks_to_cancel: | ||
| logger.info(f"Cancelling {len(tasks_to_cancel)} running tasks...") | ||
| await asyncio.gather(*tasks_to_cancel, return_exceptions=True) |
There was a problem hiding this comment.
Actually cancel background tasks on shutdown
cancel_all_background_tasks only awaits the still-running tasks without cancelling them or signaling shutdown_event. During shutdown (e.g., while a long process_document_complete or query is in flight), this will block indefinitely waiting for those tasks to finish instead of cancelling them, preventing the server from shutting down promptly.
Useful? React with 👍 / 👎.
|
Thank you very much for your contribution. The content is quite extensive, so we may need some time to carefully review it. We truly appreciate your effort and patience. |
|
Hi @LarFii please let me know if you want to request any changes or information |
I’m very sorry I forgot to mention this earlier. We’ve recently been working on integrating LightRAG and RAG-Anything, so we may need to wait until this work is finished. My apologies again for the delay. |
Description
Spin up a minimal API server to query and process documents using RAG-Anything with any OpenAI-compatible backend (LM Studio, Ollama, vLLM, DeepSeek, etc.).
Quick start (using uv):
Command Reference:
make serveruv run uvicorn api.app:app --reloadmake integration-testuv run python api/core_endpoint_test.py api/datasets/patient_records_small.xlsxmake mock-testuv run python api/core_endpoint_test.py api/datasets/medical_symptoms_small.xlsxmake devuv run uvicorn api.app:app &make stoppkill -f "uvicorn api.app:app"Related Issues
[Reference any related issues or tasks addressed by this pull request.]
Changes Made
Checklist
Additional Notes
[Add any additional notes or context for the reviewer(s).]