Skip to content

Comments

Feat: Released FastAPI Service for RAG-Anything#190

Open
LaansDole wants to merge 57 commits intoHKUDS:mainfrom
LaansDole:feat/service
Open

Feat: Released FastAPI Service for RAG-Anything#190
LaansDole wants to merge 57 commits intoHKUDS:mainfrom
LaansDole:feat/service

Conversation

@LaansDole
Copy link
Contributor

@LaansDole LaansDole commented Jan 18, 2026

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):

# Install FastAPI and Uvicorn into the existing uv environment
uv sync

# Run the server (reload for dev)
uv run uvicorn api.app:app --reload
# or using make
make server

Command Reference:

Action Make Command Full UV Command
Start Server make server uv run uvicorn api.app:app --reload
Run Integration Test make integration-test uv run python api/core_endpoint_test.py api/datasets/patient_records_small.xlsx
Run Mock Test make mock-test uv run python api/core_endpoint_test.py api/datasets/medical_symptoms_small.xlsx
Dev Mode make dev uv run uvicorn api.app:app &
Stop Server make stop pkill -f "uvicorn api.app:app"

Related Issues

[Reference any related issues or tasks addressed by this pull request.]

Changes Made

  • FastAPI services based on RAG-Anything features
  • Enhancement on Excel processing supports

Checklist

  • Changes tested locally
  • Code reviewed
  • Documentation updated (if necessary)
  • Unit tests added (if applicable)

Additional Notes

[Add any additional notes or context for the reviewer(s).]

@HKUDS HKUDS deleted a comment from cursor bot Jan 20, 2026
@HKUDS HKUDS deleted a comment from cursor bot Jan 20, 2026
@HKUDS HKUDS deleted a comment from cursor bot Jan 20, 2026
@HKUDS HKUDS deleted a comment from cursor bot Jan 20, 2026
@LarFii
Copy link
Collaborator

LarFii commented Jan 20, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1318 to +1321
if name:
converted_lines.append(
f"{name}<|#|>{entity_type}<|#|>{description}"
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +76 to +80
"""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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@LarFii
Copy link
Collaborator

LarFii commented Jan 20, 2026

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.

@LaansDole
Copy link
Contributor Author

Hi @LarFii please let me know if you want to request any changes or information

@LarFii
Copy link
Collaborator

LarFii commented Feb 8, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants