MedicalAgent Pro is a FastAPI-based medical triage MVP. The current version supports a rule-based triage workflow, Top3 department suggestions, safety prompts, and Redis-backed multi-turn session memory.
This project is configured locally for Python 3.12:
C:\Users\chnnb\AppData\Local\Programs\Python\Python312\python.exe -m pip install -r requirements.txtOptional Redis settings:
$env:REDIS_URL="redis://localhost:6379/0"
$env:SESSION_TTL_SECONDS="86400"If Redis is not running, the app falls back to an in-memory session store for local development.
uvicorn app.main:app --reloadPOST /api/chat
Single-turn example:
{
"session_id": "session_001",
"message": "我头痛三天了,还恶心,应该挂什么科?"
}Multi-turn example:
{
"session_id": "session_002",
"message": "我头痛"
}Then continue with the same session_id:
{
"session_id": "session_002",
"message": "三天了,还有点恶心"
}Response fields include:
{
"session_id": "session_002",
"answer": "...",
"intent": "guide_patient",
"slots": {},
"departments": [],
"trace_id": "trace_...",
"status": "collecting",
"missing_slots": ["duration"]
}Session data is stored under Redis keys like:
medicalagent:session:{session_id}