How anuragbiradar2305/medical-agent-rag works
Medical Agent RAG is a Laravel web application for uploading medical documents and asking questions answered from their content, with strict and hybrid response modes. The main flow is upload → document extraction and vector indexing → query embedding and retrieval → mode-dependent answer generation → chat response with sources. The sampled controller and RagAgent show the orchestration and retrieval wiring; framework-internal indexing details and the MedicalAgent implementation were not sampled, so those links are kept at the documented integration level.
Main entry points: MedicalAgentController.php Agent controller · RagAgent.php RAG agent · web.php Web routes · MedicalAgent.php Medical agent
Components 10
Web experience
- Web routes
routes/web.php - Agent controller
app/Http/Controllers/MedicalAgentController.php - Agent pages
resources/views/agent - Chat answer and sources
app/Http/Controllers/MedicalAgentController.php
Document ingestion
- Document loader
Retrieval and answers
- RAG agent
app/Neuron/RagAgent.php - Vector store
app/Neuron/RagAgent.php - Medical agent
app/Neuron/MedicalAgent.php
Other components
- User
- Gemini API
Connections 13
- User → Web routes: requests pages
- Web routes → Agent controller: dispatches
- Agent controller → Agent pages: renders pages
- User → Agent controller: uploads or asks
- Agent controller → Document loader: extracts documents
- Agent controller → RAG agent: indexes documents
- Agent controller → RAG agent: retrieves matches
- RAG agent → Vector store: searches vectors
- RAG agent → Gemini API: embeds text
- Agent controller → Medical agent: selects mode and prompts
- Medical agent → Gemini API: generates answer
- Agent controller → Chat answer and sources: returns answer and sources
- Chat answer and sources → User: displays response