π§ Multi-Agent Thin-Film Stack Optimizer (10nm + 100nm RCWA)
This interactive demo showcases a multi-agent AI system that cooperatively solves an inverse optics problem using physics-based simulation.
Instead of relying on a single agent or a single simulator, the Coordinator Agent orchestrates two specialized agents, each tuned to simulate optical spectra for different layer thicknesses (10nm and 100nm), and uses a comparison tool to evaluate results.
π€ Objective: Discover the correct layer order and thickness
Given only a target transmission spectrum, the multi-agent system must identify:
- The correct material permutation (from a fixed set), and
- The correct thickness choice (10nm or 100nm, uniformly applied)
Constraints:
- Materials:
Si,SiβNβ,SiOβ,AlN(used once each) - Layer thickness options:
10nmor100nm - Terminate when
cosine_similarity > 0.999
𧬠Agent Architecture Overview
π§ Coordinator Agent (
CodeAgent | gpt-4.1-mini):
Receives the target spectrum and is responsible for reasoning, selecting candidates, and delegating simulations to sub-agents.π§ agent_10nm_simulator:
Can simulate any material order using 10nm thick layers via RCWA.π§ agent_100nm_simulator:
Can simulate any material order using 100nm thick layers via RCWA.π cosine_similarity tool:
Measures how close a simulated spectrum is to the target.
π Whatβs Happening Under the Hood
- A random 4-layer stack is selected from
Si,SiβNβ,SiOβ,AlN, and simulated (at 100nm) to serve as the target spectrum. - The Coordinator Agent is provided the target and access to two sub-agents:
agent_10nm_simulatorfor 10nm stacksagent_100nm_simulatorfor 100nm stacks
- It explores permutations + thickness combinations by:
- Calling a simulation agent
- Comparing simulated output with the target using
cosine_similarity - Continuing exploration until similarity exceeds threshold
- The system halts automatically once the optimal stack is found, and reports:
- The matched material order
- Thickness value
- Number of permutations tried
π Visualization
π Transmission Spectra of Layer Stack Designs for all 24 permutations of material order for thickness 100nm
π Transmission Spectra of Layer Stack Designs for all 24 permutations of material order for thickness 10nm
π€ Multi-Agent System Overview
π§ Coordinator Agent: CodeAgent | openai/gpt-4.1-mini
- β
Authorized Imports:
['numpy']
π οΈ Tools:
| Tool | Description | Arguments |
|---|---|---|
cosine_similarity |
Computes the cosine similarity between two vectors | vec1, vec2: Lists of floats |
π§ Managed Agent: agent_10nm_simulator | CodeAgent | openai/gpt-4.1-mini
- β
Authorized Imports:
[] - π Description: Simulates optical spectra for 10nm thickness.
π οΈ Tools:
| Tool | Description | Arguments |
|---|---|---|
simulate_spectrum_10nm |
Simulates spectrum for 10nm layers. | layer_order: List of materials |
π§ Managed Agent: agent_100nm_simulator | CodeAgent | openai/gpt-4.1-mini
- β
Authorized Imports:
[] - π Description: Simulates optical spectra for 100nm thickness.
π οΈ Tools:
| Tool | Description | Arguments |
|---|---|---|
simulate_spectrum_100nm |
Simulates spectrum for 100nm layers. | layer_order: List of materials |