Argonne: Using AI to Unlock 30 Years of PETSc Knowledge
Feb. 23, 2026 — Begun as an exploratory software project at the U.S. Department of Energy’s Argonne National Laboratory focusing on parallel numerical algorithms for partial differential equations, PETSc has evolved into one of the world’s most widely used software libraries for high-performance computing, with a core development team and numerous contributors. But with such a long history, a challenge has emerged: important knowledge is getting lost or buried.
“We’ll have developers thinking, ‘I’m sure we solved this problem back in 2015 — but where’s the solution?’” said Barry Smith, one of the original PETSc developers. “And sometimes developers get nuanced questions from users that the developers recall were discussed at length and could not be answered simply; but those discussions are buried in thousands of emails or GitLab issues or the like.”
PETSc has two types of knowledge. “Dry” knowledge is written down and can be read by computers; it includes official material that has undergone review and unofficial knowledge, such as emails, that has not been reviewed. In contrast, “wet” knowledge is unwritten and is not machine accessible. Both “wet” and “dry” knowledge bases are hard to search through — especially the “wet” kind — and even the written material is often unorganized or hard to find.
Now, new tools based on artificial intelligence (AI) could help change that.
Can AI Help PETSc?
One promising AI tool is the large language model, or LLM — like ChatGPT. LLMs are designed to understand and generate human language based on patterns learned from large amounts of text. That sounds perfect for making sense of PETSc’s vast information — from documentation to emails to user questions.
Types of knowledge in PETSc. Credit: Argonne.
But LLMs have a big drawback: they sometimes make things up — a problem known as “hallucination.” In science and high-performance computing, where accuracy is everything, that’s a serious issue.
Still, the PETSc team saw potential. So they decided to create a custom AI system — not just using LLMs off the shelf, but designing tools specifically built for PETSc.
“Our vision is to create PETSc AI assistants — kind of like virtual team members — that can help users ask questions, support developers and organize information more effectively,” said Lois McInnes, a senior scientist at Argonne and long-time PETSc developer.
Their first steps are outlined in a paper titled “AI Assistants to Enhance and Exploit the PETSc Knowledge Base.” In it, they describe six key areas where AI could help — from answering user questions to customizing user guides, checking code, exploring new research ideas and even helping manage team tasks.
Why Not Just Use ChatGPT?
The team considered using already available tools like ChatGPT, but such general LLMs aren’t trained specifically on PETSc. That means they often give incomplete or wrong answers about it.
“Mainstream AI tools just don’t have enough knowledge about PETSc,” said Junchao Zhang, another PETSc developer at Argonne. “So we built a special AI system that brings PETSc-specific information into the mix — which helps avoid those made-up answers.”
The PETSc team also designed a workflow that brings developers into the question-answer loop. Developers review the answer generated by the LLM and decide whether to approve, revise or discard it.
Finding and Reordering Relevant Information
Another method the team used is called retrieval-augmented generation, or RAG. When a user asks a question, the system first searches PETSc’s knowledge base for relevant information. That information is then added to the original question before being sent to the LLM, leading to a more accurate answer.
They also used a method called reranking, which improves how search results are ordered. Instead of just grabbing the fastest results, the system looks for the most relevant ones and puts those at the top.
“Using RAG and reranking together means our AI assistant can find better, more accurate answers,” Smith said.
In the future, the PETSc team hopes their AI assistants will work alongside real developers — helping speed up work, support users, and even spark new scientific discoveries.
For further information, see the full paper “AI Assistants to Enhance and Exploit the PETSc Knowledge Base,” by Barry Smith, Junchao Zhang, Hong Zhang, Lois Curfman McInnes, Murat Keceli, Archit Vasan, Satish Balay, Toby Isaac, Le Chen, and Venkatram Vishwanath; available here.
Source: Gail Pieper, Argonne National Laboratory
Related

