AI Agent layer: citation-first, never hallucinates
The top layer consumes the two layers below it. It is not a ChatGPT skin — it is an engineering assistant that cites whatever it finds and explicitly says 'I don't know' when it cannot.
Four non-negotiable principles
Every number, every statement, every standard code must come from the six libraries. When the model has no source, it says 'f1frp has no record of this; the following is general knowledge' — never pretends.
We do not fine-tune models. Each query uses pgvector semantic search to fetch Top-K relevant records and inject them as context. New data in DB → usable same day, no retraining.
Gemini 2.5 Flash handles general inference (large free tier, fast); Claude Haiku 4.5 (via OpenRouter) for higher-quality commentary. Auto-fallback on quota exhaustion or quality drop.
Citation links go straight to source pages so users can verify. Future work layers 'Verified / Supplier-claimed / AI-inferred' confidence badges on top of citations.
Live AI capabilities
Describe the load case (stress / chemistry / temperature / budget). AI filters from 4,341 materials and returns top recommendations with citations.
102 formula records support replies. When asked 'how to formulate resin for pultrusion?' the AI cites specific formula IDs and parameters.
95 GB / ISO / ASTM / EN standards. AI gives applicable standards + chapter citations.
698+ papers and 1,473+ patents with Chinese commentary. AI cites multiple sources as evidence.
Filters top-3 suppliers by material + region + certification. Paired with the RFQ button to send an inquiry directly.
Locale auto-passed to AI — Chinese question gets Chinese answer, English stays English. No mixing.
Stack
Every material / formula / standard / paper / patent entry has an embedding (OpenAI text-embedding-3-small). embedText(query) → cosine ranking → top-8 injected into system prompt.
System prompt enforces [#N] inline citations. Streaming response attaches a citations array via messageMetadata so the client can render clickable [#N] markers.
@ai-sdk/google primary, @ai-sdk/anthropic + OpenRouter fallback. Per-call routing based on quota, latency, cost.
Frontend uses @ai-sdk/react useChat + DefaultChatTransport. Streamed typewriter response, automatic retry on error.
Three entry points
The search-style input under the hero. Type, press Enter → routes to the AI page and auto-sends. Best for a quick one-off question.
Multi-turn conversation, scenario shortcuts, sources sidebar. Main chat on the left, Sources list on the right — each clickable to the source page.
Bottom-right AI widget on every page. Mid-browse, ask about a material or formula without leaving.
Widget is on every page
Five-layer AI roadmap
Upgrade from single-turn Q&A to Agent Loop. Expose materials.search / formulas.recommend / suppliers.filter as tools; AI handles multi-step tasks.
Q2 2026
pgvector namespace per paid enterprise. Upload TDS / test reports. AI cites both your private data and public libraries.
Q3 2026
One-click generation of technical report PDFs / BOM Excels / RFQ letters / spec sheets. react-pdf templates, enterprise brandable.
Q3 2026
Layer 'Verified / Supplier-claimed / AI-inferred' badges on top of citations. Unsupported claims visually marked 'uncertain'.
Q4 2026
When the AI cannot answer, one-click handoff to paid consultation with certified engineers / professors. Extends from 'AI Q&A' to 'AI + expert'.
Q2 2027
Ongoing iteration, suggestions welcome.