getfrp
AI AGENT / LAYER 1

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.

DESIGN LOGIC

Four non-negotiable principles

CITATION-FIRST
Citation-first, never fabricate

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.

RAG
RAG retrieval, not fine-tuning

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.

ROUTING
Multi-model routing

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.

TRUST
Trust layering

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.

FEATURES

Live AI capabilities

SELECT
AI material selection

Describe the load case (stress / chemistry / temperature / budget). AI filters from 4,341 materials and returns top recommendations with citations.

FORMULA
Formula / process guidance

102 formula records support replies. When asked 'how to formulate resin for pultrusion?' the AI cites specific formula IDs and parameters.

STANDARD
Standards lookup

95 GB / ISO / ASTM / EN standards. AI gives applicable standards + chapter citations.

PAPER
Paper & patent commentary

698+ papers and 1,473+ patents with Chinese commentary. AI cites multiple sources as evidence.

SUPPLIER
Supplier matching

Filters top-3 suppliers by material + region + certification. Paired with the RFQ button to send an inquiry directly.

LOCALE
Multi-lingual Q&A

Locale auto-passed to AI — Chinese question gets Chinese answer, English stays English. No mixing.

IMPLEMENTATION

Stack

PGVECTOR
pgvector semantic search

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.

PROMPT
Citation-first system prompt

System prompt enforces [#N] inline citations. Streaming response attaches a citations array via messageMetadata so the client can render clickable [#N] markers.

PROVIDER
Multi-provider routing

@ai-sdk/google primary, @ai-sdk/anthropic + OpenRouter fallback. Per-call routing based on quota, latency, cost.

CLIENT
Stream + React hook

Frontend uses @ai-sdk/react useChat + DefaultChatTransport. Streamed typewriter response, automatic retry on error.

HOW TO USE

Three entry points

INLINE
Homepage AI input

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.

Ask from the homepage →

FULLSCREEN
/ai full-screen chat

Multi-turn conversation, scenario shortcuts, sources sidebar. Main chat on the left, Sources list on the right — each clickable to the source page.

Open the AI chat →

WIDGET
AI floating widget

Bottom-right AI widget on every page. Mid-browse, ask about a material or formula without leaving.

Widget is on every page

FUTURE

Five-layer AI roadmap

TOOL-CALLING
① Agent Tool-Calling

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

WORKSPACE
② Private workspace

pgvector namespace per paid enterprise. Upload TDS / test reports. AI cites both your private data and public libraries.

Q3 2026

DELIVERABLE
③ AI deliverables

One-click generation of technical report PDFs / BOM Excels / RFQ letters / spec sheets. react-pdf templates, enterprise brandable.

Q3 2026

TRUST
④ Trust layering

Layer 'Verified / Supplier-claimed / AI-inferred' badges on top of citations. Unsupported claims visually marked 'uncertain'.

Q4 2026

EXPERT
⑤ Expert handoff

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

MORE
...

Ongoing iteration, suggestions welcome.

Next: Structured DataBack to Platform