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 one question: does a 50 MW battery at this bus overload anything when a line trips? To answer it, a planner must build a base case, a variant with the battery, and an N-1 run, which tests the loss of each line in turn. In a desktop tool that still takes hours.
What I would build
An agent on PyPowSyBl MCP loads the network model into its own session and runs a base-case load flow. It clones a variant and applies the battery's export by setting target_p on a generator already at the bus. Then it runs a security analysis with N-1 line contingencies generated automatically. Before it reports any result, it checks that the model carries ratings at all. It lists post-contingency overloads and voltage violations, 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 to see what it does, what it passes on and where a person must approve.
What it returns
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. This is a reference design on an alpha project, not a system I run. The test case carries no current limits, so it can show flows and voltages but cannot show an overload. 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 now ask a general-purpose AI assistant what a connection study involves. The assistant explains which contingencies a planner will run and roughly what the network operator will want to see. The answer is good enough that the first meeting no longer needs a consultant to explain the method. A consulting firm could respond with a model that writes the study report faster, while the engineer still keys the injection into a desktop tool by hand. That speeds up the wrong part. The slow part is getting from a question asked in one sentence to a load flow that somebody can check.
The design I would build shortens that step and keeps the engineer's signature. An agent reads the planner's question and loads the network model into its own session. It runs the base case and clones a variant, so nothing touches the original. It sets the battery's export on a generator that already sits at the bus, then runs a 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 it. Before the agent reports that nothing overloads, it checks that the model carries current limits at all. The IEEE 14-bus case does not, so zero violations there means nothing, and the agent says so.
This could serve a five-year strategy of selling answered questions instead of study hours. I offer that as a sketch, not a plan. The firm would let the developer's own tools run the screening study under rules the firm sets. It would keep every variant, script and signed result as a record that the next query can start from. It would charge for the signature on the study, not for the typing that led to it. The developer's assistant will keep asking questions, and an engineer still has to sign the answer.
See it run
Want one of these?
Every part of it is open source and you can host it yourself. I bring the build, the checks around the project's gaps and the judgement about where your gates should go.