Skip to content

assignment-sets/general-medical-rag

Repository files navigation

API (no TLS)

Base URL: http://34.100.218.51:8000

Health

GET /health
Returns service status.

  • 200 application/json
    • Body: {"status":"ok"}

Example:

curl -sS http://34.100.218.51:8000/health

Medical RAG (JSON response)

POST /rag/med/retrieve
Runs the medical RAG pipeline and returns a single JSON response.

Request (application/json)

{
  "query": "What are the symptoms of appendicitis?",
  "session_id": "demo-session-1"
}

Response

  • 200 application/json
    • Body:
      { "response": "<ai_answer>" }
  • 400 application/json (query must be a meaningful question; at least two words)
    • Body: {"error":"Query must be a meaningful medical question (at least two words)."}
  • 500 application/json
    • Body: {"error":"<exception message>"}

Example:

curl -sS -X POST http://34.100.218.51:8000/rag/med/retrieve \
  -H 'Content-Type: application/json' \
  -d '{"query":"What are the symptoms of appendicitis?","session_id":"demo-session-1"}'

Medical RAG (streaming response)

POST /rag/med/retrieve/stream
Runs the medical RAG pipeline and streams the answer as plain text.

Request (application/json)

{
  "query": "Explain the difference between type 1 and type 2 diabetes.",
  "session_id": "demo-session-1"
}

Response

  • 200 text/plain (streamed)
  • 400/500 application/json with the same error shapes as /rag/med/retrieve

Example (streaming):

curl -N -X POST http://34.100.218.51:8000/rag/med/retrieve/stream \
  -H 'Content-Type: application/json' \
  -d '{"query":"Explain the difference between type 1 and type 2 diabetes.","session_id":"demo-session-1"}'

run server

uvicorn main:app --host 0.0.0.0 --port 8000

About

AI RAG impl for detailed medical analysis using data from medical encyclopedia and books with web search to prevent bad retrieval based hallucinations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors