Reference design · Intelligence

N-1 Connection Study Agent

  • PyPowSyBl MCP
  • pypowsybl 1.15.0
  • OpenLoadFlow
  • MCP Streamable HTTP
  • Python
  • Docker Compose
  • Claude

The problem

A developer asks in one sentence whether a 50 MW battery at a given bus overloads anything when a line trips. Turning that into a base case, a variant, an N-1 run and a result an engineer can check still takes a planner hours in a desktop tool.

What I would build

An agent on PyPowSyBl MCP loads the network model into its own session, runs a base-case load flow, clones a variant, applies the battery's export by setting target_p on a generator already at the bus, and runs security analysis with N-1 line contingencies generated automatically. It lists post-contingency overloads and voltage violations, checks first that the model carries ratings at all, draws the substation's single-line diagram, and asks for a Python script the engineer can rerun. The engineer signs the study; the agent never writes back to an operational model.

The logic flow

Click any node for what it does, what it hands on, and where a person is required.

Loading diagram...

What it returns

A reference design on an alpha project, not a system I run. On the IEEE 14-bus case, pypowsybl 1.15.0 ran the base case, the 50 MW variant and all 17 line contingencies to convergence on 2026-10-17. That case carries no current limits, so it can show flows and voltages but cannot show an overload, and the time saved on a real network is not yet measured.

Why it fits

A developer with a 50 MW battery and a candidate bus can ask a general-purpose assistant what a connection study involves, which contingencies a planner will run and roughly what the network operator will want to see, and the answer now comes back good enough that the first meeting no longer needs a consultant to explain the method. The trap for the consulting firm is to answer that with a model that writes the study report faster while the engineer still keys the injection into a desktop tool by hand. The slow part was never the prose; it was the distance between a question asked in one sentence and a load flow somebody can check.

The design I would build closes that distance and leaves the engineer's signature where it was. An agent reads the planner's question, loads the network model into its own session, runs the base case, clones a variant so nothing touches the original, sets the battery's export on a generator that already sits at the bus, and runs security analysis over every single-line outage. It lists what overloads and which buses leave their voltage band, draws the substation, and hands over a Python script for the engineer to rerun. A second model writes that script, so the engineer reads it before trusting a line of it. Before the agent reports 'no overloads' it checks that the model carries current limits at all; on the IEEE 14-bus case it does not, so zero violations there means nothing, and it says so.

One five-year strategy this could serve, offered as a sketch rather than a plan, sells answered questions instead of study hours. Expose the screening run to the developer's own tools under rules the firm sets, keep every variant, script and signed result as a record the next query can start from, and charge for the signature on the study rather than for the typing that led to it. The developer's assistant will keep asking. Someone still has to sign.

See it run

Want one of these?

Every part of it is open source and self-hostable. What I bring is the build, the checks around the project's gaps, and the judgement about where your gates should sit.