π§ Scientific vs Brute-Force Agent: AI Reasoning Under Physical Constraints
This interactive demo introduces a novel AI agent architecture that can operate under two distinct cognitive modes:
a brute-force combinatorial searcher, and a scientifically grounded reasoning agent.
This agent is capable of mode-switching, adapting its strategy to the userβs expectations:
- In Brute-Force mode, the agent mechanically tries every possible permutation of material order and thickness combinations.
- In Scientist mode, the agent reasons from first principles of optics, guided by spectral shape and error metrics.
π€ Objective: Discover the correct 4-layer material order and uniform thickness
Given a target transmission spectrum, the agent must:
- Identify the correct permutation of materials from a fixed set
- Select a uniform thickness (10nm or 100nm)
- Stop once
cosine_similarity > 0.999999is achieved
Constraints:
- Materials:
Si,SiβNβ,SiOβ,AlN(use each exactly once) - Uniform thickness: All layers must be either 10nm or 100nm
𧬠What's New & Innovative
π Mode Toggle:
- You control whether the agent uses brute-force enumeration or scientific deduction.
π§ Scientist Mode Intelligence:
- Hypothesis generation and simulation driven by shape + magnitude cues
- Uses both
cosine_similarityandmean_squared_errorfor multi-objective evaluation - Fewer simulations, smarter reasoning
βοΈ Brute-Force Mode Simplicity:
- Tries all combinations of 4! material orders Γ 2 thicknesses (48 total)
- Terminates once similarity threshold is met
π What Happens Under the Hood
- A random 4-layer stack is generated (e.g.,
Si β SiOβ β AlN β SiβNβ) and simulated using RCWA. - This becomes the target spectrum.
- Based on the selected mode:
- Brute-Force Agent tries all fixed permutations with
simulate_spectrum(...) + cosine_similarity(...). - Scientist Agent reasons about spectral behavior and dynamically explores promising configurations.
- Brute-Force Agent tries all fixed permutations with
- The agent streams its reasoning live in the UI and stops once a close match is found.
π οΈ Tools Available to the Agent:
| Tool | Description | Arguments |
|---|---|---|
simulate_spectrum |
Simulates optical spectrum for a layer stack | layer_order: List[str], thicknesses: List[float] |
cosine_similarity |
Measures angular similarity between spectra | vec1, vec2: Lists of floats |
mean_squared_error |
Measures magnitude mismatch in spectra | vec1, vec2: Lists of floats |