diff --git a/BACKLOG.md b/BACKLOG.md index 40836b9..c4e2d92 100644 --- a/BACKLOG.md +++ b/BACKLOG.md @@ -109,7 +109,7 @@ If any seat would be confused, the component fails. - "The three categories" section — ○ ○ ○ - "Step 1 — Set up" → "Step 5 — Submit" — ○ ○ ○ - "Whitelisted models" — ○ ○ ○ -- "Agent architecture patterns" — ○ ○ ○ +- "Agent architecture patterns" — ● ● ● — step 374 (PR #300, `QuickstartGuide.tsx` L639–743): replaced invented 6-phase loop (OBSERVE→PLAN→ACT→VERIFY→REFLECT→EXPORT) with canonical 3-phase Observe→Plan→Act from `examples/llm-agent/agent.py:27,34,70`. Added Pattern A (deterministic baseline, no LLM) alongside Pattern B (LLM-driven). Surfaced canonical `llm.chat(messages, max_tokens=...)` API. Dropped speculative `gmsh` / `numpy/scipy` library tiles (no canonical agent imports them). 3 routed GitHub links to the actual reference agents. 5 tooltips citing source files (`agents/baseline/agent.py` docstring, `examples/llm-agent/agent.py`, `forge/sdk/llm.py`). - "API reference" — ○ ○ ○ - "How rewards work" — ○ ○ ○ - "Anti-gaming guarantees" — ○ ○ ○ diff --git a/src/components/QuickstartGuide.tsx b/src/components/QuickstartGuide.tsx index 466c30d..b12b0af 100644 --- a/src/components/QuickstartGuide.tsx +++ b/src/components/QuickstartGuide.tsx @@ -639,32 +639,107 @@ for chunk in llm.stream([...]): {/* Agent architecture patterns */}

- The best LLM agents use a structured observe → plan → act loop rather than a single prompt. + Two patterns ship as canonical references. Pick the one that fits your strategy — both are legitimate.

-
-
Recommended loop pattern:
+
+
+
+ + Pattern A — Deterministic geometry + +
+

+ No LLM call. Parametrise directly from spec["constraints"] and emit STEP bytes. + {" "}llm stays in the signature (or the harness rejects you), unused. +

+

+ Reference: agents/baseline/agent.py — raw OCP, ~80 lines. +

+
+
+
+ + Pattern B — Observe → Plan → Act + +
+

+ Three phases. LLM proposes dimensions or topology as JSON, your code parses + builds + clamps + exports. +

+

+ References: examples/llm-agent/agent.py (single prompt) and{" "} + examples/metric-aware-agent/agent.py (strategy per category). +

+
+
+
+
Pattern B — canonical three-phase loop:

- {`1. OBSERVE — read spec constraints, compute allowable stress -2. PLAN — prompt LLM: "given load X at point Y, what topology?" -3. ACT — execute geometry code from LLM output -4. VERIFY — check build volume, bolt holes, wall thickness -5. REFLECT — if check fails, prompt LLM for correction -6. EXPORT — return STEP bytes`} + {`1. OBSERVE — read spec["constraints"]: build_volume_mm, load_point_mm, + bolt_pattern_mm, min_wall_thickness_mm +2. PLAN — raw = llm.chat([{"role":"user","content": prompt}], max_tokens=256) + dims = json.loads(raw) +3. ACT — build geometry (build123d), clamp to build volume, export STEP bytes`} +

+

+ The harness injects the LLMClient{" "} + already bound to a whitelisted model. No API key, no model selection.

{[ - { title: "build123d", desc: "High-level OCP wrapper — easiest for complex shapes" }, - { title: "Raw OCP (BRep)", desc: "Lower-level, more control — used in the reference agents" }, - { title: "gmsh (Python)", desc: "Mesh generation — useful for lattice/truss shapes" }, - { title: "numpy/scipy", desc: "Topology optimization, stress calculation helpers" }, + { + title: "build123d", + desc: "High-level OCP wrapper — recommended. Used by both LLM example agents.", + tip: "Template agent.py: '# from build123d import ... # recommended'. Both examples/llm-agent and examples/metric-aware-agent build geometry with BuildPart + Box + Cylinder.", + }, + { + title: "Raw OCP (BRep)", + desc: "Lower-level — used by the baseline. BRepPrimAPI primitives, BRepAlgoAPI booleans.", + tip: "agents/baseline/agent.py uses BRepPrimAPI_MakeBox + BRepAlgoAPI_Fuse + BRepAlgoAPI_Cut + STEPControl_Writer (AP214IS schema, required).", + }, ].map((item) => (
-
{item.title}
+
+ + {item.title} + +
{item.desc}
))}
+

+ Working source on GitHub:{" "} + examples/llm-agent/agent.py ↗ + {" · "} + examples/metric-aware-agent/agent.py ↗ + {" · "} + agents/baseline/agent.py ↗ +

{/* FEA explainer */}