ECMWF Newsletter #187

The IFS AI Assistant

Mohanad Albughdadi
Michael Sleigh
Marica Antonacci
Claudio Pisa
Federico Fornari
Tolga Kaprol
Vasileios Baousis

 

The Integrated Forecasting System (IFS) is at the heart of ECMWF’s forecasting capability and is one of its most sophisticated software systems. Having evolved over several decades, it underpins a wide range of weather forecasting and Earth system applications. As a result, the associated codebase, documentation and workflows are extensive, distributed across multiple repositories and file types. The scale and diversity make it challenging for IFS users to navigate the system efficiently, especially when working with unfamiliar components or getting up to speed in a new area. To address this, a new IFS AI Assistant has been developed. The tool provides a local, retrieval-based assistant tailored to the IFS codebase and its documentation, helping users to explore and understand the system more effectively.

Why an AI assistant for the IFS?

The IFS code environment is unusual in several respects. While much of the system is written in Fortran, it also includes shell scripts, Python, notebooks, build files, README files, PDFs and other technical documentation. Knowledge is therefore spread across code and documents that need to be understood together rather than in isolation. At the same time, users need answers that are reliable, explainable and grounded in actual source material. In this context, a generic conversational AI tool is not sufficient: the system must operate on-premises to meet security requirements for closed-source code repositories, while also minimising hallucinations by managing the usage of Large Language Model (LLM) context and by grounding its responses on indexed and verifiable content. The IFS AI Assistant has been designed with these constraints in mind, offering reliable outputs.

Building on foundations laid by EU-funded Horizon Europe projects (namely EO4EU (https://www.eo4eu.eu/), MediTwin (https://meditwin-project.eu/) and DeployAI (https://www.deployaiproject.eu/), the assistant is intended to support IFS users in their daily work. Typical use cases include navigating large repositories, understanding how specific routines or modules are connected, locating relevant documentation, and supporting onboarding for new developers. In this way, the tool complements wider efforts to make the IFS software ecosystem easier to understand, maintain and evolve.

How the AI Assistant works

The IFS AI Assistant uses a hybrid retrieval-augmented generation (RAG) approach. At a high level, the architecture consists of four main parts (Figure 1):

  • A frontend where users ask questions.
  • A Representational State Transfer (REST) application programming interface (API) that handles requests.
  • A search-and-retrieval engine that identifies relevant information.
  • An indexing pipeline that parses repositories and builds the underlying search databases.
Figure 1
Figure 1 Main components of the IFS AI Assistant. The diagram shows the frontend, REST API, search-and-retrieval engine, and indexing pipeline, together with the lexical and vector databases used to ground responses in IFS code and documentation.


The indexing pipeline is a key component as it determines the quality and traceability of the information later supplied to the language model.

During indexing, the system scans selected repositories and classifies files into types such as Fortran, Python, PDFs, notebooks and generic text. Different parsing strategies are then applied depending on file type. For example, Fortran source code is parsed structurally, leveraging ECMWF’s Loki (https://sites.ecmwf.int/docs/loki/main/index.html), to identify modules, subroutines, functions and programs, while Python files are analysed through their syntax tree. The system also captures contextual information such as comments, top-level file descriptions and synthetic file indexes. This helps to preserve relationships between different units in the same source file.

The indexed content is then stored in forms that support different retrieval strategies. Text is stored in a lexical search database, while embeddings are generated and stored in a vector database for semantic search. When a user submits a question, the assistant combines lexical and semantic retrieval, merges and re-ranks the results, and then assembles a context window for the generator model. This hybrid approach improves robustness: lexical search helps with exact terminology and identifiers, while dense retrieval helps capture conceptual similarity across code and documentation. This design supports both data governance and the requirement for explainable, repository-grounded answers.

The system is implemented using Python-based backend components, with LLM runtime support provided through KubeAI (https://www.kubeai.org/), which deploys, scales and routes traffic to AI inference backends. The assistant includes conversation memory and a serving layer exposed through a REST API and frontend. While the main user interface is a web-based chat, users can also interact with the system through command line tools.

Reliability, deployment and current use

The assistant is deployed on an RKE2 Kubernetes cluster (Figure 2) hosted on the European Weather Cloud (EWC; https://www.europeanweather.cloud/), reachable at https://ifs-assistant.apps.ifs-llm.ewcloud.host/ and integrated with the ECMWF Single Sign On (SSO) infrastructure. It is currently in an experimentation phase, piloted internally, expanding to a growing number of users. Early experience suggests that it can reduce the time needed to locate relevant code or documentation and can make it easier to explore unfamiliar parts of the IFS ecosystem (including both closed and open-source code). For large scientific repositories, the proposed approach offers a practical way to access dispersed technical knowledge through a user-friendly development aid.

Diagram showing the European Weather Cloud architecture for an AI-powered IFS RAG Assistant, including infrastructure-as-code deployment, Kubernetes cluster management, GPU processing, data services, observability, and secure integration with IFS source code repositories and developers.
Figure 2 IFS AI Assistant infrastructure architecture. The diagram illustrates the GitOps pipeline and Kubernetes-based deployment, along with the components that make up the innovative tool. All components are deployed in the European Weather Cloud (EWC).

Outlook

The IFS AI Assistant is still evolving, but it already illustrates how AI methods can support scientific software engineering. Rather than replacing developer expertise, it is intended to amplify it – helping users move more efficiently through a complex codebase while keeping answers anchored in trusted sources. As the system matures and incorporates new features, such as support for user-defined repositories, role-based access control for more fine-grained security and support for code assistants. This positions the assistant to become an increasingly valuable part of the wider IFS development environment, fostering both productivity and knowledge sharing across teams.