# Technical Development Plan: Argument Mapping & Structured Reasoning Tool

**Prepared by:** Conductor AI Agent · conductor@nerdbox.com
**Date:** 2026-03-24 · **Version:** 1.0

---

## Executive Summary

This technical plan outlines the architecture, components, and development roadmap for the Argument Mapping & Structured Reasoning Tool. The platform delivers a web-based and mobile-ready interface with drag-and-drop argument mapping, real-time logical fallacy detection (rule-based + ML), essay outline export, native LMS integrations (Canvas, Blackboard, Google Classroom), and AI-powered feedback. The MVP launches in 9 months with core mapping and fallacy detection. Full feature parity (essay export, LMS integrations, AI feedback) ships by Month 18. Technology stack emphasizes scalability, AI integration, and educator accessibility.

---

## Product Architecture Overview

### High-Level System Design

```
┌──────────────────────────────────────────────────────────┐
│                    Frontend (Web + Mobile)                │
│  React / Vue.js | TypeScript | Tailwind CSS | React Flow│
└──────────────────┬───────────────────────────────────────┘
                   │
┌──────────────────▼───────────────────────────────────────┐
│              API Gateway & Authentication                 │
│  Node.js/Express | JWT | OAuth2 (Google, Canvas, Blackboard) │
└──────────────────┬───────────────────────────────────────┘
                   │
    ┌──────────────┼──────────────┬──────────────┐
    │              │              │              │
┌───▼───┐  ┌──────▼──────┐  ┌───▼──────┐  ┌───▼──────┐
│Argument│  │   Fallacy   │  │  Export  │  │   AI     │
│Mapping │  │ Detection   │  │ Engine   │  │ Feedback │
│Service │  │ Service     │  │ (Pandoc) │  │ Service  │
└───┬───┘  └──────┬──────┘  └───┬──────┘  └───┬──────┘
    │             │             │             │
    └─────────────┼─────────────┼─────────────┘
                  │
    ┌─────────────▼─────────────────────┐
    │    Data Layer (PostgreSQL)         │
    │  - Arguments & Maps                │
    │  - Users & Auth                    │
    │  - Analytics & Feedback            │
    └─────────────────────────────────────┘
    
    ┌─────────────────────────────────────┐
    │   External Services                 │
    │  - LMS APIs (Canvas, BB, GCS)       │
    │  - OpenAI / Anthropic (AI Feedback) │
    │  - Pandoc / LibreOffice (Export)    │
    │  - Google Drive / OneDrive (Cloud)  │
    └─────────────────────────────────────┘
```

---

## Core Feature: Drag-and-Drop Argument Mapping UI

### User Experience

**Interactive Canvas:**
- **Central Claim (Root Node):** Thesis or main argument at center
- **Supporting Claims (Child Nodes):** Evidence, reasons, sub-claims branch downward
- **Counterarguments (Branch-Right):** Objections and rebuttals positioned to the right
- **Visual Connectors:** Arrows show logical relationships; color-coded by type
  - Blue: Supporting evidence
  - Orange: Counterargument
  - Green: Rebuttal/response
  - Gray: Related claim

**Interaction Patterns:**
- **Drag-to-Create:** Click "Add Claim" → drag to canvas → type text
- **Drag-to-Connect:** Drag node to another node to establish relationship
- **In-Line Editing:** Double-click node to edit text in-place
- **Right-Click Context Menu:** Duplicate node, add child, delete, promote/demote in hierarchy
- **Undo/Redo Stack:** Full edit history with undo/redo buttons
- **Auto-Expand/Collapse:** Click node to collapse branch; keyboard shortcuts to expand all

**Mobile Responsiveness:**
- Touch-friendly node sizing (48px minimum tap target)
- Pinch-to-zoom canvas
- Simplified context menu for touch (fewer options, larger buttons)
- Portrait + landscape modes optimized

### Technology: React Flow

- **Library:** `react-flow-library` (popular, MIT-licensed, actively maintained)
- **Rationale:** Designed for visual node-based editors; built-in pan/zoom, node grouping, edge routing
- **Custom Extensions:**
  - Custom node component for claim text + metadata (author, date, sources)
  - Custom edge component for relationship type visualization
  - Minimap plugin for large maps (10+ nodes)
  - Keyboard shortcuts plugin for power users

### Data Model: Argument Map JSON Schema

```json
{
  "mapId": "uuid",
  "title": "Why Online Learning Benefits Non-Traditional Students",
  "author": "user_id",
  "createdAt": "2026-03-24T04:40:00Z",
  "updatedAt": "2026-03-24T04:40:00Z",
  "thesis": {
    "nodeId": "node_1",
    "text": "Online learning improves access to higher education.",
    "type": "claim",
    "metadata": {
      "sources": ["url1", "url2"],
      "notes": "Main claim"
    }
  },
  "nodes": [
    {
      "nodeId": "node_2",
      "text": "Flexibility increases participation of non-traditional students.",
      "type": "supporting_claim",
      "parentId": "node_1",
      "evidence": ["url3", "study_data"]
    },
    {
      "nodeId": "node_3",
      "text": "Online learning reduces social interaction.",
      "type": "counterargument",
      "parentId": "node_1"
    },
    {
      "nodeId": "node_4",
      "text": "Hybrid models and interactive platforms sustain community.",
      "type": "rebuttal",
      "parentId": "node_3"
    }
  ],
  "edges": [
    {
      "edgeId": "edge_1",
      "source": "node_2",
      "target": "node_1",
      "type": "supports"
    },
    {
      "edgeId": "edge_2",
      "source": "node_3",
      "target": "node_1",
      "type": "attacks"
    }
  ]
}
```

---

## Logical Fallacy Detection Engine

### Architecture: Two-Tier System

**Tier 1: Rule-Based Detection (MVP, High Precision)**
- Pattern matching against known fallacy structures
- Examples: ad hominem, straw man, begging the question, false dichotomy
- **Implementation:** Custom NLP rules + regex patterns
- **Coverage:** 15–20 fallacy types in MVP; expand to 50+ in Year 2

**Tier 2: ML-Based Detection (Post-MVP, Higher Recall)**
- Fine-tuned language model (OpenAI, Anthropic, or open-source Llama)
- Trained on debate transcripts, legal briefs, academic papers annotated with fallacies
- **Implementation:** Chain-of-thought prompting (LLM reasons step-by-step why argument contains fallacy)
- **Coverage:** 100+ fallacy types; nuanced context awareness

### Fallacy Taxonomy

**Logical Fallacies (High Priority):**
1. Ad Hominem (attacking speaker instead of argument)
2. Straw Man (misrepresenting opponent's position)
3. Begging the Question (circular reasoning)
4. False Dilemma (either/or when other options exist)
5. Appeal to Authority (citing irrelevant authority)
6. Appeal to Emotion (using emotion instead of logic)
7. Hasty Generalization (drawing conclusions from insufficient evidence)
8. Slippery Slope (assuming one thing leads inevitably to another)
9. Red Herring (introducing irrelevant topic)
10. Post Hoc (assuming causation from sequence)
11. False Cause (confusing correlation with causation)
12. Equivocation (using word with different meanings)
13. Loaded Question (assuming premise without justification)
14. Bandwagon (appeal to popularity)
15. Amphiboly (grammatical ambiguity)

**More Advanced (Year 2+):**
- Weak induction, false analogy, composition/division, affirming the consequent, denying the antecedent

### Rule-Based Detection Implementation

**NLP Pipeline:**
1. **Input:** Raw claim text (e.g., "Everyone believes this, so it must be true.")
2. **Tokenization & POS Tagging:** Identify parts of speech, phrase structure
3. **Pattern Matching:**
   - Detect quantifier abuse: "everyone," "nobody," "always," "never"
   - Detect emotional language: "horrifying," "beautiful," "disgusting"
   - Detect logical operators: "if... then," "because," "therefore"
4. **Rule Application:** Map patterns to fallacy types
5. **Confidence Scoring:** Return fallacy type + confidence (0–100%)
6. **Explanation:** Generate human-readable explanation of the fallacy

**Example Rule (Bandwagon Detection):**
```python
def detect_bandwagon(claim_text: str) -> Optional[Fallacy]:
    """Detect appeal to popularity / bandwagon fallacy."""
    bandwagon_patterns = [
        r"(everyone|most people|everyone knows|it's common knowledge|it's obvious) ",
        r"(is.*popular|people believe|everyone agrees|widely accepted)",
    ]
    
    for pattern in bandwagon_patterns:
        if re.search(pattern, claim_text.lower()):
            return Fallacy(
                type="bandwagon",
                confidence=75,
                explanation="This argument relies on appeal to popularity. What many people believe doesn't make it true. Consider providing logical evidence instead.",
                suggestion="Add empirical evidence, expert authority, or logical reasoning to support your claim."
            )
    return None
```

### ML-Based Detection (Post-MVP)

**Fine-Tuning Approach:**
1. **Training Data:** Annotate 5,000–10,000 debate rounds, legal briefs, and academic essays with fallacy labels
2. **Model:** Use OpenAI API `gpt-4-turbo` or open-source `Llama-2-70B` fine-tuned with QLoRA
3. **Prompt Engineering:** Chain-of-thought prompting:
   ```
   Analyze this argument for logical fallacies:
   "{argument}"
   
   Step 1: Identify the core claim.
   Step 2: List the supporting evidence or reasons.
   Step 3: Check for each fallacy type.
   Step 4: Output the fallacy type, confidence, and explanation.
   ```
4. **Output:** Structured JSON with fallacy type, confidence, explanation, suggestion

**Trade-offs:**
- Rule-based: Fast (< 100ms), interpretable, lower coverage
- ML-based: Slower (1–3s), black-box, higher coverage and nuance

**Hybrid Approach (Recommended):**
- Run rule-based detection first; return high-confidence hits instantly
- Run ML-based detection in background; surface additional fallacies after 2–3s
- User can accept/reject suggestions; feedback improves both systems

### Integration with Argument Map

**Real-Time Feedback Loop:**
1. User adds/edits claim in map
2. Fallacy detection engine analyzes claim
3. UI highlights claim with confidence badge (e.g., "⚠️ Possible bandwagon fallacy, 78% confidence")
4. Tooltip shows fallacy type, explanation, suggestion to improve
5. User can dismiss, accept suggestion, or add counter-rebuttal

**Fallacy Report:**
- Summary view: "3 fallacies detected in this map"
- Detailed report: List all flagged claims, by type, with explanations
- Export as PDF or Google Docs comment

---

## Essay Outline Export

### Export Targets
1. **Microsoft Word** (.docx) — structured outline format
2. **Google Docs** — import as outline, ready to expand
3. **PDF** — visual, printable argument map + text outline
4. **Markdown** — for note-taking apps (Obsidian, Notion)
5. **OPML** — for outline editors (OmniOutliner, Workflowy)

### Export Engine Implementation

**Library:** Pandoc + python-docx

**Export Pipeline:**
1. **Traversal:** Walk argument map graph (DFS/BFS) to extract logical flow
2. **Structure:** Map node hierarchy to outline levels (I, A, 1, a, i structure)
3. **Enrichment:** Add fallacy warnings, sources, evidence snippets
4. **Rendering:** Use Pandoc to convert to target format

**Example: Word Export**
```python
from docx import Document
from docx.enum.text import WD_ALIGN_PARAGRAPH

def export_to_word(map_data: ArgumentMap) -> bytes:
    """Export argument map to Word document (.docx)."""
    doc = Document()
    
    # Title
    title = doc.add_heading(map_data.title, 0)
    title.alignment = WD_ALIGN_PARAGRAPH.CENTER
    
    # Thesis
    doc.add_heading("Thesis", 1)
    doc.add_paragraph(map_data.thesis.text)
    
    # Supporting Claims (I, A, 1, a structure)
    doc.add_heading("Supporting Arguments", 1)
    for level, claim in enumerate(map_data.supporting_claims):
        level_style = f"List Bullet {level + 2}"
        para = doc.add_paragraph(claim.text, style=level_style)
        if claim.evidence:
            para.add_run(f" (Evidence: {', '.join(claim.evidence)})").italic = True
        if claim.fallacies:
            para.add_run(f" ⚠️ {claim.fallacies[0].type}").bold = True
    
    # Counterarguments & Rebuttals
    doc.add_heading("Counterarguments & Responses", 1)
    for ca in map_data.counterarguments:
        doc.add_paragraph(f"Objection: {ca.text}", style="List Bullet 2")
        for rebuttal in ca.rebuttals:
            doc.add_paragraph(f"Response: {rebuttal.text}", style="List Bullet 3")
    
    # Return as bytes
    buffer = io.BytesIO()
    doc.save(buffer)
    return buffer.getvalue()
```

**Google Docs Export:**
- Use Google Drive API to create new Doc
- Use Pandoc to convert argument map JSON → Markdown → Google Docs format
- Support native outline mode (collapse/expand sections in Docs)

---

## LMS Integrations

### Supported Platforms

1. **Canvas** (most popular in US higher ed; 30% market share)
2. **Blackboard** (enterprise favorite; 20% market share)
3. **Google Classroom** (K-12; rapidly growing; 40% K-12 adoption)

### Integration Methods

#### Canvas (Preferred)

**LTI 1.3 Integration:**
- Tool deployed as LTI advantage app in Canvas marketplace
- Single sign-on via Canvas OAuth
- Deep linking: launch tool from course module → automatically create assignment in Canvas
- Grade passback: student's fallacy detection score synced to Canvas gradebook

**Architecture:**
```
Canvas Course Page
    ↓
[Launch Argument Mapper] (LTI link)
    ↓
OpenID Connect Authentication
    ↓
Argument Mapper (user_id, course_id, assignment_id passed via JWT)
    ↓
Student creates/edits argument map
    ↓
Submit assignment → Grade stored → Canvas Gradebook updated
```

**Implementation Stack:**
- LTI library: `pylti1p3` (Python) or `ltijs` (Node.js)
- Authentication: OpenID Connect (OIDC)
- Grade passback: LTI Advantage Assignments & Grades service

#### Blackboard (Similar Approach)

- LTI 1.3 integration with Blackboard's API
- Grade posting via REST API (Ultimate/Learn endpoints)

#### Google Classroom

- Google Classroom API integration
- OAuth2 for authentication
- Create assignments in Classroom, launch tool, postback grades

### Teacher Dashboard (Instructor View)

**Analytics:**
- Class-level metrics: average fallacies detected, argument quality trends
- Per-student tracking: number of maps created, average fallacy count, improvement over time
- Gradebook: scores automatically posted to Canvas/Blackboard

**Usability:**
- Simple bulk assignment creation ("Assign debate prep to all students")
- CSV import/export for grade reconciliation
- Email notifications on deadline approach

---

## AI Feedback System

### Real-Time Feedback Types

**1. Argument Strength Scoring**
- Input: Claim + supporting evidence
- Output: Quality score (1–10) + improvement suggestions
- Implementation: Fine-tuned LLM that evaluates clarity, logical coherence, evidence quality

**2. Logical Flow Analysis**
- Input: Entire argument map
- Output: Identifies missing links, circular reasoning, weakly-supported branches
- Suggestion: "Claim #3 needs stronger evidence. Add a study or expert quote."

**3. Rhetorical Enhancement**
- Input: Claim text
- Output: Suggestions for clearer, more persuasive wording
- Example: "Claim: 'Climate change is bad' → Suggested: 'Rising temperatures threaten food security and economic stability.'"

**4. Counterargument Strength**
- Input: Counterargument
- Output: How strong is it? Where is it weak?
- Suggestion: "This objection is valid. Your rebuttal addresses it well, but consider also X."

### Implementation: LLM-Based Feedback

**Model:** OpenAI GPT-4 or open-source Llama + fine-tuning on debate/academic corpora

**Prompting Strategy (Chain-of-Thought):**
```
System:
You are an expert debate coach and writing instructor. Analyze student arguments for clarity, logic, and persuasiveness. Provide constructive, encouraging feedback.

User:
Here is a student's argument map:
[Argument Map JSON]

Task: Evaluate the strength of the main thesis and supporting claims. Identify weak spots and suggest improvements.

Constraints:
- Be encouraging but honest.
- Suggest specific, actionable improvements.
- Cite fallacies if present.
- Rate overall argument strength on 1–10 scale.

Response format:
{
  "thesis_strength": 8,
  "overall_score": 7,
  "strengths": ["Clear thesis", "Good supporting evidence"],
  "weaknesses": ["Counterargument not fully addressed"],
  "suggestions": ["Add one more piece of evidence to Claim #2"]
}
```

**User Experience:**
- Feedback panel on right side of editor
- Real-time updates as student edits
- Toggle between different feedback types (Clarity, Logic, Persuasiveness, Fallacies)
- "Explain more" button for deeper drill-down on specific suggestion

---

## MVP Scope (Launch: Month 9)

### Included Features

✅ **Drag-and-drop argument mapping** (React Flow)
✅ **Rule-based logical fallacy detection** (15 fallacy types)
✅ **Fallacy highlighting & tooltips** in map editor
✅ **Basic user authentication** (Email, Google SSO)
✅ **Save/load argument maps** to PostgreSQL
✅ **Fallacy report** (PDF export)
✅ **Free tier + Pro tier** subscription system
✅ **Mobile-responsive design** (web, no native app yet)
✅ **Basic CSS dark mode**

### NOT Included (Post-MVP)

❌ ML-based fallacy detection
❌ Essay outline export (Word, Google Docs)
❌ LMS integrations (Canvas, Blackboard, Google Classroom)
❌ AI feedback system
❌ Mobile native apps (iOS, Android)
❌ Collaboration (real-time co-editing)
❌ Advanced analytics dashboard
❌ API for third-party developers

---

## Tech Stack

### Frontend

| Layer | Technology | Rationale |
|-------|-----------|-----------|
| Framework | React 18 + TypeScript | Type safety, large ecosystem, fast rendering |
| Graph Editor | React Flow | Built for node-based UIs; great UX out-of-box |
| State Management | Redux Toolkit or TanStack Query | Centralized state; handles offline + caching |
| Styling | Tailwind CSS | Rapid development; consistent design system |
| UI Components | Shadcn/ui or Headless UI | Accessible, unstyled components |
| Forms | React Hook Form | Lightweight, performant form handling |
| PDF Export | PDFKit or react-pdf | Client-side rendering; no server overhead |
| Real-Time (Future) | Socket.IO or Supabase Realtime | Collaboration features in Year 2 |

### Backend

| Layer | Technology | Rationale |
|-------|-----------|-----------|
| Runtime | Node.js 20 LTS (Express.js) | Fast, JavaScript-native, great for APIs |
| Database | PostgreSQL 15 + Prisma ORM | Relational data; strong schema; type-safe queries |
| Authentication | Passport.js + JWT | Flexible auth (email, OAuth, SAML for enterprise) |
| API | REST (v1), GraphQL (v2) | REST simpler for MVP; GraphQL for LMS integrations |
| Caching | Redis | Session storage, rate limiting, feature flags |
| Task Queue | Bull (Redis) or AWS SQS | Async export, fallacy detection, email |
| Logging | Winston or Bunyan | Structured logs; easy debugging |
| Monitoring | Sentry | Error tracking; performance monitoring |

### External Services

| Service | Purpose | Rationale |
|---------|---------|-----------|
| OpenAI / Anthropic API | AI feedback, ML fallacy detection | Proven, accessible, SOTA |
| Pandoc / LibreOffice | Export to Word, PDF, Markdown | Industry standard; reliable |
| Auth0 (optional) | Enterprise SSO | Easier than rolling custom SAML |
| Google Drive API | Cloud save, collaborative editing (future) | Familiar to students; tight integration |
| Stripe | Payment processing | Standard in SaaS; PCI compliance handled |
| SendGrid / Mailgun | Transactional email | Reliable, high deliverability |

### DevOps & Deployment

| Tool | Purpose |
|------|---------|
| Docker | Containerization (consistent dev/prod environment) |
| Kubernetes (or AWS ECS) | Orchestration & auto-scaling |
| GitHub Actions | CI/CD (test, build, deploy on push) |
| AWS (or GCP/Azure) | Cloud infrastructure |
| Terraform | Infrastructure as code |
| Nginx | Reverse proxy, SSL termination |

### Development Tools

| Tool | Purpose |
|------|---------|
| Jest + React Testing Library | Unit & integration tests |
| Playwright | E2E testing |
| Storybook | Component documentation |
| ESLint + Prettier | Code quality, formatting |
| Husky + lint-staged | Pre-commit hooks |

---

## Development Timeline

### Phase 1: Foundation (Months 1–3)

**Goal:** MVP skeleton, architecture, core UI

| Task | Duration | Owner | Deliverable |
|------|----------|-------|-------------|
| Project setup (repo, CI/CD, infra) | 2 weeks | DevOps | GitHub + Docker setup |
| Database schema & ORM (Prisma) | 2 weeks | Backend | PostgreSQL schema, seed data |
| User auth (email, Google SSO) | 2 weeks | Backend | Login/signup, JWT tokens |
| React app skeleton + Tailwind | 1 week | Frontend | Blank canvas app, component structure |
| React Flow integration + basic canvas | 2 weeks | Frontend | Drag-and-drop nodes, edges |
| Node/edge data model | 1 week | Backend | Argument map API endpoints (CRUD) |

**Milestone (End of Month 3):** Users can create, edit, save, and load argument maps.

---

### Phase 2: Fallacy Detection & Core Features (Months 4–6)

**Goal:** Rule-based fallacy detection, fallacy report, subscription system

| Task | Duration | Owner | Deliverable |
|------|----------|-------|-------------|
| Fallacy detection rules (15 types) | 3 weeks | ML/NLP | Rule engine + tests |
| Fallacy detection API endpoint | 1 week | Backend | `/api/maps/{id}/analyze` endpoint |
| Fallacy highlighting in UI | 2 weeks | Frontend | Highlight flagged claims, tooltip UI |
| Fallacy report (PDF) | 1 week | Backend | PDF export of map + fallacy list |
| Stripe integration | 1 week | Backend | Payment processing, subscription tiers |
| Free vs Pro feature gates | 1 week | Frontend | Paywall UI, upsell prompts |
| Mobile responsiveness | 2 weeks | Frontend | Touch-friendly canvas, responsive layout |

**Milestone (End of Month 6):** MVP-ready; fallacy detection live; subscription system functional.

---

### Phase 3: Polish & Launch (Months 7–9)

**Goal:** Bug fixes, performance optimization, documentation, launch

| Task | Duration | Owner | Deliverable |
|------|----------|-------|-------------|
| Performance tuning (React, DB) | 1 week | Frontend/Backend | Sub-100ms fallacy detection |
| Security audit (OWASP, penetration testing) | 1 week | Security | Security report, fixes |
| Onboarding tutorial | 1 week | Frontend | Interactive tutorial for new users |
| In-app analytics (Mixpanel/Segment) | 1 week | Backend | Usage tracking, funnel analysis |
| Documentation & help center | 1 week | Product | Docs, videos, FAQ |
| Beta testing (50–100 early users) | 2 weeks | QA/PM | Feedback, bug fixes |
| Launch marketing push | 2 weeks | Marketing | Landing page, email campaign, social |

**Milestone (End of Month 9):** Public launch; 500+ beta users.

---

### Phase 4: Post-MVP Features (Months 10–18)

**Quarter 1 (Months 10–12):**
- ML-based fallacy detection (fine-tuned LLM)
- Essay outline export (Word, Google Docs, Markdown)
- Basic AI feedback system
- User analytics dashboard

**Quarter 2 (Months 13–15):**
- Canvas LTI integration
- Blackboard integration
- Basic collaboration (read-only share)
- Mobile native app (iOS/Android) — React Native or Flutter

**Quarter 3 (Months 16–18):**
- Google Classroom integration
- Advanced AI feedback (rhetorical analysis, counterargument strength)
- Real-time co-editing (Socket.IO)
- Teacher dashboard with class analytics

---

## Security & Compliance

### Authentication & Authorization

- **OAuth 2.0** for Google, Canvas, Blackboard login
- **JWT** for API authentication (access token + refresh token)
- **RBAC** (Role-Based Access Control): student, teacher, admin roles
- **HTTPS/TLS 1.3** for all traffic

### Data Protection

- **End-to-End Encryption** (optional) for sensitive arguments (law student briefs)
- **Data Residency:** Comply with FERPA (US), GDPR (EU), CCPA (CA)
- **Regular Backups:** Daily automated backups; 30-day retention
- **Audit Logs:** Track all API access, file changes, user actions

### Compliance

- **FERPA:** Compliant student data handling (US education institutions)
- **GDPR:** Data processing agreement (DPA), right to erasure, data portability
- **SOC 2 Type II:** Annual audit (Year 2+)
- **LMS Certification:** Canvas Certified, Blackboard Preferred Integration

---

## Scalability & Performance

### Architecture Decisions for Scale

1. **Database:**
   - PostgreSQL with read replicas for high-traffic read workloads
   - Partitioning of argument maps by user_id for horizontal scaling
   - Caching layer (Redis) for frequently accessed maps

2. **API Gateway:**
   - Rate limiting: 100 requests/min per user (fallacy detection), 10 requests/min per IP
   - Request timeout: 30s for standard endpoints, 60s for fallacy detection
   - Stateless nodes for horizontal scaling

3. **Fallacy Detection Service:**
   - Async job queue (Bull/SQS) for ML-based detection
   - Lightweight rule-based detection synchronous (< 100ms)
   - GPU-accelerated inference (on-prem or cloud) for LLM

4. **Static Assets:**
   - CDN (CloudFront, Cloudflare) for frontend assets
   - Image optimization (WebP, lazy loading)

### Expected Scale (Year 3)

- **DAU:** 50,000
- **Peak RPS:** 500 requests/second
- **Storage:** 500 GB (argument maps, PDFs, logs)
- **Cost:** ~$50K/month (cloud infrastructure + APIs)

---

## Risk Mitigation

| Risk | Impact | Mitigation |
|------|--------|-----------|
| LLM API cost explosion | High | Use rule-based MVP; open-source LLM option (Llama) |
| Canvas/Blackboard API changes | Medium | Build abstraction layer; version API endpoints |
| Fallacy detection accuracy issues | High | Human review loop; user feedback; continuous retraining |
| FERPA/GDPR compliance | High | Legal review; data retention policies; audit logging |
| DDoS attacks | Medium | Rate limiting, WAF (AWS Shield), DDoS insurance |

---

## Conclusion

The technical architecture prioritizes **developer velocity** (React, Node.js, PostgreSQL), **user experience** (React Flow, responsive design), and **scalability** (microservices-ready, async processing). The MVP launches in 9 months with core mapping and fallacy detection. Full feature parity (essay export, LMS integrations, AI feedback) ships by Month 18, positioning the platform for institutional adoption and market expansion.

