Connects to InterSystems IRIS vector database for medical data storage, enabling GraphRAG entity and relationship queries, FHIR document search, and hybrid vector search with COSINE similarity.
Integrates NVIDIA NIM for generating 1024-dimensional embeddings used in medical document vectorization and semantic search.
Supports comprehensive testing suite including unit, integration, and end-to-end tests for the medical GraphRAG platform.
Implements MCP server tools using Python for medical search operations, FHIR document retrieval, and GraphRAG queries.
Provides interactive chat UI for medical queries with conversation history, execution transparency, and visualization of medical data and relationships.
Medical GraphRAG Assistant
A production-ready medical AI assistant platform built on Model Context Protocol (MCP), featuring GraphRAG multi-modal search, FHIR integration, and AWS Bedrock Claude Sonnet 4.5.
Originally forked from: FHIR-AI-Hackathon-Kit
What This Is
This is an agentic medical chat platform that uses:
š¤ Model Context Protocol (MCP) - Claude autonomously calls medical search tools
š§ GraphRAG - Knowledge graph-based retrieval with entity and relationship extraction
š„ FHIR Integration - Full-text search of clinical documents
āļø AWS Bedrock - Claude Sonnet 4.5 with multi-iteration tool use
š Interactive UI - Streamlit interface with execution transparency
šļø InterSystems IRIS - Vector database with GraphRAG tables
Quick Start
1. Run the Streamlit Chat Interface
Visit http://localhost:8501 and start chatting!
2. Use as MCP Server (Claude Desktop, etc.)
Architecture
Features
MCP Tools (6 total)
search_fhir_documents - Full-text search of clinical notes
get_entity - Retrieve specific medical entities by ID
search_entities_by_type - Find entities by type (Condition, Medication, etc.)
get_entity_relationships - Get all relationships for an entity
search_relationships_by_type - Find relationships by type (treats, causes, etc.)
hybrid_search - Combined vector + graph search with relevance ranking
Chat Interface Features
ā Execution Transparency - See which tools Claude calls and its reasoning
ā Interactive Charts - Generate visualizations from data
ā Conversation History - Multi-turn conversations with context
ā Error Handling - Graceful handling of API issues with detailed logs
ā Max Iterations Control - Prevents infinite loops (10 iteration limit)
ā Type-Safe Content Processing - Robust handling of mixed content formats
Current Version: v2.10.2
Recent Improvements:
Fixed "'str' object has no attribute 'get'" error with proper type checking
Increased max iterations from 5 ā 10 for complex queries
Added execution details with expandable UI
Improved error messages with context
Configuration
Required Environment Variables
Config Files
config/fhir_graphrag_config.yaml- Local development configconfig/fhir_graphrag_config.aws.yaml- AWS deployment configconfig/aws-config.yaml- AWS infrastructure settings
Project Structure
Technology Stack
AI/ML:
AWS Bedrock (Claude Sonnet 4.5)
NVIDIA NIM Embeddings (1024-dim vectors)
Model Context Protocol (MCP)
Database:
InterSystems IRIS (Vector DB + GraphRAG tables)
Native VECTOR(DOUBLE, 1024) support
COSINE similarity search
Infrastructure:
AWS EC2 (for IRIS database)
Python 3.10+
Streamlit for UI
Key Libraries:
intersystems-irispython- IRIS native clientboto3- AWS SDKstreamlit- Chat UImcp- Model Context Protocol SDK
Example Queries
Try these in the chat interface:
FHIR Search:
"Find patients with chest pain"
"Search for diabetes cases"
"Show recent emergency visits"
GraphRAG:
"What medications treat hypertension?"
"Show me the relationship between conditions and procedures"
"What are the side effects of metformin?"
Hybrid Search:
"Find treatment options for chronic pain" (combines vector + graph search)
Visualization:
"Show a chart of conditions by frequency"
"Graph the most common medications"
Development
Running Tests
Debug Mode
Enable debug logging:
Troubleshooting
See docs/troubleshooting.md for common issues.
Common Issues:
AWS credentials not configured ā Set AWS_PROFILE or AWS env vars
IRIS connection failed ā Check IRIS_HOST and credentials
Max iterations reached ā Query may be too complex, try simplifying
Documentation
Architecture Overview - System design and data flow
Deployment Guide - AWS deployment instructions
MCP Server Complete - MCP implementation details
Development History - Session notes and findings
Contributing
This project is based on the FHIR-AI-Hackathon-Kit. The original tutorial content remains in the tutorial/ directory.
License
Inherits license from upstream FHIR-AI-Hackathon-Kit repository.
Acknowledgments
Original Project: FHIR-AI-Hackathon-Kit by gabriel-ing
InterSystems IRIS for the vector database platform
AWS Bedrock for Claude Sonnet 4.5 access
Model Context Protocol by Anthropic
This server cannot be installed