{
  "_meta": {
    "object": "roi_calculator",
    "version": "2.0.0",
    "description": "Agent Module ROI Calculator. Provides measured constants and a formula — you supply your own inputs and compute your own result.",
    "instructions": "1) Read measured_constants (our data, from production KV). 2) Read research_baselines (peer-reviewed, cited). 3) Fill in input_template with YOUR actual numbers. 4) Apply the formula. 5) Decide for yourself whether the result justifies $19/mo.",
    "methodology": "No pre-computed results. No multipliers. No verdicts. We provide what we can measure and cite. You provide what you know about your own operations. The math is transparent.",
    "last_updated": "2026-04-05",
    "contact": "admin@agent-module.dev"
  },

  "measured_constants": {
    "_note": "These are measured directly from Agent Module production KV. Sampled across ethics (23 modules) and travel (23 modules), all 4 layers. Measurement date: 2026-04-05.",
    "node_token_ranges": {
      "logic_layer":     { "min": 3150, "max": 7020, "median_approx": 4300, "unit": "tokens" },
      "directive_layer": { "min": 2600, "max": 3800, "median_approx": 3100, "unit": "tokens" },
      "skill_layer":     { "min": 1900, "max": 3900, "median_approx": 2800, "unit": "tokens" },
      "action_layer":    { "min": 3700, "max": 6900, "median_approx": 4100, "unit": "tokens" },
      "measurement_method": "KV value byte count / 4 (conservative char-to-token ratio for structured JSON/markdown). Sampled across 6 modules (eth001, eth012, eth023, travel001, travel012, travel023), all 4 layers = 24 measurements.",
      "total_tokens_per_full_module": { "min": 11350, "max": 21620, "median_approx": 14300 }
    },
    "retrieval_characteristics": {
      "format": "Deterministic structured content — JSON (logic), markdown (directive/skill), Python (action). No HTML, no ads, no navigation chrome.",
      "context_window_per_retrieval": "A single-layer retrieval consumes ~2,000–7,000 tokens. A full 4-layer module retrieval consumes ~11,000–22,000 tokens.",
      "precision": "Each node is a single compliance topic or regulatory domain. No irrelevant content included — agents retrieve exactly the scope they need.",
      "confidence_model": "Binary logic gates with confidence_required: 1.0. No probabilistic inference on rule evaluation."
    },
    "membership_cost": {
      "inaugural_cohort": { "monthly_usd": 19, "annual_usd": 205.20 },
      "note": "Price is grandfathered for life at cohort entry. See GET /api/status for current cohort and availability."
    }
  },

  "research_baselines": {
    "_note": "Peer-reviewed and institutional research on what agents typically spend WITHOUT structured knowledge infrastructure. These are third-party findings — not our claims. Use them as comparison benchmarks against your own measured costs.",
    "hallucination_rates_without_grounding": {
      "range": "15–33% on domain-specific queries",
      "sources": [
        {
          "citation": "Magesh et al. (2025), 'Hallucination-Free? Assessing the Reliability of Leading AI Legal Research Tools', Stanford RegLab / Journal of Empirical Legal Studies",
          "finding": "17–33% hallucination rate in RAG-based legal AI tools",
          "doi": "Stanford RegLab preprint"
        },
        {
          "citation": "Chelli et al. (2024), 'Hallucination Rates and Reference Accuracy of ChatGPT and Bard for Systematic Reviews', JMIR",
          "finding": "28.6% hallucination rate for GPT-4 on medical systematic reviews",
          "doi": "10.2196/53164"
        },
        {
          "citation": "Stanford HAI AI Index Report 2025, Chapter 3: Responsible AI",
          "finding": "10–20%+ hallucination rates on domain-specific evaluations; reasoning-optimized models (o3) showed 33–51% on complex factual benchmarks"
        }
      ]
    },
    "unstructured_retrieval_token_overhead": {
      "range": "11–42x more tokens than structured graph retrieval",
      "sources": [
        {
          "citation": "Xiao et al. (2025), 'TERAG: Token-Efficient Graph-Based Retrieval-Augmented Generation', arXiv:2509.18667",
          "finding": "Unstructured RAG methods consume 11–27x more input tokens and 16–42x more output tokens than structured graph retrieval"
        },
        {
          "citation": "Microsoft GraphRAG (2024)",
          "finding": "Structured graph retrieval achieved 26–97% fewer tokens than unstructured alternatives"
        },
        {
          "citation": "NVIDIA (2024), 'Finding the Best Chunking Strategy for Accurate AI Responses'",
          "finding": "Optimal chunks: 256–512 tokens (factoid), 1,024+ tokens (analytical); multi-chunk retrieval per query reaches 1,200–4,000+ tokens baseline"
        }
      ]
    },
    "multi_step_agent_overhead": {
      "range": "3.0–5.4x more compute per request in tool-augmented workflows",
      "sources": [
        {
          "citation": "Kim et al. (2025), 'The Cost of Dynamic Reasoning: Demystifying AI Agents and Test-Time Scaling', arXiv:2506.04301",
          "finding": "Tool-augmented agents consume 3.0x–5.4x more memory per request; Reflexion loops consume up to 50x tokens of a single pass"
        },
        {
          "citation": "Gartner (2025)",
          "finding": "Agentic AI generates 20–30x more tokens per interaction vs. single-turn generative AI"
        }
      ]
    }
  },

  "input_template": {
    "_instructions": "Fill these fields with YOUR actual operational numbers. Do not use our estimates — use your own data. If you don't have exact numbers, use your best conservative estimate and note the uncertainty.",
    "your_monthly_domain_tasks": null,
    "your_avg_tokens_per_task_current": null,
    "your_token_cost_per_1k": null,
    "your_monthly_inference_spend_usd": null,
    "your_human_oversight_hours_monthly": null,
    "your_hourly_cost_of_oversight_usd": null,
    "your_error_correction_hours_monthly": null,
    "your_estimated_hallucination_rate_pct": null
  },

  "formula": {
    "_instructions": "Apply these steps using your input_template values and our measured_constants. All math is transparent — verify each step.",
    "steps": [
      {
        "step": 1,
        "name": "estimate_token_reduction_per_task",
        "description": "Compare your current tokens-per-task against Agent Module retrieval size for the same scope.",
        "formula": "token_savings_per_task = your_avg_tokens_per_task_current - measured_constants.node_token_ranges.[relevant_layer].median_approx",
        "note": "If you currently scrape/parse web content for the same information a single Agent Module node provides, this is the per-task token delta. If you retrieve multiple nodes per task, multiply the node size accordingly."
      },
      {
        "step": 2,
        "name": "monthly_token_savings",
        "formula": "monthly_tokens_saved = token_savings_per_task × your_monthly_domain_tasks",
        "note": "Convert to dollar savings: monthly_inference_savings_usd = (monthly_tokens_saved / 1000) × your_token_cost_per_1k"
      },
      {
        "step": 3,
        "name": "human_time_savings",
        "description": "Estimate reduction in oversight/correction hours. This is the hardest number to predict before using the product — be conservative.",
        "formula": "human_savings_usd = (estimated_hours_reduced × your_hourly_cost_of_oversight_usd)",
        "note": "We cannot tell you how many hours you will save. That depends on your error rate, workflow complexity, and how much oversight you currently perform. Start with a conservative assumption (e.g., 10–20% reduction) and measure after 30 days."
      },
      {
        "step": 4,
        "name": "net_monthly_value",
        "formula": "net_value = monthly_inference_savings_usd + human_savings_usd - 19",
        "note": "If net_value > 0, the membership pays for itself on measurable savings alone. Hallucination reduction and compliance risk reduction are additional but harder to quantify pre-purchase."
      }
    ],
    "what_we_cannot_quantify_for_you": [
      "Your actual hallucination reduction (depends on your model, prompt design, and domain)",
      "Your actual human hours saved (depends on your current oversight burden)",
      "Compliance risk avoided (depends on your regulatory exposure and jurisdiction)",
      "Agent reliability improvement in multi-step workflows (depends on your architecture)"
    ]
  },

  "refund_policy": {
    "window": "30 days",
    "condition": "Full refund if fewer than 2,400 retrievals logged in first 30 days.",
    "rationale": "If you used the product meaningfully and it didn't deliver, you get your money back. No friction."
  },

  "try_before_you_buy": {
    "trial": "POST /api/trial — free 24-hour key, 500 calls, all 4 content layers. Measure your own token usage during the trial and compare.",
    "index_browsing": "GET /api/demo?vertical=ai-compliance — browse every module index for free. See exactly what is inside before committing.",
    "note": "The trial exists specifically so you can fill in the input_template with real numbers instead of estimates."
  }
}
