Restart easyRAG: Medical RAG system using RAG-Anything, PowerSync, TanStack, Bun & Biome#2
Draft
Restart easyRAG: Medical RAG system using RAG-Anything, PowerSync, TanStack, Bun & Biome#2
Conversation
- Python FastAPI backend (apps/api): - config.py: Pydantic Settings with all env vars - main.py: FastAPI app with CORS, routers, startup hooks - services/rag_service.py: RAGAnything singleton with process/query/list/delete - services/powersync.py: PyJWT token generation for PowerSync - routers/documents.py: upload, list, soft-delete - routers/query.py: RAG query endpoint + modes listing - routers/specialists.py: 10 medical specialist roles - routers/powersync.py: JWT token endpoint - pyproject.toml: hatchling build, all dependencies - .python-version: 3.10 - React + Vite frontend (apps/web): - TanStack Router (code-based routing) - PowerSync integration with custom React context - SpecialistSelector: grid of 10 specialist cards - ChatInterface: message list, typing indicator, source citations - DocumentUpload: drag & drop, multi-file, progress feedback - DocumentList: table with status, delete action, refresh - lib/api.ts: typed fetch wrapper - index.css: medical white/blue theme with CSS variables - biome.json: linting/formatting config - Root files: .gitignore, .env.example, README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- main.py: replace deprecated @app.on_event with lifespan context manager - rag_service.py: remove duplicate openai_complete_if_cache import in vision_model_func - routers/query.py: fix return type hint dict[str, list[dict[str, str]]] - router.tsx: use exported Route from __root.tsx instead of creating duplicate rootRoute - DocumentUpload.tsx: wrap processFile and handleFiles in useCallback with proper deps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nStack, Bun & Biome Co-authored-by: HarryBMa <163435833+HarryBMa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Restart RAG-Anything project
Restart easyRAG: Medical RAG system using RAG-Anything, PowerSync, TanStack, Bun & Biome
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the empty scaffold with a full implementation of a multimodal medical RAG system, using RAG-Anything as the core pipeline instead of building retrieval primitives from scratch.
Backend (
apps/api/) — FastAPI + RAG-Anythingservices/rag_service.py— Singleton wrappingRAGAnything; handles document ingestion viaprocess_document_complete(), querying viaaquery(question, mode=mode), and JSON-backed document metadata (list/soft-delete)services/powersync.py— PyJWT-signed tokens for PowerSync client authrouters/documents.py— Multipart upload → RAG-Anything pipeline; list + soft-deleterouters/query.py— POST/api/querywith specialist role injection as system prompt prefix; supportsnaive | local | global | hybridmodesrouters/specialists.py— 10 medical specialist personas (GP, Cardiologist, Neurologist, Radiologist, Pharmacist, Surgeon, Oncologist, Pediatrician, Psychiatrist, Emergency)config.py— Pydantic Settings; all config from env varsFrontend (
apps/web/) — React 19 + Vite + TanStack Router + PowerSyncpowersync/schema.ts— PowerSync schema:documents,messages,specialiststablespowersync/PowerSyncProvider.tsx—PowerSyncDatabasesingleton; connector fetches JWT from/api/powersync/tokencomponents/ChatInterface.tsx— Streaming-style chat UI with typing indicator and inline source citationscomponents/SpecialistSelector.tsx— Card grid for specialist selection; selection passed to chat asspecialist_rolecomponents/DocumentUpload.tsx— Drag & drop; validates extensions before upload; per-file status feedbacklib/api.ts— Typed fetch wrapper; detectsFormDatato omitContent-Type(lets browser set multipart boundary)Config & Tooling
.env.examplecovering both API and frontend env vars (OPENAI_API_KEY,POWERSYNC_URL,POWERSYNC_SECRET,VITE_POWERSYNC_URL)apps/web/biome.json— Biome linting + formatting;bun run lintwired inpackage.jsonapps/api/pyproject.toml—raganything,lightrag-hku,fastapi,uvicorn,pyjwt,pydantic-settings💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.