Content
# Paper Generator
> One person + LLM = A complete research team.
[](https://python.org)
[](LICENSE)
Give it a research topic and experimental data, and it returns a LaTeX paper that meets journal standards. 13 Agents work together - planning, literature retrieval, writing, adversarial questioning, citation verification, typesetting, simulated review - fully automated, end-to-end.
Then you're unsure about the paper quality? 23 virtual research roles are ready: Chief Investigator helps you choose a direction, Devil's Advocate attacks your weaknesses, Ethics Officer ensures compliance, Literature Manager fixes every BibTeX.
**This is not a copilot. This is a team.**
**Who is it for:**
- **Independent Researchers** — One person completes the entire process of exploration, writing, verification, and submission
- **Graduate Students** — Structured paper generation + simulated peer review, rapid iteration
- **AI Assistant Users** — 31 MCP tools, Claude Desktop / VS Code Copilot direct call
---
## Quick Start
```bash
# Installation
git clone <repo-url> && cd new-laxtax
pip install -e .
# Explore direction
paper-generator explore "knowledge distillation for medical image segmentation" \
--provider qianwen --model qwen3.6-plus --api-key $LLM_API_KEY
# Generate paper
paper-generator generate "knowledge distillation for polyp segmentation" \
--provider qianwen --model qwen3.6-plus --api-key $LLM_API_KEY \
--data-dir data --venue springer --no-human \
--from-exploration output/exploration_report.json
# One-click full process: exploration → generation → polishing → verification
paper-generator chain "polyp segmentation with knowledge distillation" \
--provider qianwen --model qwen3.6-plus --api-key $LLM_API_KEY \
--data-dir data --venue springer
```
Three commands. From scratch to a postable paper.
---
## Watch it work
```
You: paper-generator explore "transformer pruning for edge deployment"
System: [5 Agents launched]
DiscoveryAgent — Parallelly crawls literature from Semantic Scholar + OpenAlex + Crossref + ArXiv + Google Scholar + DBLP six sources
ParserAgent — LLM batch extracts features
DirectionAgent — Clusters into 4 research directions
FeasibilityAgent — Evaluates feasibility, data availability, GPU budget for each direction
ReportAgent — Generates ranked report
→ output/exploration_report.json
You: paper-generator generate "structured pruning via knowledge distillation" \
--from-exploration output/exploration_report.json --venue neurips
System: [13 Agents pipeline]
DataAgent → PlanningAgent → KnowledgeAgent → NarrativeDirector →
LiteratureSynthesis → VoiceAlignment → WritingAgent →
DevilsAdvocate → VerificationAgent → VisualVerify → TypesettingAgent → ReviewAgent
[Automatically 3 rounds writing ↔ verification revision]
→ output/paper.tex + references.bib + paper.pdf
You: paper-generator audit output/paper.tex --bib-file output/references.bib
System: [Three-dimensional audit]
Citation integrity — 2 DOI invalid, 1 metadata mismatch
Deep verification — Section 3's 2nd claim lacks PDF evidence support
AI flavor detection — Discussion section language density high
→ audit_report.json (CRITICAL: 0, HIGH: 2, MEDIUM: 3, LOW: 1)
```
You say "explore transformer pruning". The system crawls 30+ papers from five academic databases, clusters directions, evaluates feasibility, generates a paper, and audits itself. The entire process requires no manual intervention.
---
## Generation Pipeline
**Explore → Plan → Write → Verify → Typeset → Review**
Each stage's Agent reads the previous stage's output to ensure no omissions.
### 13 Agents
| Agent | What it does |
|-------|--------|
| **DataAgent** | Parses experimental CSV, Data-View Decoupling to prevent LLM from fabricating data coordinates |
| **PlanningAgent** | Generates IMRaD outline, locks word count and journal constraints |
| **KnowledgeAgent** | Retrieves literature, constructs citation graph, binds each paragraph with DOI anchor |
| **NarrativeDirector** | Designs global story arc, arranges sections in human writing order (Method→Results→Intro→Discussion) |
| **LiteratureSynthesis** | Upgrades Related Work from "reporting names" to thematic grouping and critical analysis |
| **VoiceAlignment** | Extracts style profile from sample .tex, Few-Shot Style Cloning |
| **WritingAgent** | Writes sections, controls citation density, prohibits clichés and placeholders |
| **DevilsAdvocate** | Generates 3-5 adversarial questions, forces Discussion to reflect deeply |
| **VerificationAgent** | Checks logical consistency + citation accuracy + method reproducibility |
| **VisualVerify** | TCVR cycle: TikZ compilation → VLM visual evaluation → LLM repair → up to 3 rounds |
| **TypesettingAgent** | Applies journal templates (IEEE / ACM / NeurIPS / Springer / Nature, etc.) |
| **ReviewAgent** | Simulates peer review with four roles (Critique / Support / Methodology / Editor) |
| **RebuttalAgent** | Responds to each review comment, generates revised abstract |
---
## Research Team — 23 Virtual Research Roles
Use slash commands in AI assistants (Claude Desktop / VS Code Copilot) to invoke. Each role encapsulates specific MCP tool combinations.
### Core Roles
| Role | Skills | What it does |
|------|------|--------|
| Chief Investigator | `/research-direction` | Explores direction, selects strategy, plans iteration, records feedback |
| Literature Reviewer | `/lit-search` | Multi-source literature retrieval, historical memory search, competitive landscape analysis |
| Methodology Consultant | `/methodology` | Research design, statistical planning, hypothesis formalization |
| Experiment Designer | `/experiment-design` | Baseline, ablation factors, resource budget, timeline |
| Data Analyst | `/data-analysis` | Data processing, table/graph generation, statistical analysis |
| Narrative Director | `/narrative` | Paper story arc, section structure blueprint |
| Paper Writer | `/draft` | Invokes generate_paper to generate complete LaTeX |
| Peer Review Team | `/peer-review` | Four reviewers' adversarial review + unified audit |
| Citation Verifier | `/verify` | DOI verification + claim-evidence matching + PDF download |
| Language Editor | `/polish` | Polishing, AI flavor removal, style calibration |
| Publishing Manager | `/publish` | Typesetting, compilation, submission package preparation |
| Lab Supervisor | `/research-pipeline` | Complete A→F pipeline arrangement + quality gate |
### Extended Roles
| Role | Skills | What it does |
|------|------|--------|
| Competitive Landscape Analyst | `/landscape` | Research field mapping, differentiation opportunities, white space identification |
| Blind Spot Analyst | `/gap-analysis` | Coverage gap, interdisciplinary opportunities, prioritization |
| Hypothesis Amplifier | `/hypothesis` | Competitive hypothesis generation, comparison matrix, human selection gate |
| Style Cloning Expert | `/style-align` | Reference style extraction, tone alignment, AI flavor removal |
| Visualization Expert | `/visualize` | TikZ/pgfplots chart generation + TCVR verification cycle |
| Devil's Advocate | `/challenge` | Five-angle attack, claim-evidence audit, discussion enhancement |
| Ethics Officer | `/ethics-audit` | COPE compliance, AI use disclosure, data ethics |
| Literature Manager | `/bibliography` | BibTeX repair, DOI refill, PDF download |
| Rebuttal Writer | `/rebuttal` | Review comment response, revised abstract |
| Progress Manager | `/checkpoint` | Checkpoint save/restore, pipeline status |
| Retro Host | `/retro` | Efficiency analysis, quality evolution, lessons learned |
### Research Pipeline Six Stages
| Stage | Role | Quality Gate |
|------|------|--------|
| **A. Exploration** | `/research-direction` `/lit-search` | At least 1 direction score ≥ 75 |
| **B. Design** | `/methodology` `/experiment-design` | Experiment plan approved |
| **C. Analysis** | `/data-analysis` | At least 1 table + 1 figure |
| **D. Writing** | `/narrative` `/draft` | .tex compilation successful |
| **E. Quality** | `/peer-review` `/verify` `/polish` `/challenge` `/ethics-audit` | Review score ≥ 6/10 |
| **F. Publication** | `/publish` `/bibliography` `/rebuttal` | Format compliant + submission package ready |
Critical decisions use Voice A (LLM) + Voice B (DevilsAdvocateAgent) dual-model confrontation. Disagreements > 3 points are submitted to the researcher for decision.
---
## MCP Server — 31 Tools
Native interface for AI assistants. Claude Desktop, VS Code Copilot, ChatGPT direct call.
```bash
# stdio mode (recommended)
paper-generator-mcp
# SSE mode
paper-generator-mcp --transport sse
```
**Claude Desktop configuration:**
```json
{
"mcpServers": {
"paper-generator": {
"command": "paper-generator-mcp",
"args": []
}
}
}
```
### Original Tools (16)
| Tool | Purpose |
|------|------|
| `explore_topic` | Six-source literature crawling + LLM direction mining + feasibility evaluation |
| `generate_paper` | 13 Agent pipeline generates complete LaTeX paper |
| `polish_paper` | 7 Agent polishing (language + AI flavor + structure + review simulation) |
| `verify_citations` | DOI verification + metadata checking + citation stacking detection |
| `deep_verify_citations` | PDF extraction + LLM claim-evidence semantic matching |
| `audit_paper` | Citation + deep verification + AI flavor, three-dimensional unified audit |
| `download_pdfs` | Automatically retrieves PDFs from Unpaywall / S2 / arXiv |
| `memory_search` | Semantic search historical exploration results |
| `memory_feedback` | Marks direction as feasible/unfeasible/need adjustment |
| `list_checkpoints` | View pipeline cache and exploration progress |
| `analyze_gaps` | Blind spot identification + cross-direction opportunities |
| `compare_landscape` | S2 + OpenAlex + ArXiv three-source competitive landscape analysis |
| `plan_next_step` | Comprehensive exploration/blind spot/landscape, decides next action |
| `execute_step` | Execute plan step (whitelist limited) |
| `design_experiment` | Structured experiment plan (hypothesis, baseline, dataset, metrics) |
| `auto_research_loop` | One-click multi-round iteration: explore → gaps → landscape → plan → execute |
### New Tools (15)
#### Phase 1: Exposing Existing Agents
| Tool | Corresponding Role | Purpose |
|------|----------|------|
| `analyze_data` | `/data-analysis` | CSV data → LaTeX table + pgfplots chart |
| `design_narrative` | `/narrative` | Generates story arc, section instructions, writing order |
| `compile_latex` | `/publish` | LaTeX fragment → PNG preview |
| `assemble_document` | `/publish` | Assembles final LaTeX document (TypesettingAgent) |
| `generate_rebuttal` | `/rebuttal` | Responds to review comments |
| `extract_style_profile` | `/style-align` | Extracts writing style fingerprint from reference paper |
#### Phase 2: Enhancing Existing Capabilities
| Tool | Corresponding Role | Purpose |
|------|----------|------|
| `simulate_review` | `/peer-review` | Multi-role review simulation + stress test |
| `generate_figures` | `/visualize` | Data chart generation + TCVR visual verification cycle |
| `generate_adversarial_critique` | `/challenge` | Five-angle adversarial questioning |
| `synthesize_literature` | `/methodology` | Citation list → thematic classification review |
| `plan_paper_outline` | `/hypothesis` | Hypothesis generation + paper outline planning |
#### Phase 3: New Capabilities
| Tool | Corresponding Role | Purpose |
|------|----------|------|
| `write_section` | `/draft` | Generates LaTeX by section (Introduction, Method, etc.) |
| `fix_bibliography` | `/bibliography` | BibTeX automatic repair (DOI refill, deduplication, normalization) |
| `check_ethics_compliance` | `/ethics-audit` | COPE compliance + AI disclosure + data ethics check |
| `save_research_checkpoint` | `/checkpoint` | Save/restore research project state |
**Autonomous exploration cycle:**
```
explore_topic → analyze_gaps → compare_landscape → plan_next_step → execute_step → ...
```
`auto_research_loop` encapsulates the entire cycle, converging automatically (best_direction_score ≥ 75 and coverage ≥ 60).
---
## CLI Commands
8 subcommands, covering the complete research workflow.
### Common Parameters
| Parameter | Description | Default Value |
|------|------|--------|
| `--provider` | `openai` / `anthropic` / `qianwen` / `local` | `openai` |
| `--model` | Model name | `gpt-4o` |
| `--api-key` | API key (or `LLM_API_KEY` environment variable) | — |
| `--config` | JSON configuration file | — |
### Command Quick Check
```bash
# Exploration (5 Agent pipeline)
paper-generator explore <query> [--seed-papers DOI1,DOI2] [-o OUTPUT_DIR]
# Generation (13 Agent pipeline)
paper-generator generate <topic> [-d DATA_DIR] [-v VENUE] [--from-exploration FILE]
[--no-review] [--no-human] [--style-reference paper1.tex] [--resume]
# Polishing (7 Agent pipeline)
paper-generator polish <tex_file> [--intensity conservative|balanced|aggressive]
[--num-reviewers N] [--target-journals J1,J2]
# Full process series
paper-generator chain <topic> [-d DATA_DIR] [-v VENUE] [--skip-verify]
# Citation verification (no LLM)
paper-generator verify-citations <tex_file> [--bib-file FILE] [--check-doi] [--check-metadata]
# Deep citation verification (needs LLM)
paper-generator deep-verify <tex_file> [--pdf-dir DIR]
# Unified audit
paper-generator audit <tex_file> [--skip-deep-verify] [--skip-ai-flavor]
# Tool List
## PDF Download
paper-generator download-pdfs <bib_file> [--pdf-dir DIR] [--email EMAIL]
**Supported Journal Formats:** IEEE / ACM / NeurIPS / ACL / AAAI / ICLR / ICML / Springer / Nature
**Supported LLMs:** OpenAI / Anthropic / / Local Models
---
## Installation
```bash
pip install -e . # Basic installation
pip install -e ".[dev]" # Development dependencies (pytest, ruff)
pip install -e ".[mcp]" # MCP Server
pip install -e ".[vision]" # Visual verification (pdf2image)
pip install -e ".[deep-verify]" # Deep citation verification (PyMuPDF)
pip install -e ".[langgraph]" # LangGraph autonomous loop backend
pip install -e ".[exploration]" # Semantic search (sentence-transformers)
```
**Optional External Tools:**
- TeX Live / MiKTeX — PDF compilation
- [LanguageTool](https://languagetool.org/) — Grammar checking
---
## Web UI
```bash
paper-generator-ui # or python -m paper_generator.web_ui
```
Visit `http://localhost:7860`. 6 tabs: Environment configuration, Paper generation, Research exploration, Paper polishing, Result viewing, Log monitoring.
---
## Architecture
```
[Research topic + Experimental data + Target journal]
│
▼
Exploration subsystem (5 Agent + Autonomous loop)
DiscoveryAgent → ParserAgent → DirectionAgent → FeasibilityAgent → ReportAgent
│
▼
Generation pipeline (13 Agent)
Data → Planning → Knowledge → Narrative → Synthesis → Voice → Writing →
DevilsAdvocate → Verification → VisualVerify → Typesetting → Review
│ ↑_________|
│ (up to 3 revision rounds)
▼
Polishing subsystem (7 Agent)
LangPolish → AIFlavor → StructOpt → FormatCheck → JournalMatch → RevSimul → Report
│
▼
Audit tools (citation + deep verification + AI flavor)
│
▼
[Journal-level manuscript + Audit report + COPE statement]
```
### Three Layers of Quality Protection
| Layer | Timing | Protection |
|------|------|------|
| **Prevention** | During generation | Citation density control, prohibition of placeholders, limited boilerplate, no section preview sentences |
| **Polishing** | During polishing | Boilerplate removal (11 hedging patterns), content shrinkage protection, paragraph splitting |
| **Safety net** | Before compilation | Citation merging, near-duplicate paragraph removal, 6 LaTeX structure repairs |
### Visual Verification
- **Data-View Decoupling**: CSV data read at compile-time via `\pgfplotstableread`, preventing LLM fabrication of coordinates
- **TCVR loop**: TikZ compilation → PNG rendering → VLM visual evaluation → LLM repair → up to 3 rounds
- **TikZ template library**: 8 pre-verified skeletons (architecture diagrams, pipelines, bar charts, heatmaps, etc.)
---
## Project Structure
```
new-laxtax/
├── paper_generator/
│ ├── main.py # CLI entry point (8 subcommands)
│ ├── pipeline.py # Main generation pipeline
│ ├── llm_client.py # OpenAI-compatible API client
│ ├── mcp_server.py # MCP Server (16 tools)
│ ├── web_ui.py # Gradio Web UI
│ ├── agents/ # Paper generation Agent (13)
│ │ ├── data_agent.py # Data-View Decoupling
│ │ ├── planning.py # Outline generation
│ │ ├── knowledge.py # Literature retrieval
│ │ ├── narrative.py # Narrative direction
│ │ ├── synthesis.py # Literature synthesis
│ │ ├── voice.py # Style alignment
│ │ ├── writing.py # Section writing
│ │ ├── devils_advocate.py # Adversarial questioning
│ │ ├── verification.py # Logic/citation verification
│ │ ├── visual_verify.py # TCVR visual verification
│ │ ├── typesetting.py # Journal layout
│ │ ├── review.py # Simulated peer review
│ │ └── rebuttal.py # Referee comment response
│ ├── exploration/ # Exploration subsystem (5 Agent + Autonomous toolchain)
│ │ ├── orchestrator.py # Pipeline orchestration
│ │ ├── discovery.py # Six-source literature discovery
│ │ ├── parser.py # Feature analysis
│ │ ├── direction.py # Direction mining
│ │ ├── feasibility.py # Feasibility evaluation
│ │ ├── report.py # Report generation
│ │ ├── gap_analyzer.py # Blind spot analysis
│ │ ├── landscape.py # Competitive landscape analysis
│ │ ├── planner.py # Next step planning
│ │ ├── auto_loop.py # Autonomous research loop
│ │ ├── experiment_design.py # Experiment design
│ │ ├── memory.py # Exploration memory
│ │ └── langgraph_loop.py # LangGraph backend
│ ├── polishing/ # Polishing subsystem (7 Agent)
│ │ ├── orchestrator.py # Polishing orchestration
│ │ ├── lang_polish.py # Language polishing
│ │ ├── ai_flavor.py # AI flavor detection
│ │ ├── struct_opt.py # Structure optimization
│ │ ├── format_check.py # Format compliance
│ │ ├── journal_match.py # Journal matching
│ │ ├── review_simul.py # Review simulation
│ │ └── cope_declaration.py # COPE statement
│ └── tools/ # Independent tools
│ ├── verify_citations.py # Citation verification
│ ├── deep_verify.py # Deep citation verification
│ ├── audit.py # Unified audit
│ └── latex_compiler.py # LaTeX compiler
├── research-team/ # Virtual research team (23 roles/ skills)
│ ├── SKILL.md # Router
│ ├── TEAM.md # Role reference manual
│ └── <23 skill dirs>/ # Role SKILL.md
├── tests/ # Tests
├── data/ # Experimental data (CSV / figures)
├── config.example.json # Configuration example
└── pyproject.toml # Project metadata
```
---
## Configuration
```json
{
"llm": {
"provider": "",
"model": "",
"base_url": "",
"temperature": 0.3,
"max_tokens": 4096,
"timeout": 300
},
"retrieval": {
"serpapi_key": "",
"openalex_api_key": "",
"crossref_email": "",
"semantic_scholar_api_key": "",
"max_papers": 30,
"recent_years": 3
},
"polishing": {
"reviewer_strictness": "moderate",
"citation_stacking_threshold": 3
},
"venue": "springer",
"human_in_the_loop": true
}
```
Full example see [config.example.json](config.example.json).
**Environment Variables:**
| Variable | Description |
|------|------|
| `LLM_API_KEY` | LLM API key |
| `LLM_BASE_URL` | API endpoint |
| `GRADIO_SERVER_PORT` | Web UI port (default 7860) |
---
## Changelog
### v0.9.0 — MCP Tool Full Coverage (31 tools)
**Added 15 MCP tools**, making all 23 virtual research roles have at least 1 dedicated tool:
**Phase 1 — Exposing existing Agent (6 tools):**
- `analyze_data` — DataAgent packaging: CSV → LaTeX table + pgfplots figure
- `design_narrative` — NarrativeDirectorAgent packaging: story arc + section instructions + writing order
- `compile_latex` — StandaloneCompiler packaging: LaTeX snippet → PNG preview
- `assemble_document` — TypesettingAgent packaging: assemble final LaTeX document
- `generate_rebuttal` — RebuttalAgent packaging: respond to referee comments
- `extract_style_profile` — VoiceAlignmentAgent packaging: style fingerprint extraction
**Phase 2 — Enhancing existing capabilities (5 tools):**
- `simulate_review` — ReviewAgent packaging: multi-role review simulation + stress testing
- `generate_figures` — DataAgent + VisualVerifyAgent: figure generation + TCVR loop
- `generate_adversarial_critique` — DevilsAdvocateAgent packaging: five-angle adversarial questioning
- `synthesize_literature` — LiteratureSynthesisAgent packaging: topic classification literature review
- `plan_paper_outline` — PlanningAgent packaging: hypothesis generation + outline planning
**Phase 3 — New capabilities (4 tools):**
- `write_section` — WritingAgent packaging: section generation LaTeX
- `fix_bibliography` — BibTeX automatic repair (DOI refill, deduplication, author name normalization)
- `check_ethics_compliance` — COPE compliance + AI disclosure + data ethics check
- `save_research_checkpoint` — research project state save/restore
**Other improvements:**
- `execute_step` whitelist expanded to 24 tools
- Updated TEAM.md role→tool mapping
- Updated copilot-instructions.md tool documentation
### Research Team v1.1.0 (2026-04-17) — Skill system reinforcement
- 24 SKILL.md all added Error Handling tables (customized error handling strategies by skill type)
- Added `shared/dual-voice-protocol.md` (five-angle attack, consensus table template, >3 point escalation rule)
- Cross-platform support: `shared/preamble.md` added bash↔PowerShell equivalent command table
- Corrected tool list: hypothesis (removed generate_paper, added memory_search), lit-search (added analyze_gaps), methodology (added memory_search), research-pipeline (added execute_step)
- Skill-specific enhancements: review rating scale, 6-source parallel instructions, deadline awareness, generation failure recovery, API key configuration guidelines
### v0.8.0 (2026-04-13) — Powerful polishing + MCP one-stop
**Phase 1: Independent citation verification tool**
- Added `verify-citations` CLI subcommand
- DOI verification (Crossref API), metadata cross-validation (Semantic Scholar)
- Citation stacking detection, SQLite cache, JSON report output
**Phase 2: AI flavor detection Agent**
- Added `AIFlavorAgent`, inserted into polishing pipeline LangPolish→**AIFlavor**→StructOpt
- 6-dimensional detection: sentence pattern repetition, hedging language density, claim overload, list/parallel overload, passive voice density, citation stacking
- Per paragraph AI-flavor score 0-1 + specific problem annotation
- AI-flavor automatic correction loop: high-score paragraphs automatically request rewriting suggestions from LLM
**Phase 3: Visual integration into polishing process**
- Automatically extract images before polishing and invoke VLM to generate descriptions
- StructOpt added caption-figure consistency check
- RevSimul review simulation incorporates figure evaluation
- FormatCheck added caption verification
**Phase 4: MCP Server**
- Added `paper-generator-mcp` entry point (FastMCP SDK)
- 16 tools: basic 6 + exploration memory 3 + autonomous exploration 4 + autonomous loop + experiment design + PDF download
- Support stdio / SSE transmission mode
- Path traversal security protection
**Phase 5: Deep citation verification v2**
- Added `deep-verify` CLI subcommand
- PyMuPDF extract cited PDF text
- LLM claim-evidence semantic matching, credibility score 0-1
**Phase 6: CEO Review comprehensive reinforcement**
- Added `audit` CLI subcommand — unified audit (citation + deep verification + AI flavor)
- `chain` command added automatic verification, `--skip-verify` can be skipped
- API client refactoring, reviewer personality system, security fixes
**Phase 8-10: Autonomous exploration + PDF download**
- `auto_research_loop` one-click multi-round iteration
- Multi-source literature parallel capture (6 sources)
- `design_experiment` structured experiment plan
- `download-pdfs` get PDF from Unpaywall / S2 / arXiv
- LangGraph StateGraph optional backend
**Research Team Phase 1-2: Virtual research team**
- 12 core roles + 11 extended roles = 23 research skills
- Dual-channel adversarial protocol (Voice A + Voice B)
- Six-stage pipeline + quality gate
**Phase 7: Autonomous exploration toolchain**
- Added 4 MCP tools: `analyze_gaps`, `compare_landscape`, `plan_next_step`, `execute_step`
- Added exploration memory system: `memory_search`, `memory_feedback`, `list_checkpoints` (3 MCP tools)
- `GapAnalyzer` blind spot and cross-direction analysis (LLM + heuristic fallback)
- `LandscapeAnalyzer` competitive landscape analysis (Semantic Scholar literature capture + LLM differential evaluation)
- `Planner` next step planning (deep_dive / pivot / broaden / need_data / converged)
- `execute_step` whitelist distributor, security restrictions can adjust tool range
- Exploration memory: TF-IDF semantic search, feedback weight adjustment, persistent storage
- 32 new tests
### v0.6.0 (2026-04-10) — Pipeline Robustness Upgrade
**6 Key Bug Fixes**, eliminating the cascade of failures with `chain` command exit code 1:
| # | File | Issue | Fix |
|---|------|------|------|
| 1 | `exploration/discovery.py` | OpenAlex API returns `"source": null` causing `NoneType.get()` crash | Use defensive chaining: `((item.get("primary_location") or {}).get("source") or {}).get("display_name", "")` |
| 2 | `agents/planning.py` | `chat_json()` call without try/except, JSON parsing failure crashes directly | Add exception capture, throw `RuntimeError` with context |
| 3 | `agents/knowledge.py` | `chat_json()` call without try/except, causing pipeline interruption | Add exception capture + empty result fallback (`{"references": [], "citation_plan": {}}`) |
| 4 | `agents/review.py` | `chat_json()` call without try/except, review stage failure terminates | Add exception capture + empty dictionary fallback, `_parse_review()` returns default ReviewReport |
| 5 | `llm_client.py` | `_try_repair_json` uses simple counting to repair truncated JSON, cannot handle brackets within strings | Rewrite as **stack-based parser**: track `in_string` state, maintain ordered structure stack, regex clean incomplete key-value pairs |
| 6 | `pipeline.py` | `_run_stage()` re-raises all stage failures, non-critical stage crashes terminate the entire pipeline | Distinguish **critical stages** (`data`/`planning`/`writing`/`typesetting`) from non-critical stages; non-critical stage failures only log warnings and continue |
**Root Cause Analysis**: OpenAlex NoneType → JSON truncation repair failure → unprotected `chat_json` calls bubble up → pipeline re-raises all stages → exit code 1. Six fixes form a deep defense.
### v0.5.x — Quality and Typesetting Improvements
- **WritingAgent**: Enhance `_SECTION_ROLES` (statistical rigor, reproducibility, limitations), anti-overstatement rule #11
- **TypesettingAgent**: Compliance statement sections (Ethics, Data Availability, COPE AI statement), `_wrap_long_lines()` fixes overfull boxes
- **LangPolishAgent**: balanced mode paragraph density instructions
- **sanitize_latex**: Floating body boundary fixes, wide table adjustbox double packaging protection
- **converter.py**: Windows cp950 encoding fix (`encoding="utf-8"`), `-no-shell-escape` security hardening
- **User-defined Sections**: Pipeline + WritingAgent + WebUI + CLI `--user-sections`
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
OpenAI Whisper
OpenAI Whisper MCP Server - 基于本地 Whisper CLI 的离线语音识别与翻译,无需 API Key,支持...
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
claude-flow
Claude-Flow v2.7.0 is an enterprise AI orchestration platform.
ai-engineering-from-scratch
Learn it. Build it. Ship it for others. The most comprehensive open-source...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)