科研 Skill

增材制造文献问答检索

am-literature-rag

Answers additive-manufacturing questions from the user’s own PDF library with page-cited evidence via retrieval. Use for literature-grounded AM questions instead of relying on memory.

发布者 Codar安全审核通过v0.1.0更新于 2026-11-18

SKILL.md

AM literature RAG (AMGPT)

AMGPT (Chandrasekhar et al., Additive Manufacturing Letters 11 (2024) 100232) showed that a mid-size model reading a curated library gives specific, citable answers to metal-AM questions that general chatbots answer vaguely. Its stack:

  • PDFs converted to TeX with Mathpix
  • LlamaIndex chunking
  • all-mpnet-base-v2 embeddings
  • cosine top-k retrieval
  • Llama2-7B generation

Here you are the generator and scripts/amrag.py is the retriever. Every passage it returns carries a [short title, p.N] citation.

Workflow

  1. Build the library.

    python scripts/amrag.py ingest ~/papers/*.pdf --index lib/      # incremental; dedups by file hash
    python scripts/amrag.py list --index lib/
    
    • Text comes from pdftotext (poppler) when it is installed, otherwise from pypdf.
    • Chunks are about 220 words with 40 words of overlap, and never cross a page boundary, so page citations are exact.
    • Reference lists are dropped.
    • For scanned PDFs, OCR them first (e.g. ocrmypdf).

    No papers yet? python scripts/amrag.py reading-list --topic "melt pool" prints the AMGPT corpus (55 titles with DOIs and topics, MIT-licensed metadata from the authors' repo). The user downloads what their library has access to.

  2. Retrieve, then answer. For each question:

    python scripts/amrag.py query "how does hatch spacing affect lack-of-fusion porosity?" --index lib/ --k 5 [--per-doc 2]
    

    Read the passages and write the answer only from them:

    • Cite each claim with the cite string, for example [ThermoPore: Predicting part porosity…, p.4].
    • If the passages don't answer the question, say "the library doesn't cover this". Then answer from general knowledge, clearly labelled as such, or ask for the paper.
    • When sources disagree, give both views with their citations.
    • Quote numbers exactly as written (units included). Don't round or convert silently.
  3. Tune. AMGPT found that a small top-k and low sampling temperature gave the most faithful answers. Start at --k 5. Raise it only for survey-style questions, and then use --per-doc 2 so a single paper can't dominate the results.

Retrievers

  • --backend hybrid (default): reciprocal-rank fusion of BM25 and dense, when sentence-transformers and the Hugging Face model are reachable. Otherwise it falls back to BM25 and reports bm25 (dense unavailable).
  • --backend dense: AMGPT's all-mpnet-base-v2 (768-d, cosine). Embeddings are cached in lib/dense.npy.
  • --backend bm25: no model download. Strong on exact terms (alloy names, units, symbols), weaker on paraphrases.

Check the retriever on your own library

Write questions with the file they should come from and a phrase the right passage must contain (see examples/questions_lab.json), then run:

python scripts/amrag.py eval my_questions.json --index lib/ --k 3
  • On the 13 lab papers in this repo's tutorials, BM25 alone found the right passage for 11 of 12 questions at k = 3.
  • The one miss was a paraphrase: "unsafe commands" against the paper's "unintended shutdowns". That kind of miss is what the dense model fixes.

Paper facts worth repeating

  • AMGPT's RAG system answered 80% of its expert-graded prompts factually without hallucination, against 86.7% for GPT-4. Its answers were more specific, from a model with under 0.5% of GPT-4's parameters.
  • The system can also pull 10 full-text papers per query from the ScienceDirect Search API. This skill doesn't call that API (it needs a key and an institutional entitlement), but the user can download those papers and ingest them.

Cite: Chandrasekhar et al., AMGPT, Addit. Manuf. Lett. 11 (2024) 100232; code and corpus list github.com/BaratiLab/LLM_RAG (MIT).

示例提示词

从我收藏的增材制造论文库里,帮我查熔池深宽比的经验公式并标注出处页码。

所属插件

机械设计与先进制造面向机械设计与制造研究:文本/草图生成 CAD、FreeCAD/SolidWorks 参数化建模、机构综合与零件选型、公差与 GD&T、DFM 与设计评审、快速有限元与应力代理模型、增材制造工艺与缺陷预测、疲劳断裂寿命。

安装该插件会一并获得同领域的 35 个 Skill / MCP。

同插件的其他科研 Skill

常见问题

增材制造文献问答检索能做什么?

Answers additive-manufacturing questions from the user’s own PDF library with page-cited evidence via retrieval. Use for literature-grounded AM questions instead of relying on memory。

如何安装增材制造文献问答检索?

在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「增材制造文献问答检索」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。

增材制造文献问答检索需要哪些权限?

该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。

增材制造文献问答检索经过官方审核吗?

是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。