Photo: Bill Dix / Audubon Photo Award
LLM and AI-assisted explorations into fitting of experimental diffraction data, coming at you from Team datalab for the 2025 LLM Hackathon for Applications in Materials Science and Chemistry.
-
Ensure you have
uvinstalled -
Install dependencies:
uv sync --all-extras --dev
-
Set up your environment variables in
.env:AI_MODEL=google-gla:gemini-2.5-flash-lite GEMINI_API_KEY=your_api_key_here
Run the chat application:
uv run guillemotGiven experimental X-ray diffraction data, guillemot will set up and run TOPAS refinements using a natural-language interface. Guillemot uses multimodal image input to inspect refinement outputs, and has tools for retrieving structural information from OPTIMADE providers and outputting refinement plots to images.
- Local file paths automatically parsed as multimodal input (used by agent to read refinement plots)
save_topas_inp— Create and save a TOPAS .inp refinement input file; returns the path to the generated .inp.run_topas_refinement— Run a TOPAS refinement using a provided .inp and diffraction data; returns paths to result files and logs.get_optimade_structures— Query OPTIMADE providers for crystal structures and provide them in context to the agent.print_structure— Produce a concise human-readable summary of a single structure for quick inspection.print_structures— Summarize multiple structures in a compact tabular/list form with basic metadata (ID, formula, space group, lattice, source).plot_refinement_results— Plot observed vs calculated pattern and residuals, optionally annotate HKL ticks, save PNG, and return the image filepath and binary content.get_sampleandget_samples— Download sample metadata from the configured datalab to find uploaded XRD patterns.
This hackathon project is released under the terms of the permissive MIT License - see LICENSE file for details.