How It Works

Modern AI coding agents are capable on their own. They reason about problems, generate code, manage files, handle errors, and iterate toward solutions. PumasAide does not try to replace or reimagine any of that. It is an MCP server, a composable component that plugs into whichever agent you choose and adds only what a general-purpose agent cannot bring on its own: current pharmacometric knowledge, a live Julia workspace, and structured visibility into domain objects.

AI agents improve rapidly, and PumasAide users benefit from those improvements automatically. The agent handles reasoning, planning, code generation, error recovery, and file management. PumasAide's role is to make the agent effective at pharmacometrics specifically, then get out of the way.

Domain Knowledge

A general-purpose agent has broad knowledge but not deep, current expertise in pharmacometric software. It may know what NCA is conceptually, but it doesn't know the exact signature of NCA.run_nca, which quality metrics to request, or how Pumas expects dosing columns to be mapped.

PumasAide embeds a curated knowledge base covering API references, pharmacometric concepts, and step-by-step workflow guides. When you ask for an NCA analysis, the agent reads the NCA workflow guide and the relevant API documentation before writing any code. It learns the correct function calls, parameter names, and recommended practices from authoritative sources rather than relying on training data that may be outdated or imprecise.

The knowledge base spans the full Pumas ecosystem: model specification, estimation methods, NCA parameters, bioequivalence criteria, covariate screening, diagnostic plots, and more. The agent consults it as needed throughout the analysis, the same way a developer would consult documentation.

One Language, One Session

Many pharmacometric workflows traditionally span multiple tools and languages: R for data preparation, NONMEM for estimation, Python for post-processing, separate plotting libraries for visualisation. An AI agent working across these boundaries must juggle different syntaxes, manage file handoffs between systems, and translate data formats at every step. Each boundary introduces friction for the agent and cognitive overhead for the user reviewing the work.

Pumas is built entirely in Julia. Data loading, population construction, model definition, estimation, NCA, simulation, visualisation, and reporting all happen in a single language and a single session. The agent writes Julia throughout, with no context switching, no format conversion, and no orchestrating separate processes. The user reads one language in the generated scripts and follows one mental model from start to finish.

PumasAide maintains a persistent Julia session across tool calls. Variables assigned in one step remain available in the next. When the agent loads a DataFrame, builds a population from it, fits a model, and generates diagnostics, each step builds naturally on the previous results without serialisation or re-loading. This is the normal Julia workflow. PumasAide simply makes it accessible through the agent.

Workspace Awareness

When a coding agent executes code, it typically sees text output in a terminal. Through PumasAide, the agent also receives automatic inspection of objects that change after each execution: their types, dimensions, and structure. When code creates an NCA report, the agent doesn't just see a success message. It sees the report's dimensions, column names, and a preview URL where the user can explore the full results in a browser.

The preview system runs at http://localhost:8081/preview and renders DataFrames with column statistics, plots at full resolution, model fit summaries with parameter tables, and NCA reports with per-subject results. The agent references these previews in its responses so the user can inspect results visually without asking for additional code.

Domain types receive specialised treatment. A fitted Pumas model surfaces its log-likelihood, AIC, BIC, and shrinkage metrics automatically. An NCA population reports subject counts, group structure, and missing observations. The agent receives structured information about these objects, not just their printed representation.

Team Standards

Pharmacometric analyses depend on organisation-specific thresholds and methodology choices: acceptance criteria for terminal slope fits, preferred estimation methods, covariate screening cutoffs, regulatory conventions. Without guidance, the agent asks about these decisions each time they arise.

The solution lives in the agent itself, not in PumasAide. Most coding agents support the Agent Skills open standard. SKILL.md files contain plain markdown with YAML frontmatter that the agent discovers automatically and loads when relevant. The format works across Claude Code, OpenAI Codex, GitHub Copilot, and any agent that implements the specification. You can edit skill files directly, commit them to version control for team-wide use, or distribute them through the marketplace and plugin mechanisms that compatible agents support.

What PumasAide provides is a guided organisation rules workflow that helps you author pharmacometric rule sets in this format. It walks through each category (NCA quality thresholds, estimation preferences, regulatory conventions, naming standards) and generates well-structured skill files that the agent can then apply consistently across sessions. The authoring is PumasAide's contribution; the discovery, loading, and enforcement are the agent's.

The Agent Does the Rest

PumasAide provides three tools: one for looking up documentation, one for executing Julia files, and one for quick code evaluation. Reasoning about the problem, deciding which analysis to perform, writing the code, choosing model structures, interpreting diagnostics, handling errors, organising files, managing git: these are the agent's strengths, and PumasAide is designed not to interfere with them.

By keeping the component thin and focused on what agents genuinely cannot do alone (provide current domain knowledge, maintain a live workspace, and surface pharmacometric objects), PumasAide composes cleanly with the agent rather than competing with it. As agents grow more capable, PumasAide users benefit directly.