Electrical studies agent: The technical architecture

5 min read

Day 2 / 60

Today I'm going to start with the first iteration of the technical design.

My initial thesis

I firmly believe that an AI agent can solve this problem. Not because I'm blindly optimistic (which I am), but because I've already done something similar for another sector and in this problem all the pieces are there:

  • The information exists (thousands of real studies)
  • The regulations exist (clear and available)
  • The software exists (DIgSILENT PowerFactory) to run the simulations

What's missing is connecting everything correctly.

Why an agent and not a regular LLM?

An LLM generates text. An agent executes.

The key difference: an agent works as a control loop. You don't tell it step by step what to do. You give it tools and it decides how to use them to solve the problem.

I'm going to use the ReAct (Reasoning + Acting) pattern. It's the standard, nothing sophisticated for agents nowadays. If I need something more advanced, I'll add it along the way.

The agent's cycle:

ReAct pattern: reasoning and acting

ReAct pattern: reasoning and acting

  • Evaluates if it completed the task correctly
  • Verifies the result against the objective
  • If it fails, adjusts its reasoning
  • Uses the tools again
  • Repeats until achieving the expected result

It's closer to how we engineers work than how a prompt works.

The tools

I've thought a lot about this. I already have some in initial functioning, others are in design.

1. DIgSILENT PowerFactory

The standard software for electrical analysis in Chile.

The idea is NOT to make Python scripts that manipulate PowerFactory. I want to expose it as an MCP (Model Context Protocol), with clear functions:

  • run_power_flow()
  • run_short_circuit()
  • export_results()

Let the agent use it as an engineer would, not as a programmer would.

2. PGP – Project Management Platform (CEN)

I've already made the decision: I'm going to scrape all the Coordinator's projects.

Approximately 6,000 projects, each with their complete electrical studies.

Why?

So the agent can observe how humans structure studies. So it can identify real patterns. So it can compare solutions to similar problems.

👉 https://pgp.coordinador.cl/welcome

3. Infotécnica

The technical database of the National Electrical System.

The agent needs real-time access to:

  • Installation data
  • Transmission lines
  • Substations
  • Installed equipment

Infotécnica is, in practice, the source of truth for the Chilean electrical system.

👉 https://infotecnica.coordinador.cl

4. Report writing

There's an interesting topic here.

Yes, LLMs can generate up to 65,000 tokens (~95 pages). But that doesn't mean they should do it all at once.

I'm not convinced by asking an LLM: "Write a complete ECAP".

I prefer to build a specific tool for technical writing that allows:

  • Structuring chapters
  • Writing by sections
  • Iterating over each part
  • Maintaining technical and regulatory consistency

Closer to how we build real reports: section by section, with iterative reviews.

I've already done something similar for another sector and I also think it would be useful when I need to write a long report.

What's next

This is the first iteration of the design. It will probably change several times over the next 58 days.

Tomorrow I start building the first tool and as soon as I have it available, I'll make it public.

If you have ideas, questions, or see something that doesn't make sense, write to me. I'm building this in public precisely to receive feedback.