ElitorcAI is an advanced multimodal clinical AI assistant that demonstrates real-world agentic workflows using TiDB Serverless for vector search and clinical case analysis. Built for the TiDB AgentX Hackathon, this system showcases multi-step AI agents that go beyond simple RAG to deliver comprehensive clinical decision support.
Multi-Step Agentic Workflow:
flowchart TD
A[π Patient Input<br/>Medical Images + Symptoms] --> B[π Step 1: Medical Image Analysis<br/>Roboflow AI Detection]
B --> C[π§ Step 2: Embedding Generation<br/>Cohere Text Embeddings]
C --> D[π Step 3: Vector Search<br/>TiDB Similarity Search]
D --> E[βοΈ Step 4: Clinical Reasoning<br/>Groq LLM Synthesis]
F[(ποΈ TiDB Serverless<br/>Vector Database)] -.-> D
G[π MultiCaRe Dataset<br/>200+ Clinical Cases] -.-> F
E --> H[π Structured Clinical Report<br/>β’ Primary Diagnosis<br/>β’ Similar Cases<br/>β’ Treatment Plan]
style A fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
style B fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
style C fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
style D fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
style E fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
style F fill:#e6e6e6,stroke:#333,stroke-width:2px,color:#000
style G fill:#e6e6e6,stroke:#333,stroke-width:2px,color:#000
style H fill:#f9f9f9,stroke:#333,stroke-width:2px,color:#000
Dr. AMIE (Advanced Multimodal Intelligence for Emergency care) is a sophisticated clinical AI that:
- Analyzes medical images (X-rays, CT scans, MRI) using Roboflow integration
- Searches clinical databases for similar cases using TiDB vector search
- Provides differential diagnoses with confidence levels
- Recommends diagnostic workups and treatment plans
- Ingests new cases into the knowledge base for continuous learning
- Frontend: Next.js with Mastra framework
- Backend: Unified Mastra server with agent orchestration
- Database: TiDB Serverless with vector search capabilities
- LLM: Groq (Llama 3.3 70B)
- Embeddings: Cohere embed-english-v3.0
- Image Analysis: Roboflow API
- Memory: LibSQL with persistent storage
- Node.js 18+
- TiDB Serverless account
- API keys for Groq, Cohere, and Roboflow
git clone https://github.com/N-45div/ElitOrc-AI
npm install
cp env.example .env
# Configure your API keys in .envnpm run seed # Seed with sample clinical cases
npm run seed:multicare # Seed with MultiCaRe dataset (with embeddings)
npm run test:tidb # Test TiDB connection and functionality
npm run reset:tidb # Reset TiDB tables# Start Mastra server (port 3001)
npx mastra dev
# In another terminal, start Next.js frontend (port 3000)
npm run devVisit http://localhost:3001 for the Mastra playground or http://localhost:3000 for the full chat interface.
Example Queries:
- "A 45-year-old male presents with chest pain, shortness of breath, and fatigue for the past 3 days. He has a history of hypertension and smoking. What should I consider?"
- "Analyze this MRI scan for a patient with lower back pain"
- "Find similar cases for a 67-year-old female with COPD and pneumonia"
- Patient Query Input β Clinical symptoms, medical history, images
- TiDB Vector Search β Find similar historical cases using embeddings
- Image Analysis β Roboflow API processes medical images
- LLM Clinical Reasoning β Groq analyzes all data for diagnosis
- Case Documentation β Novel cases ingested back into TiDB
- Clinical Report β Structured output with recommendations
Patient Input β Embedding Generation β TiDB Vector Search β Similar Cases
β β
Medical Images β Roboflow Analysis β Clinical Context β LLM Analysis
β β
Structured Report β Clinical Reasoning β Combined Evidence β Case History
- Real-World Impact: Actual clinical decision support system
- Multi-Step Agents: Complex workflows beyond simple Q&A
- TiDB Vector Search: Leverages TiDB Serverless vector capabilities
- Continuous Learning: New cases automatically indexed
- Multimodal Integration: Text, images, and structured data
- Clinical case storage with vector embeddings
- Cosine similarity search for case matching
- Scalable cloud-native architecture
- Mastra framework for agent orchestration
- Tool-based architecture with composable functions
- Memory persistence with LibSQL
- Groq: LLM inference with Llama 3.3 70B
- Cohere: High-quality medical text embeddings
- Roboflow: Medical image analysis and detection
- Parquet File Support: Process large medical datasets efficiently
- Batch Processing: Handle thousands of clinical cases with optimized memory usage
- Embedding Generation: Create semantic vectors for similarity search
- Database Migration Scripts: Seamless data import and management
- Multi-modal analysis (text + medical images)
- Evidence-based recommendations with confidence scores
- Similar case retrieval for complex presentations
- Risk stratification based on historical outcomes
- MRI/CT scan analysis with Roboflow integration
- Comparison with similar imaging findings
- Automated reporting with confidence scores
- Case-based learning with similar patient scenarios
- Clinical reasoning development
- Evidence-based medicine integration
- MultiCaRe Dataset Integration: Process large-scale medical case datasets from Zenodo
- Batch Embedding Generation: Efficient processing with Cohere embeddings
- Vector Database Seeding: Populate TiDB with real clinical cases for similarity search
- No PHI stored in vector embeddings
- Anonymized clinical cases only
- HIPAA-compliant architecture ready
- Audit trails for all clinical decisions
This project utilizes the MultiCaRe Dataset for training and evaluation:
- Dataset: MultiCaRe - A Multi-Domain Dataset for Case Report Classification
- Source: Zenodo Repository
- GitHub: MultiCaRe Dataset Repository
- License: Open source dataset for research purposes
- Citation: Nievoff, M., et al. (2024). MultiCaRe: A Multi-Domain Dataset for Case Report Classification
The dataset contains anonymized clinical case reports across multiple medical domains, enabling robust similarity search and clinical decision support capabilities.
- Real-time clinical alerts and notifications
- Integration with EHR systems
- Mobile app for point-of-care use
- Federated learning across healthcare networks
Built for TiDB AgentX Hackathon 2025 | Team: ElitorcAI | License: MIT