AI for Science & Industry

Evidence-first AI,
four domains.

I build AI systems that turn messy sources into structured, checkable knowledge — and keep a person at every decision that matters. The same discipline runs through battery-electrolyte chemistry, investment due diligence, survey astronomy and factory scheduling.

Live demos, flowcharts and slides for the enterprise ontology platform and the due-diligence system: work.linjm.cc · research manuscripts (IEEE TKDE, CCF-A): AI papers.

01 · AI for Chemistry

AI for Chemistry

With Peking University collaborators I lead the algorithms of a battery-electrolyte research platform: literature becomes an audited knowledge graph, and a Graph-RAG agent turns it into experiment protocols for an automated synthesis platform.

3 + 1LLM extraction stages, the last one a quality gate
θ = 0.5score threshold every triple must clear
2frontends · lab agent + KG studio
StackGraph-RAGNeo4jgraspologic LeidenSchema-based LLM extractionLLM-as-judge QCUnion-Find dedupPubChem CIDPyMuPDFNanocraft protocol export

A knowledge-graph & experiment-design agent for electrolytes

As algorithm lead I built a materials-science research platform for battery-electrolyte R&D with Peking University. It ships as two frontends: a Lab Intelligent Agent System (a Graph-RAG assistant with Q&A, knowledge-graph and experiment-execution modes) and a Knowledge-Graph Visualization System (build, manage and quality-score the graphs). Below: the product framework, an experiment-design walkthrough, and the extraction pipeline behind it.

System 1 · :3001

Lab Intelligent Agent System

Graph Retrieval-Augmented System · 实验室智能体系统

问答 · Q&A 知识图谱 · KG 实验执行 · Execute
  • Answers grounded in a chosen graph + literature
  • Retrieval depth: quick · deep · wide-area reasoning
  • Experiment-design mode → protocol for the Nanocraft auto-synthesis platform
System 2 · :6700

Knowledge-Graph Visualization System

图谱可视化系统 · build · manage · assess

图谱可视化 图谱管理 质量评估
  • file / content / pipeline graph generation · meta-graph · merge
  • Sub-graph & shortest-path queries, JSON/CSV export
  • Quality score per triple: accuracy · triple-support · usefulness
实验室智能体系统Lab Agent electrolyte_2026 · 4 812 triples
User question · experiment-design mode
Design an experiment to determine whether FEC or VC more significantly improves SEI-film stability in a LiPF₆ / EC / DMC electrolyte.
Agent workflow
  1. ◇Analysis pathdecompose goal → sub-tasks
  2. ▤Graph-RAG retrievaldeep reasoning over KG + papers
  3. ⚗Generate protocolcontrols · cell build · testing
  4. ✓Validateevidence & consistency check
Knowledge graph · Leiden communities hover a node
Generated protocol → Nanocraft
Behind the graph

Schema-based extraction · a 3 + 1 pipeline with quality gates

Every triple in the graph is earned. A four-stage LLM pipeline extracts and then audits it, two dedup passes fold synonyms and PubChem CIDs together, and Leiden community detection plus LLM enrichment organize the result before it lands in Neo4j.

The same architecture generalizes: literature → clean chunks → schema-based triples → audited, deduplicated, community-organized graph → Neo4j — reused across both the materials agent here and the astronomy Astro Agent below.

02 · AI for Business

AI for Business

Crystal Ball (水晶球) is a due-diligence assistant built with a business-school team. Business plans and expert interviews become a knowledge graph of verbatim-sourced facts, expert decision cards and executable rules — and the reasoner says “unknown” instead of guessing.

1,067expert decision cards, from 30 interviewed experts
557IF-THEN rules, evaluated in three-valued logic
14reasoning stages → a three-tier screen, no fake score
StackPostgreSQL 17 + pgvectorOpenSearch BM25 → RRFNeo4j projectionFastAPIPydantic 2Vue 3 + TypeScriptthree.jsbge-m3 + rerankerQwen / DeepSeek cross-checkDocker ComposeOIDC
Evidence graph & reasoning · 2026

From a business plan to a question worth asking

Every extracted fact keeps its page and its exact quote — a deterministic check rejects any quote that is not a verbatim substring of the source. Expert knowledge is modelled as cards, rules and cases with their conditions and counter-examples. The reasoner freezes facts as self-reported, forecast or in conflict, runs the rules, and turns what is missing into follow-up questions. Switch between the evidence graph and the 14-stage pipeline.

30 experts · 111 cases
268 slots · 2,774 edges
1,244 facts from 12 BPs
missing ≠ no

Unknown stays unknown

Rules run in three-valued logic; an absent fact can block a conclusion but never counts as a “no”.

self-reported ≠ verified

Claims carry their status

A pilot described in the plan is a claim of the plan until a contract or payment record says otherwise.

compiled ≠ confirmed

Experts sign the rules

Machine-compiled rules stay drafts until the expert who said them confirms the card.

preference ≠ probability

No fake precision

The output is a three-tier screen plus the missing facts that would change it — not a funding score.

Industry & policy radar

Trend context without a model in the loop

A sector tree of 325 nodes and a policy library monitored across nine official sources (U.S. and Chinese regulators). Change detection is a deterministic diff with A/B/C evidence tiers — the language model only explains, it never discovers.

Scope. Research system in pilot. Counts are from the project's internal report (Sep 2026); quality metrics so far come from small samples and are not claimed here. Company and expert identities are fictional in the figure. It screens and asks — it does not make investment decisions.

03 · AI for Astronomy

AI for Astronomy

My home field. I fine-tuned an 8B astronomy LLM on one consumer GPU, built 星图 Astro Studio — a research workbench that plans, queries the survey archives and shows every step — plus an auditable LangGraph research agent and a lightweight light-curve CNN.

8Bastronomy LLM, fine-tuned on a 12 GB GPU
43registered tools · 12 pipelines · 562 tests
99.4%held-out accuracy, ZTF light-curve CNN
StackQLoRA + AttnResLangGraphastropy · astroqueryFastAPIGaia DR3 · SIMBAD · VizieRIRSA ZTF · MAST TESSgalpyscikit-learnEChartsAladin LitePyTorch
Research platform · 2026

星图 Astro Studio — a research workbench that shows its work

Type a research topic. A planner picks one of the registered pipelines — and may only use parameters that appear verbatim in your query — then the platform queries the archives and renders every step as a card with live progress, figures, tables, logs and sources. Pick a pipeline and watch a run.

12 pipelines · 43 tools
562 offline tests · ~2 min
14 public demos · 7 themes
planner ⊂ registry

The LLM can't improvise

It chooses among registered pipelines; a parameter not found verbatim in the query is rejected.

BLS 0.94152 d

Checked against the literature

WASP-18 b from TESS SPOC photometry vs. 0.941453 d published — the period search is validated, not assumed.

5 / 5 · 0 FP

Membership that refuses

Five open clusters recovered; zero false positives on three empty control fields under a strict four-criterion gate.

IRSA → ALeRCE

Degrades honestly

If the ZTF light-curve service is down it falls back to alert photometry — with a visible warning and no cache.

maoAstro — an 8B astronomy LLM, fine-tuned on one 12 GB GPU

An end-to-end domain LLM: 8 GB of ADS papers distilled into a two-stage fine-tune with my own architecture tweak — QLoRA + AttnRes — then wrapped in a four-step dual-track RAG. The whole pipeline (training and 4-bit serving) runs on a single RTX 3080 Ti 12 G, and it beats GPT-4o and AstroSage-8B on domain accuracy and hallucination rate.

Data layer

Collect knowledge

Top-journal literature — ApJ / MNRAS / A&A via ADS. ~8k papers · 8 GB.

  • Fill the domain-knowledge gap
→
Training layer

Two-stage fine-tune

Incremental pre-train (30k) → instruction tune (20k).

  • Core: QLoRA + AttnRes
→
Augment layer

Dual-track RAG

Hybrid recall (vector + BM25), bge rerank Top20→Top5.

  • Core: bge reranker
→
Serving layer

Lightweight web

vLLM, 4-bit AWQ, ~5 stable concurrent users.

  • Core: PagedAttention
Architecture innovation

AttnRes — rotating attention 90° into the depth dimension

Standard residual connections just add each layer's output to the last, with a fixed weight of 1. In a deep model, knowledge injected early fades before it reaches the top (the "deep-knowledge forgetting" that hurts long astronomy reasoning). AttnRes groups the 32 layers into 8 blocks and replaces that fixed accumulation with a learnable attention over depth — a block can read directly from any earlier block. Only tiny pseudo-query vectors are trainable (~10K params, +1–2 GB VRAM), zero-initialized so training never destabilizes. Toggle the mode and watch a knowledge signal survive to the top.

Three residual designs: (a) standard residuals add each block's output; (b) full-attention residuals; (c) block attention residuals, where an AttnRes operator α attends over earlier block states via a learnable pseudo-query w with keys/values from earlier blocks.
Fig. 1. The three residual designs. (a) standard residuals sum each block's output; (c) Block-AttnRes replaces that sum with an attention operator α whose query is a small learnable vector w and whose keys/values are the earlier block states.
Standard residual — fixed unit weight
hn = hn−1 + f(hn−1)

Each block adds only the previous block's output, so knowledge injected early is attenuated with depth — the deep-knowledge forgetting that hurts long reasoning.

AttnRes — learnable attention over depth
hn = ∑i<n αn,i hi,   αn = softmax(wn K⊤√d),   K = [h0 … hn−1]

A block reads directly from any earlier block. The query wn is a tiny pseudo-query — the only trainable part — zero-initialized so training starts exactly at the standard residual and never destabilizes.

Trainable footprint — QLoRA on the pseudo-query
W = W0 + BA,   B∈ℝd×r, A∈ℝr×k,  r ≪ d

Base weights W0 stay frozen & 4-bit (NF4); only the low-rank BA and the pseudo-queries update — ~10K trainable params, +1–2 GB VRAM.

Schematic of the Block-AttnRes idea: freeze the base weights, and LoRA-tune only the depth-attention pseudo-queries. On my astronomy benchmark this lifted domain-QA accuracy 86% → 89.2%, complex-reasoning 78% → 83%, and cut hallucination 9% → 6%.

Bar-and-line chart: astronomy-task accuracy (bars) versus relative VRAM (line) as the model is split into N = 16, 8, 4, 2 blocks. Accuracy is 90.4, 89.5, 86.2, 84 percent while relative VRAM drops 100, 50, 25, 12.5 percent.
Fig. 2. Block-count ablation — bars: astronomy-QA accuracy; line: relative VRAM of the depth-attention cache, as the 32 layers are grouped into N = 16 → 2 blocks.
Why 8 blocks

The sweet spot: near-peak accuracy at a quarter of the cache

Finer granularity (N=16) is marginally more accurate (90.4%) but pays full attention-cache cost. Coarser (N=2) collapses toward standard residual and drops to 84%. N = 8 keeps 89.5% while cutting the depth-attention memory to ~50% — which is exactly why the whole thing fits on a single 12 GB consumer card.

  • N=16 — 90.4% · 100% VRAM
  • N=8 — 89.5% · 50% VRAM  ← chosen
  • N=4 — 86.2% · 25% VRAM
  • N=2 — 84.0% · 12.5% VRAM
Data pipeline

8 GB → 30k clean corpus

LaTeX / reference stripping by regex, a BERT relevance classifier to keep astrophysics core, and MinHash dedup (128–2048 tokens). Instruction set: 20k samples (DS v3.1 + human check) mixing single-turn / multi-turn / reasoning / tool-calls.

Domain vocabulary

+2000 astronomy tokens

Extended the Qwen2.5-7B / astroMlab-8B tokenizer with 2000 domain terms. Proper-noun spelling errors dropped 18% → 3%; QA accuracy +5%.

Why QLoRA

≤10 G VRAM, low forgetting

Full fine-tune needs ≥40 G and forgets fast. Rank ablation: r=8 (attn only) 78%, r=64 (all linear) 86% — best, r=128 84%. Then AttnRes on top.

RAG that refuses

Hallucination 28% → 9%

Semantic chunking + fixed-length fill lifted recall 72% → 92%; a 4-step retrieve→rerank chain and fact constraints cut hallucination to 9%, and with no reference the model declines to answer.

Two-stage fine-tune
  1. ① Incremental pre-training30k unsupervised corpus · epoch 2 · lr 5e-5 Inject astronomy base knowledge into a Qwen2.5-7B / astroMlab-8B backbone.
  2. ② Instruction tune + AttnRes20k instructions · epoch 3 · lr 1e-4 · early-stop + dropout Instruction following & dialogue, with the depth-attention pseudo-queries learned on top.

Hardware: a single RTX 3080 Ti 12 G · Transformers + vLLM · Chroma + SQLite.

Dual-track RAG · 4-step chain
  1. 1Question → metadata filter (time / journal)
  2. 2Hybrid recall — vector + BM25 → Top 20 candidates
  3. 3Rerank — bge-reranker precision sort → Top 5
  4. 4Precise context → generate, refuse if unsupported

Semantic chunking (200–800 tok) + fixed fill lifted recall 72% → 92%; multi-hop via query decomposition + parent/child blocks 58% → 70%.

Evaluation

Benchmarked against GPT-4o and AstroSage-8B

60% automated (DS v3.1 scoring) + 40% blind human review by 3 astronomers over 200 samples. Click a metric to compare.

ModelDomain acc.HallucinationReasoningVRAM
maoAstro AttnRes89.2%6%83%12 G
GPT-4o82%18%76%no local
AstroSage-8B80.9%12%78%16 G

Astro Agent — an auditable, self-evolving research agent

My open-source flagship (github.com/wangnengdejiamao/Astro_Agent): a LangGraph state machine that resolves a target, pulls multi-survey data, models it through three mandatory iterations, audits every claim, and — only when the QA gate clears — drafts an ApJ-style manuscript. It uses filesystem-as-memory for a diff-able audit trail, and a delegation loop that turns new methods from papers into tested, registered tools by handing the implementation to a second coding agent.

Self-evolving toolbox · delegation

A controlled auto-learning loop — it writes its own tools

When a run hits "I'm missing a tool", the orchestrator doesn't invent an answer. It packages the new method from a paper into a structured spec and delegates the implementation to Claude Code (claude_code_delegate) as a second coding agent. The tool is only registered as a new Skill when its tests pass — with a human review gate. Watch the hand-off.

Multi-stack toolbox

The technology toolbox

The agent is deliberately full-stack. Hover or tap a tool to see how it's used — grouped by the four architectural layers.

Application
Agent
Processing
Data
Tool detail

Hover a tool above to see how Astro Agent uses it.

Working memory

LangGraph AnalysisState

Session-level context and temporary results passed node-to-node.

Semantic memory

SQLite RAG (BM25)

Keyword search over the local white-dwarf literature — backs methodology decisions.

Structured memory

Two-layer KG

Entity graph + meta-graph over Neo4j / SQLite / JSON — supports method transfer and evidence chains.

Rule memory

Codex-style hard constraints

Every turn emits JSON — prevents behavioural drift and keeps output predictable.

Knowledge graph + dual-track RAG

The agent builds a typed knowledge graph — 8 entity types (paper · source · WD class · survey · instrument · method · model · parameter) linked by typed relations. Shown here is the graph of my own three papers; retrieval combines BM25/vector recall with multi-hop graph traversal — pick a query (or click a node) to watch it land on an entity and pull in its connected context.

ZTF light-curve classifier — a lightweight CNN

Where it started: turn every phase-folded ZTF light curve into a 224×224 image, then let a mobile-grade convolutional net read its shape. It sorts each star into EA (detached), EW (contact) or Non-EB — reaching 99.4–99.6% on 1,884 held-out curves. Pick a class and watch the forward pass; add noise and the softmax loses its nerve. Code: ztf_CNN_maoclassification.

Real pipeline: ZTF g/r photometry from IRSA, a Lomb–Scargle period, phase-folding, then a 1×224×224 render fed to GhostNet or MobileNetV2. Accuracies and the confusion matrix are the repository's reported values; the forward-pass animation is schematic.

04 · AI for Manufacturing

AI for Manufacturing

In industry I build an enterprise ontology workbench: ERP exports, process documents and expert notes become typed, source-traced objects and decision tables that are tested before anyone signs them — feeding a finite-capacity APS that proposes plans and has them independently validated.

3,500+automated test functions in the workbench
8domain modules · MRO, production chain, MM / PP / SD
5-stepreadiness ladder from draft to signed
StackOntology · YAML + MarkdownDMN-lite decision tablesOR-Tools CP-SATPython 3.12FastAPIPydanticSQLite FTS5MCP serverClaude / DeepSeek routingDocker
Ontology workbench

From a spreadsheet row to a rule someone can sign

Sources are ingested with stable ids and versions; evidence becomes entities, a wiki of claims, typed core items and finally a data & business ontology. Business logic lives in decision tables with positive and negative test cases, and climbs a readiness ladder that only a person can finish. Agents read it through a read-only MCP server. Hover a layer; pick an order to evaluate.

Evidence → Entity → Wiki
→ CoreItem → Ontology
→ Decision · PackBinding
APS trial scheduling

A plan is a proposal until it passes the validator

A deterministic heuristic places every operation by due date, priority and kit readiness; an OR-Tools CP-SAT pass then minimises 1000 × late orders + late minutes. A separate validator re-checks precedence, capacity, calendars and references before anything reaches a human. Insert a rush order, take a machine down or delay a material — the plan below is recomputed in your browser.

V-PREC · V-CAP
V-CAL · V-REF
soft: V-DUE · V-UNSCHED
source_id@version

Every fact has an address

Objects keep the file, sheet and version they came from, so a reviewer can always open the original.

hit_policy: first

A rule is a table with tests

Decision cards evaluate deterministically and ship with positive and negative cases that must pass.

feasible ≠ approved

Validation is independent

The scheduler and the validator are separate code paths; a plan that passes is still only a proposal.

human-gated RSI

Self-improvement with a gate

The system proposes rule and ontology changes from gaps; it never rewrites the ontology on its own.

Scope. Industry engagement, 2026. The figures use a fictional plant; client names, data and volumes are confidential. Workbench and pilot scope — not a claim of production factory deployment.

Across domains · Agent engineering

Agents that act

Every domain above ends in the same pattern: a planner that understands context, a specialised worker that acts, and a human gate before anything irreversible. At ZTE I built that pattern for the phone itself.

4Bmultimodal planner · screen + app inventory
32Bself-trained GUI-grounding worker
A2Atyped message bus on OpenClaw

ZTE — a mobile GUI agent that operates the phone for you

At ZTE Corporation I build a phone-side GUI agent: you say what you want in natural language, and it drives the real UI — opening apps, tapping, typing, scrolling — to get it done. It is a genuine agent-to-agent (A2A) system with two specialised models: a Planner that understands your screen and installed apps and decomposes the task, and a self-trained 32B Worker that grounds each step into concrete touches. Orchestrated on the OpenClaw framework.

Planner agent

4B multimodal · plans

Reads a screenshot of the current screen and the set of installed apps, then a large LLM decomposes the request into an ordered chain of executable sub-goals — choosing which app and what to do next.

  • Multimodal screen + app-inventory understanding
  • High-level task → sub-goal chain
  • Re-plans when the screen doesn't match expectation
Worker agent

32B · operates self-trained

A GUI-grounding model I trained to convert one sub-goal + the current screen into a concrete action — tap, swipe, type — with pixel coordinates, then reports the resulting screen back to the Planner to close the loop.

  • Sub-goal + screenshot → grounded UI action
  • tap · swipe · long-press · type
  • Reports new screen → Planner verifies / advances

Screens are redrawn, not screenshots — but the loop is the real one: perceive → plan → ground → act → verify, with a human gate before it spends money.

Planner · 4B

Understands your installed apps

A compact 4B multimodal model perceives the live screen and the app inventory, so the plan is grounded in what's actually on your phone — not a generic script.

Worker · 32B

A GUI model I trained

The 32B worker is self-trained for UI grounding: sub-goal + screenshot → exact tap / swipe / type. Splitting perception-planning from execution is what makes it a real A2A system.

OpenClaw

The orchestration layer

Built on the OpenClaw agent framework — a typed message bus carries sub-goals down and screen states back up, with a verify-and-replan loop between the two agents.

On-device

Real UI, real control

The agent drives the actual interface end-to-end — cross-app tasks that chain several apps together, exactly the multi-step errands people don't want to do by hand.