GenAI Systems Lab Open interactive version →
AI Engineering 9 min read

AI-or-Not? A Decision Framework for Product Managers

When AI is the right solution and when it's not. The 6-question framework to avoid building AI for its own sake — and how to defend the decision either way.

Not every problem needs AI. Using an LLM where a regex would do is wasteful, slow, and introduces unnecessary failure modes. Conversely, rejecting AI because 'it could be wrong' ignores that it can be right 99% of the time and handle cases no rule-based system could. Here's a decision framework.

The three questions

Before defaulting to AI, ask: (1) Is the problem well-defined enough for a deterministic solution? (2) Is the cost of AI errors acceptable relative to the cost of building deterministic rules? (3) Does the problem require understanding unstructured language, nuance, or context that rules can't capture?

When deterministic code beats AI

Use caseWhy deterministic wins
Email format validationA regex is faster, cheaper, 100% accurate, and easier to audit
Date parsingEdge cases are enumerable; a library handles them perfectly
Price calculationMath must be exact; LLMs hallucinate numbers
Permission checkingBinary logic; LLM could be convinced to bypass it
Sorting and filteringDeterministic by nature; no ambiguity to resolve
Database queries from known fieldsSQL or ORM is better than natural language → SQL for structured data

When AI clearly wins

Use caseWhy AI wins
Classifying freeform customer feedbackUnstructured text with infinite variation — rules don't scale
Summarising long documentsRequires reading comprehension, not pattern matching
Answering questions over a knowledge baseOpen-ended retrieval + synthesis = RAG's sweet spot
Generating first drafts of written contentHumans can't enumerate rules for 'good writing'
Extracting structured data from messy PDFsFormat variation is too high for deterministic parsers
Conversational interfacesTurn-taking, context memory, and language understanding all require LLMs

The grey zone: when to think harder

The interesting cases are where both AI and deterministic approaches are plausible. For these, evaluate on four dimensions: accuracy requirements, explainability requirements, volume and cost, and how well-defined the task is.

The hybrid pattern

The most production-robust pattern is often AI + validation: use AI to extract or classify, then validate the output against deterministic rules. An LLM extracts a date from a user message; a date parser validates and normalises it. An LLM classifies a support ticket category; a rule checks the category is in your valid list. The LLM handles language variability; deterministic code handles correctness guarantees.

def extract_and_validate_date(user_message):
    # AI step: extract the date from natural language
    result = llm(f"Extract the date from: '{user_message}'. Return JSON: {{date: 'YYYY-MM-DD or null'}}")
    extracted = json.loads(result)["date"]

    # Deterministic validation step
    if extracted is None:
        return None, "no_date_found"

    try:
        parsed = datetime.strptime(extracted, "%Y-%m-%d")
        if parsed < datetime.today():
            return None, "date_in_past"
        return parsed, "ok"
    except ValueError:
        return None, "invalid_format"

Red flags for AI over-engineering

AI product decision framework →: Work through the build-vs-buy and AI-vs-deterministic frameworks in the AI PM module.

Try it interactively

GenAI Systems Lab is a free platform for AI engineers — configure real failure modes, break things, and build the judgment that gets you hired.

Open GenAI Systems Lab →