Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions ai-research-mvp-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# AI Research MVP Tools

Self-contained AI-assisted research tools milestone for [SCIBASE.AI issue #13](https://github.com/SCIBASE-AI/SCIBASE.AI/issues/13).

The issue asks for paper summaries, pre-review diagnostics, and citation assistance. This module provides deterministic local versions of those workflows so reviewers can run the MVP without model keys, retrieval credentials, or external services.

## What It Adds

- Paper summaries in abstract, executive, and layperson modes.
- Key findings, implications, next steps, and keyword extraction.
- Domain-specific review templates for biology, physics, social sciences, and general manuscripts.
- Pre-review diagnostics for missing required sections, ethics/data availability gaps, statistical reporting gaps, clarity signals, and similarity evidence.
- Similarity signal against a local open-access corpus fixture.
- Citation recommendations ranked by manuscript keyword overlap, recency, and citation signal.
- Highlighted-text citation recommendations with evidence hashes for selected manuscript spans.
- Similar-papers widget combining open-access similarity signals and citation-corpus matches with reasons and actions.
- Claim-support report that extracts manuscript claim sentences, matches citation evidence, and returns insert-or-revise actions with evidence-span hashes.
- APA, MLA, and Nature-style reference formatting.
- One-click citation insert-action metadata plus drag payloads and target anchors for manuscript insertion.
- Sample manuscript/corpus fixture, tests, requirement map, CLI demo, and short demo GIF.

## Run

```bash
cd ai-research-mvp-tools
npm run check
npm test
npm run demo
```

Expected demo shape:

```json
{
"summaryModes": ["abstract", "executive", "layperson"],
"qualityScore": 55,
"reviewFindings": ["compliance:...", "statistics:..."],
"topCitation": {
"doi": "10.1016/j.watres.2025.120001"
},
"highlightedCitation": {
"doi": "10.1016/j.watres.2025.120001"
},
"citationInsertionPlan": {
"targetAnchor": "manuscript:results:p3",
"insertions": 2
},
"similarPapers": [
{
"source": "open-access-corpus",
"action": {
"type": "open-similar-paper"
}
}
],
"claimSupport": {
"claims": 4,
"unsupportedCount": 0,
"recommendedCitationCount": 3
},
"insertActions": 2,
"packetHash": "..."
}
```

## Demo Artifact

See [docs/demo.gif](docs/demo.gif) for a short visual walkthrough. The SVG source is included at [docs/demo.svg](docs/demo.svg).

## Files

- `src/ai-research-mvp-tools.js` - summarization, review diagnostics, similarity, citation ranking, highlighted-text citation support, insertion planning, claim support, formatting.
- `data/sample-research.json` - reviewable manuscript, open-access corpus, and citation corpus fixture.
- `test/ai-research-mvp-tools.test.js` - dependency-free Node tests.
- `scripts/demo.js` - CLI demo.
- `docs/issue-13-requirement-map.md` - maps the implementation to bounty requirements.

## AI-Assisted Disclosure

This contribution was produced with AI assistance and manually verified with the local commands above.
63 changes: 63 additions & 0 deletions ai-research-mvp-tools/data/sample-research.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"document": {
"id": "draft-flood-microbiome",
"title": "Coastal flooding changes microbial diversity in urban waterways",
"domain": "biology",
"body": "Abstract. Coastal flooding is increasing in urban waterways. We analyzed 240 microbiome samples collected before and after flood exposure using Jupyter notebooks and open metadata. Methods. Samples were sequenced with 16S profiling and processed in a reproducible Docker environment. Results show a statistically significant decrease in microbial diversity after flooding with p < 0.03. The analysis found that flood exposure was associated with shifts in coastal pathogen markers. These findings suggest that climate-linked flooding could reshape urban microbial ecology. Data availability is provided through an open repository with notebooks and raw count tables. Future work should validate these results across additional cities and include confidence interval reporting.",
"references": [
{
"doi": "10.1038/s41586-020-2649-2",
"title": "Existing microbiome atlas",
"authors": ["Reference Author"],
"year": 2020,
"venue": "Nature"
}
]
},
"highlightedText": "flood exposure was associated with shifts in coastal pathogen markers",
"targetAnchor": "manuscript:results:p3",
"openAccessCorpus": [
{
"id": "oa-1",
"title": "Flood exposure and microbial diversity in estuaries",
"abstract": "Coastal flooding changes microbial diversity and pathogen markers in estuary samples after flood exposure."
},
{
"id": "oa-2",
"title": "Quantum sensor calibration",
"abstract": "A physics calibration method for instrument uncertainty and error bars."
}
],
"citationCorpus": [
{
"id": "cite-1",
"doi": "10.1016/j.watres.2025.120001",
"title": "Urban floodwater microbiome dynamics",
"authors": ["M. Rivera", "S. Nair"],
"year": 2025,
"venue": "Water Research",
"abstract": "Urban floodwater microbiome dynamics reveal shifts in pathogen markers and microbial diversity after coastal flooding.",
"citations": 88
},
{
"id": "cite-2",
"doi": "10.1101/2026.04.01.123456",
"title": "Reproducible Docker workflows for environmental microbiome notebooks",
"authors": ["A. Chen", "R. Patel"],
"year": 2026,
"venue": "bioRxiv",
"abstract": "Docker and Jupyter notebook workflows improve reproducibility for environmental microbiome analysis.",
"citations": 12
},
{
"id": "cite-3",
"doi": "10.1038/s41586-020-2649-2",
"title": "Existing microbiome atlas",
"authors": ["Reference Author"],
"year": 2020,
"venue": "Nature",
"abstract": "A previously cited microbiome atlas.",
"citations": 300
}
]
}
Binary file added ai-research-mvp-tools/docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ai-research-mvp-tools/docs/demo.mp4
Binary file not shown.
33 changes: 33 additions & 0 deletions ai-research-mvp-tools/docs/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions ai-research-mvp-tools/docs/issue-13-requirement-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Issue #13 Requirement Map

This module implements deterministic AI-assisted research MVP tools for SCIBASE issue #13. It focuses on paper summaries, pre-review diagnostics, citation recommendations, formatting, and one-click insertion metadata without requiring live model or retrieval services.

| Issue requirement | Implementation |
| --- | --- |
| AI paper summarizer | `summarizePaper()` ranks document sentences by domain keywords and emits abstract, executive, and layperson modes. |
| Key findings, implications, and next steps | `summarizePaper()` includes extracted finding, implication, and next-step sentence lists. |
| Scientific-domain-aware output | `reviewManuscript()` selects biology, physics, social-sciences, or general templates with domain-specific checks. |
| AI peer review aid | `reviewManuscript()` emits diagnostics for missing sections, statistical reporting gaps, clarity signals, compliance issues, and similarity matches. |
| Plagiarism/similarity signal | `detectSimilarity()` compares manuscript terms against an open-access corpus fixture and reports overlapping evidence. |
| Statistical error detection | `reviewManuscript()` flags p-values without confidence intervals and missing template-specific statistical reporting. |
| Compliance checks | Domain templates require sections such as ethics and data availability. |
| AI citation tool | `recommendCitations()` ranks citation candidates by keyword overlap, recency, and citation signal while excluding already cited DOIs. |
| Recommendations from highlighted text | `recommendCitationsForSelection()` ranks citations against selected manuscript text and returns highlighted-span evidence hashes. |
| Similar papers widget | `buildSimilarPapersWidget()` combines open-access similarity evidence and citation-corpus matches into ranked recommendations with user actions. |
| Context-aware citation support | `buildClaimSupportReport()` extracts claim sentences, scores supporting citation candidates, classifies support status, and returns insert-or-revise actions with evidence-span hashes. |
| Auto-formatted references | `formatReference()` supports APA, MLA, and Nature-style output. |
| Drag-and-drop or one-click insert metadata | `buildCitationInsertionPlan()` returns one-click citation insertions with target anchors and drag payloads; `buildResearchToolsPacket()` includes those insertion plans and simple `insertActions`. |
| Reviewer demo | `npm run demo` prints summary modes, review findings, top citation, insert-action count, and packet hash. |

## Verification

```bash
npm run check
npm test
npm run demo
```

The module is dependency-free and isolated under `ai-research-mvp-tools/`.
12 changes: 12 additions & 0 deletions ai-research-mvp-tools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "scibase-ai-research-mvp-tools",
"version": "0.1.0",
"private": true,
"description": "Deterministic AI-assisted research MVP tools for SCIBASE issue #13.",
"type": "commonjs",
"scripts": {
"check": "node --check src/ai-research-mvp-tools.js && node --check scripts/demo.js && node --check test/ai-research-mvp-tools.test.js",
"demo": "node scripts/demo.js",
"test": "node test/ai-research-mvp-tools.test.js"
}
}
37 changes: 37 additions & 0 deletions ai-research-mvp-tools/scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"use strict";

const sample = require("../data/sample-research.json");
const { buildResearchToolsPacket } = require("../src/ai-research-mvp-tools");

const packet = buildResearchToolsPacket(sample);

console.log(
JSON.stringify(
{
document: packet.document.title,
summaryModes: Object.keys(packet.summaries),
qualityScore: packet.reviewReport.qualityScore,
reviewFindings: packet.reviewReport.findings.map((finding) => `${finding.category}:${finding.message}`),
topCitation: packet.citationRecommendations[0],
highlightedCitation: packet.selectionRecommendations[0],
citationInsertionPlan: {
targetAnchor: packet.citationInsertionPlan.targetAnchor,
insertions: packet.citationInsertionPlan.insertions.length,
firstDragPayload: packet.citationInsertionPlan.insertions[0]
? packet.citationInsertionPlan.insertions[0].dragPayload
: null,
},
similarPapers: packet.similarPapersWidget,
claimSupport: {
claims: packet.claimSupportReport.claims.length,
unsupportedCount: packet.claimSupportReport.unsupportedCount,
recommendedCitationCount: packet.claimSupportReport.recommendedCitationCount,
firstAction: packet.claimSupportReport.claims[0] ? packet.claimSupportReport.claims[0].action : null,
},
insertActions: packet.insertActions.length,
packetHash: packet.packetHash,
},
null,
2,
),
);
Loading