Zing Forum

Reading

Medical AI Agent: A Telegram-based Medical Consultation Intelligent Agent System

Medical AI Agent is a Telegram-based medical consultation workflow system that integrates AI agents, RAG (Retrieval-Augmented Generation), lab test report extraction, and manual review mechanisms to provide safe and traceable AI-assisted consultation services for both patients and doctors.

医疗AIRAGTelegram Bot智能体人工审核FastAPI医学知识库人机协作健康咨询
Published 2026-05-01 23:45Recent activity 2026-05-01 23:58Estimated read 7 min
Medical AI Agent: A Telegram-based Medical Consultation Intelligent Agent System
1

Section 01

[Introduction] Medical AI Agent: Core Introduction to the Telegram-based Medical Consultation Intelligent Agent System

Medical AI Agent is a Telegram-based medical consultation workflow system. Its core features include: integration of AI agents, RAG (Retrieval-Augmented Generation), lab test report extraction, and a key manual review mechanism, enabling safe and traceable AI-assisted consultation services for both patients and doctors. The system adopts a dual-Bot architecture (patient-side and doctor-side): AI handles information organization and preliminary analysis, while human doctors retain final decision-making authority. Note that this project is for demonstration/portfolio purposes and is not a production-grade medical software suitable for clinical use.

2

Section 02

Project Background: The Challenge of Balancing Innovation and Safety in Medical AI

In the intersection of artificial intelligence and healthcare, the core challenge lies in balancing technological innovation and safety compliance. The Medical AI Agent project addresses this issue with a practical solution: integrating the automation capabilities of AI agents with the professional judgment of human doctors to improve consultation efficiency while ensuring medical safety.

3

Section 03

Core Architecture and Methods: Dual-Bot Design and Application of RAG Technology

Core Architecture and Methods

  1. Dual-Bot Design:
    • Patient Bot: Receives symptom descriptions, guides users to upload lab test reports, provides preliminary information from the knowledge base, and transfers complex issues to the doctor-side Bot;
    • Doctor Bot: Receives AI-preprocessed consultations, reviews AI's preliminary suggestions, conducts professional review and corrections, and sends final recommendations.
  2. RAG Knowledge Base System: Built-in knowledge base of medical literature/guidelines. It generates answers through document vectorization, semantic retrieval, and context-enhanced generation, and supports traceability. The default demo data includes synthetic examples of blood glucose, creatinine, and hemoglobin tests.
  3. Lab Test Report Extraction: Automatically identifies key indicators, extracts values/units/reference ranges, and converts unstructured documents into structured data.
  4. Safety Mechanisms: AI only handles information preparation and does not directly diagnose or prescribe; all outputs must be reviewed by doctors, and built-in safety checks block unsupported requests.
4

Section 04

Technical Implementation Details: Stack Selection and Deployment Guide

Technical Implementation Details

  • Tech Stack: Backend uses FastAPI, Python 3.13 runtime, uv package management, Docker Compose containerization, and Hugging Face model interface;
  • Quick Start: Containerized deployment: uv sync && docker compose up --build; Local development: uv sync && uv run uvicorn app.main:app --reload;
  • Environment Configuration: Copy .env.example to .env and fill in key parameters such as Bot tokens and HF token;
  • Project Structure: Includes directories like app (main entry, API, services, etc.), data (knowledge base), and scripts (evaluation suite).
5

Section 05

Quality Evaluation and Demo Scenarios: Verifying System Effectiveness

Quality Evaluation and Demo

  • Evaluation Dimensions: Extraction quality (indicator completeness, unit accuracy, etc.), factual basis (retrieval evidence relevance), safety (blocking non-compliant requests);
  • Run Evaluation: uv run python scripts/run_minimal_eval_suite.py --case-id case_demo_happy_path (uses synthetic/anonymous data);
  • Demo Scenario: Taking blood glucose consultation as an example, the process is: patient describes symptoms → uploads report → AI extracts and analyzes → doctor reviews → patient receives reply.
6

Section 06

Safety and Compliance Statement: Responsible Medical AI Design

Safety and Compliance Statement

  • This system is a demonstration/portfolio project, not clinically validated, does not meet medical compliance requirements, and is not a production-grade medical software;
  • AI only prepares information for doctors' reference and does not directly diagnose or provide treatment recommendations; human doctors must review all decisions;
  • The demo uses synthetic data; real patient data requires separate legal, safety, and compliance reviews.
7

Section 07

Application Value and Future Directions: Insights for Medical AI Implementation

Application Value and Future Directions

  • Value for Developers: Complete RAG application example, reference for human-AI collaboration mode, demonstration of safety-first design;
  • Insights for Medical AI: Progressive implementation path, transparent and traceable design, regulatory-friendly manual review mechanism;
  • Future Expansion: Multimodal support (medical imaging), knowledge base expansion, personalized health records, follow-up management functions.