Upload any research paper (PDF or arXiv ID) → AI agents analyze it → Generate a complete, runnable Python codebase → Download as ZIP
Transform arXiv papers into production-ready projects using a multi-agent workflow Analyst → Architect → Coder.
- What It Does
- Generated Project Example
- Features
- Quick Start
- Usage Flow
- Project Structure
- Performance
- Contributing
- License
- Acknowledgments
Most research papers are never implemented. Reading a paper, understanding its architecture, designing the project structure, and writing the code can take days — even for experienced engineers.
This pipeline does it automatically:
- Reads the paper using RAG (FAISS vector search over paper chunks)
- Analyses it, extracts components, equations, data flow, inputs/outputs
- Plans a full Python project, files, classes, functions, algorithm steps
- Codes every file — using the most relevant paper sections as context per file
- Packages everything — folder structure,
requirements.txt,README.md, downloadable ZIP
For "Attention Is All You Need" paper (arXiv:1706.03762):
output/projects/transformer-attention/
├── src/
│ ├── encoder.py # MultiHeadAttention + FeedForward
│ ├── decoder.py # DecoderLayer with encoder-decoder attention
│ ├── attention.py # ScaledDotProductAttention
│ ├── model.py # Transformer
│ └── main.py # End-to-end demo
├── requirements.txt # torch, numpy
└── README.md # How to train/extend
| Feature | Description |
|---|---|
| Paper Ingestion | Upload local PDF or enter arXiv ID automatic text extraction and chunking |
| FAISS RAG | Vector index over paper chunks per-agent, per-file context retrieval |
| Multi-Agent Pipeline | Analyst → Architect → Coder three specialized agents, each with targeted prompts |
| Streamlit UI | Step-by-step flow: upload → review plan → generate code → download ZIP |
| Plan Review | Inspect every file, class, function, and algorithm step before generating code |
| Project Export | Full folder structure with src/, requirements.txt, README.md per project |
| Syntax Validation | ast.parse() on every generated file, broken files flagged in UI |
| Post-Processing | Auto-fix main_file prefix, auto-collect dependencies, phantom class removal |
| Debug Logs | Raw agent outputs saved per run for prompt tuning and debugging |
git clone https://github.com/Ravevx/multi-agent-paper-pipeline.git
cd multi-agent-paper-pipelinepython -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtLocal LM Studio (default):
# Start LM Studio server at http://127.0.0.1:1234/v1
# Set your model in config.py
LMSTUDIO_URL=http://127.0.0.1:1234/v1
LMSTUDIO_MODEL=your-model-namestreamlit run app.py1. Upload PDF or enter arXiv ID
2. [Analyse] → Build RAG → Analyst → Architect → Plan
3. Review plan (files, classes, functions, steps)
4. [Approve] → Generate code file-by-file
5. Download ZIP or use local copy
| Agent | Input | Output | Key Prompt Rule |
|---|---|---|---|
| Analyst | Paper chunks (RAG) | 5-section technical analysis | Start with ## 1. no preamble, no hedging |
| Architect | Analysis text | ProjectPlan JSON | Class names must cross-reference, no phantom classes |
| Coder | File spec + RAG context | Python source file | EXACT NAMES box at top, enforces plan class names |
- RAG per file: Each file gets its own targeted RAG query using its class names and logic summary, so
attention.pyretrieves attention equation chunks, not encoder chunks - Plan validation:
_validate_plan()removes phantom classes (classes listed inmain.pybut not defined anywhere), preventingImportErrorat runtime - nn.Module enforcement:
fix_nn_module()detects torch files and adds(torch.nn.Module)inheritance where missing - No architect truncation fallback: If
main.pyalgorithm steps are empty (truncated output),crew_runner.pyrebuilds them from the actual class/function list
.
├── app.py # Streamlit app
├── crew_runner.py # Main orchestration
├── crew_tasks.py # Agent prompts
├── crew_agents.py # Agent definitions
├── rag_store.py # FAISS RAG
├── paper_tools.py # PDF/arXiv extraction
├── project_planner.py # Data models
├── config.py # Settings
├── requirements.txt # Dependencies
├── output/
│ ├── papers/ # Cached PDFs
│ └── projects/ # Generated codebases
│ └── <project_name>/
│ ├── src/
│ ├── requirements.txt
│ └── README.md
└── screenshots/ # UI screenshots
| Paper | Files | Time | Syntax Errors |
|---|---|---|---|
| Attention Is All You Need | 7 | 12 min | 0 |
| BERT | 12 | 18 min | 1 |
| GPT-2 | 9 | 14 min | 0 |
┌───────────────────┐
│ RAG Index │
└────────┬──────────┘
│
┌───────────────────┐
│Angent (Analyst) │
│ (Paper Analysis) │
└────────┬──────────┘
│
┌───────────────────┐
│Angent (Architect) │
│ (Project Plan) │─────┐
└────────┬──────────┘ |
│ |
┌───────────────────┐ |
│ Human-in-the-loop │ |
│ Approve / Edit │ |
└───────┬───────────┘ |
│ Approved? No |
┌────────────────┴─────────────────┘
│
Approved? Yes
│
┌─────────────┐
│Agent (Coder)│
│ Generate │
│ Files │
└─────┬───────┘
│
└───────────┐
┌─────────────────────────────┐
│ Generate Project Folder / │
│ src/, requirements.txt, │
│ README.md, ZIP Export │
└─────────────────────────────┘
Contributions are very welcome. Good areas to work on:
- Better prompts for specific domains (computer vision, reinforcement learning, graph networks)
- Alternative RAG backends (Chroma, Pinecone, Weaviate)
- Support for LaTeX source papers not on arXiv PDF
- Training loop generation extend Coder to also produce train scripts
- Unit tests for crew_runner.py post-processing functions
MIT License LICENSE
##Acknowledgments
- CrewAI — multi-agent orchestration
- FAISS — vector search
- Streamlit — amazing UI framework
- Research community — for the papers that power this!