Back to Alchemy
Alchemy RecipeIntermediateworkflow

Convert academic papers into teaching materials, exam questions and interactive flashcards

Imagine spending three weeks extracting key concepts from a 40-page neuroscience paper, manually typing up 60 flashcard definitions, then writing 15 exam questions from scratch. Now imagine doing that for five papers across your syllabus. For most educators, this is the reality every semester. The work is essential, but it's also repetitive, error-prone, and desperately inefficient. What if the same materials could be ready in two hours instead of two weeks? The gap between understanding a paper and turning it into teaching assets is substantial. A researcher might grasp a complex methodology in 20 minutes of reading, but encoding that understanding into an interactive study format takes exponentially longer. Most educators resort to shortcuts: poorly-explained flashcards, generic exam questions, or skipped materials entirely. Students suffer as a result. The workflow below changes this equation by automating the extraction-to-assessment pipeline. This workflow takes uploaded papers and generates three outputs simultaneously: interactive flashcards, simplified explanations of difficult passages, and exam question banks. Everything is orchestrated so there's no manual data transfer between stages. Once you drop a PDF into the system, the materials emerge ready to use.

The Automated Workflow

We'll use n8n as the orchestration layer here. It's self-hosted, handles complex branching workflows well, and integrates cleanly with all three tools we need. Zapier would work too, though n8n gives you more control over data transformation. The flow works like this: 1. A user uploads a PDF to a designated folder (or triggers via webhook).

  1. n8n detects the file and passes it to Explainpaper for parsing and explanation generation.

  2. Simultaneously, the same content goes to AnkiDecks AI to generate flashcards.

  3. The paper text also flows to TheB.AI to generate exam questions via a custom chatbot prompt.

  4. All three outputs are compiled and returned to the user in a single structured format.

Setting up the n8n workflow:

Start by creating a trigger node. If you're using cloud storage (Google Drive, Dropbox), use the file watch trigger. If you prefer webhooks, set up a custom webhook endpoint.

POST /webhook/upload-paper
Content-Type: application/json { "filename": "smith_2024_neural_plasticity.pdf", "file_url": "https://storage.example.com/uploads/smith_2024.pdf", "course_id": "NEURO301"
}

Once the file arrives, n8n needs to extract text. Most PDF upload flows will include a "Read Binary File" node that converts the PDF to text. If the PDF is complex (scans, multi-column layouts), use an OCR service, but that adds latency and cost. For most academic PDFs, direct extraction is fine.

Connecting to Explainpaper:

Explainpaper doesn't have a public API, so we use their web interface via HTTP requests. You'll need to authenticate first.

POST https://www.explainpaper.com/api/v1/upload
Content-Type: multipart/form-data
Authorization: Bearer YOUR_EXPLAINPAPER_API_KEY { "file": [binary PDF data], "title": "Neural Plasticity in Adult Learners"
}

The response includes a document ID. Store this for later queries.

json
{ "document_id": "doc_7f2k9x3q", "status": "processing", "estimated_time_seconds": 45
}

After upload, you need to poll Explainpaper's status endpoint until the document is processed. Use n8n's "Wait" node with a loop.

GET https://www.explainpaper.com/api/v1/documents/doc_7f2k9x3q
Authorization: Bearer YOUR_EXPLAINPAPER_API_KEY

Routing to AnkiDecks AI:

AnkiDecks AI accepts uploaded files and outputs Anki-formatted decks (APKG files). The integration is straightforward.

POST https://www.ankidecks.ai/api/v1/generate-flashcards
Content-Type: multipart/form-data
Authorization: Bearer YOUR_ANKIDECKS_API_KEY { "file": [binary PDF data], "card_count": 50, "difficulty_level": "university", "format": "apkg"
}

AnkiDecks returns a download URL and metadata about the generated cards.

json
{ "deck_name": "Neural Plasticity", "card_count": 52, "download_url": "https://cdn.ankidecks.ai/decks/temp_9x2k7f.apkg", "estimated_study_time_hours": 4.3
}

Generating exam questions with TheB.AI:

TheB.AI works via HTTP requests to a custom chatbot. You configure the bot once with a system prompt designed for exam question generation.

POST https://api.theb.ai/v1/chat/completions
Content-Type: application/json
Authorization: Bearer YOUR_THEB_AI_API_KEY { "bot_id": "exam_question_generator_bot", "messages": [ { "role": "user", "content": "Generate 15 multiple choice exam questions based on this paper: [PAPER TEXT]. Each question should have 4 options and identify the correct answer. Format as JSON." } ], "temperature": 0.7, "max_tokens": 2000
}

TheB.AI returns structured question data.

json
{ "questions": [ { "id": 1, "text": "Which brain region is primarily responsible for neuroplasticity in adult learners?", "options": ["Hippocampus", "Cerebellum", "Prefrontal cortex", "Amygdala"], "correct_answer": 0, "difficulty": "medium" } ]
}

Orchestrating the full pipeline:

In n8n, add parallel execution nodes so Explainpaper, AnkiDecks, and TheB.AI run simultaneously rather than sequentially. This cuts total execution time from ~5 minutes to ~2 minutes. After all three complete, use a "Merge" node to combine outputs into a single object:

json
{ "paper_metadata": { "title": "Neural Plasticity in Adult Learners", "upload_date": "2026-03-15T10:30:00Z", "course_id": "NEURO301" }, "explainpaper_document_id": "doc_7f2k9x3q", "flashcards": { "deck_name": "Neural Plasticity", "card_count": 52, "download_url": "https://cdn.ankidecks.ai/decks/temp_9x2k7f.apkg" }, "exam_questions": [ { "id": 1, "text": "Which brain region...", "options": ["Hippocampus", "Cerebellum", "Prefrontal cortex", "Amygdala"], "correct_answer": 0, "difficulty": "medium" } ]
}

Finally, store this JSON in a database (PostgreSQL, Airtable, Google Sheets) and send the educator a summary email with download links. Use n8n's "Email" node with a template.

Subject: Your teaching materials are ready: {{paper_metadata.title}} Hi {{educator_name}}, Your paper has been processed. Here's what's ready: Flashcards: {{flashcards.card_count}} cards in {{flashcards.deck_name}} ({{estimated_study_time_hours}} hours)
Exam Questions: {{exam_questions.length}} questions generated
Explanations: Available on Explainpaper (Document ID: {{explainpaper_document_id}}) Download your Anki deck: {{flashcards.download_url}} Cheers,
The Alchemy System

The Manual Alternative

If you prefer not to automate, you can use each tool individually: 1. Upload your PDF to Explainpaper directly; highlight sections you want explained.

  1. Upload the same PDF to AnkiDecks AI and download the resulting deck.

  2. Copy key concepts and paste them into TheB.AI with a prompt for exam question generation. This takes 30 to 45 minutes per paper. It's more flexible (you can cherry-pick outputs, adjust questions manually) but defeats the purpose of saving time.

Pro Tips

Handle rate limits gracefully.

AnkiDecks and TheB.AI have concurrent request limits.

If you're processing multiple papers at once, add a queue mechanism in n8n using the "Queue" trigger. This prevents hitting API limits and keeps costs predictable.

Validate flashcard quality.

AnkiDecks generates decent cards, but review the first 10 from each paper. Sometimes definitions are too terse or miss context. Create a simple feedback node in your n8n workflow that flags low-quality cards for manual review.

Cache expensive outputs.

If multiple educators teach the same paper, store the Explainpaper document ID and skip re-processing. Check your database before uploading to Explainpaper again.

Adjust TheB.AI prompting for question type.

The default prompt generates multiple choice. If you want essay questions, short-answer, or case studies, modify the system prompt in your custom bot. Different question types suit different assessment goals.

Monitor costs weekly.

API calls add up fast across three tools. Set up a simple dashboard in n8n that tracks usage, or use Zapier's analytics view if you go that route.

Cost Breakdown

ToolPlan NeededMonthly CostNotes
n8nCloud Standard or Self-Hosted£20 (cloud) or £0 (self-hosted)Self-hosted requires a server; cloud is simpler if you have few papers.
ExplainpaperAPI access (custom tier)£30–80Depends on document upload volume. Contact sales for bulk pricing.
AnkiDecks AIPremium with API£25–40Charged per deck generated or monthly flat fee.
TheB.AIAPI tier£40–100Based on token usage. Exam questions are token-heavy; 15 questions per paper ≈ 2,000 tokens.
Total**, **£115–220Easily justified if processing 10+ papers per term.