🧠 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.999999 is 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_similarity and mean_squared_error for 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

  1. A random 4-layer stack is generated (e.g., Si β†’ SiOβ‚‚ β†’ AlN β†’ Si₃Nβ‚„) and simulated using RCWA.
  2. This becomes the target spectrum.
  3. 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.
  4. 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

πŸ“Š Visualization: Below are the set of transmission spectra the agent has to search over

πŸ“Š 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

Agent Mode