An AI-powered radiology education tool that finds and summarizes authoritative Radiopaedia content to answer radiology-related questions. Built with FastHTML, DSPy, and modern LLM technology.
wilhelm.ai combines large language models with radiological information from Radiopaedia.org to provide fast, transparent, and educational answers to radiology questions. The application features intelligent search, content retrieval, and streaming answer generation with source verification.
- Intelligent Search: Uses DSPy to extract relevant medical topics from user queries
- Content Retrieval: Automatically finds and caches relevant Radiopaedia articles
- Streaming Responses: Real-time answer generation with visual feedback
- Source Transparency: Direct links to original Radiopaedia content for verification
- Caching: SQLite-based caching for improved performance
- Modern UI: Clean, responsive interface built with FastHTML and Tailwind CSS
The application consists of several key components:
- Frontend (
main.py): FastHTML-based web interface with SSE streaming - Backend Logic (
lib.py): DSPy modules for search, retrieval, and answer generation - Database: SQLite caching for search results and article content
- Models: Uses configurable LLM backends via DSPy
- Python 3.12 or higher
- uv package manager
- Clone the repository:
git clone <repository-url>
cd radiopaedia_idea- Install dependencies:
uv install- Create environment file:
cp .example.env .env
# Edit .env with your API keys and configuration- Initialize the database:
mkdir -p dataStart the development server:
uv run python main.pyThe application will be available at http://localhost:5001.
- "How do I differentiate between type 1 and type 2 endoleaks on CTA?"
- "What critical shoulder angle is normal?"
- "How can I differentiate hepatic adenoma from FNH?"
- "How do I classify hemorrhagic transformation of ischemic stroke?"
Configure the following in your .env file:
ANTHROPIC_API_KEY: For Claude modelsOPENAI_API_KEY: For OpenAI modelsGROQ_API_KEY: For Groq modelsDEVELOPMENT: Set to1for development mode
radiopaedia_idea/
├── main.py # FastHTML web application
├── lib.py # Core logic and DSPy modules
├── test_lib.py # Unit tests
├── pyproject.toml # Project configuration
├── requirements.txt # Python dependencies
├── data/ # SQLite databases and cached data
├── models/ # Trained DSPy model files
├── assets/ # Static assets (SVG icons)
└── notes/ # Development notes
uv run pytest test_lib.pyThe project uses Ruff for linting:
uv run ruff check .DSPy models can be optimized and saved using the notebooks in the notebooks/ directory. Trained models are stored in the models/ directory.
All medical content is provided under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License from Radiopaedia.org.
This is a research and educational project. Contributions should focus on:
- Improving search accuracy and relevance
- Enhancing the user interface and experience
- Adding new evaluation metrics and datasets
- Documentation and code quality improvements
This project uses content from Radiopaedia.org under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
- Radiopaedia.org for providing the medical content
- DSPy for the prompt programming framework
- FastHTML for the web framework
- RadioRag - A paper describing and evaluating a system very similar to this