Curtis FosterCurtis Foster
All posts

AI systems thinking: how to budget memory, evals, and cost

AI products fail at the boundaries between memory, quality, and spend. Here is how to budget those systems before production makes the decision for you.

November 3, 2026· 13 min read· Curtis Foster Team
Hero image for blog post: AI systems thinking: how to budget memory, evals, and cost

At 11:47 p.m., a support bot answers a refund question with the wrong policy because it retrieved an outdated PDF, called the model twice, and remembered a customer preference that no longer applied. The model was not the whole problem. The system had no budget for memory, evaluation, or retries.

AI systems thinking means treating memory, evals, and cost as one operating system rather than three separate engineering tasks. If you are hiring or leading an AI team, you should expect every feature proposal to explain what it remembers, how you will measure it, and what happens when usage doubles.

I have spent more than 20 years shipping technical programs at Verizon, HP, and InterContinental Hotels, and I have built two live multi-model AI platforms. The pattern holds every time: AI products rarely fail because one prompt is slightly wrong. They fail because the surrounding system has no load-bearing structure.

A production AI system needs visible budgets for memory, evaluation, and model spend
A visible budget turns memory, evaluation, and model spend from hidden risk into decisions your team can manage.

The product is a system, not a model call

The default advice is to pick the best model and build around it. That advice is incomplete. A model call is one component in a chain that includes retrieval, memory, tools, retries, moderation, logging, and human review.

A useful AI systems thinking model starts with the user request and follows every handoff:

  • What information enters the request?
  • What information is retrieved from Postgres, pgvector, or another store?
  • Which model receives which context?
  • What happens when the answer fails an evaluation?
  • How many calls, tokens, and retries can one request consume?

The system has a budget at each handoff. A customer support assistant might spend 3,000 input tokens on policy text, 800 tokens on conversation history, and 500 tokens on a tool result before it produces a 300-token answer. If the request then triggers a verification call and a rewrite call, the original estimate is no longer useful.

This is why architecture reviews for AI features need different questions from ordinary software reviews. A web endpoint has a latency target and a database query limit. An AI workflow needs those limits plus a context limit, a retry limit, an evaluation threshold, and a spend ceiling.

I call this the System Budget. Not a spreadsheet exercise. It is a contract between product, engineering, and finance about what one user action is allowed to consume.

Once you frame it this way, the model becomes replaceable infrastructure. You can compare GPT-4o, Claude, Gemini, or a local model against the same system requirements instead of arguing about model reputation.

Budget memory before you add more context

Teams often treat memory as a free improvement. Store more conversation history, retrieve more documents, give the model more background. The answer should improve, right?

Not reliably. More context can introduce stale facts, conflicting instructions, and irrelevant detail. It also increases token usage and latency. A long context window is a capacity limit, not a promise that every item inside it helps.

A practical Memory Budget has four parts:

  • Working context for the current request
  • Durable facts that should survive across sessions
  • Retrieved evidence tied to the current task
  • Operational history used for debugging, not shown to the model

Keep those categories separate. A user preference like a preferred hotel room may belong in durable memory. A cancellation policy belongs in a source document that can be updated. A failed tool call belongs in logs. Putting all three into one memory table creates confusion that no prompt can clean up.

Consider a travel assistant handling a reservation in Chicago. The user said six months ago that they prefer email. That fact may still matter. The hotel cancellation rule from last week may have changed. The assistant's failed attempt to call the booking system should never be treated as a customer fact.

Use metadata on every stored memory: source, timestamp, confidence, owner, and expiration rule. Then build retrieval filters that reflect the task. A billing question should not pull in a restaurant preference just because both appear in the same conversation.

A reasonable starting budget might allow 12 durable facts, 4 retrieved passages, and the latest 8 conversation turns. That is not a universal setting, it is a testable hypothesis. Track answer accuracy, latency, and token spend as you change it.

The mistake I keep watching teams make is storing everything because deletion feels risky. In practice, unbounded memory creates a larger blast radius. A wrong fact can influence every later response.

Evals need a place in the product budget

An evaluation is not a final QA gate that appears after the feature is built. It is part of the product's operating cost and delivery schedule.

Every AI team needs an Eval Loop: a repeatable path from real request to expected behavior, automated score, human review, and a decision about what ships. The loop should run before a release, after a prompt change, and whenever a model or retrieval source changes.

Start with a small test set based on actual product risk. For a refund assistant, include:

  • A valid refund request inside the policy window
  • A request outside the policy window
  • An ambiguous request missing the purchase date
  • A malicious prompt asking for hidden policy text
  • An outdated policy document in the retrieval index

Give each case an expected behavior, not just an ideal answer. The system may need to answer, ask a clarifying question, refuse, or hand the case to a person. A good evaluation measures the action as well as the wording.

The National Institute of Standards and Technology published the AI Risk Management Framework in 2023. Its basic message fits production work: identify risk, measure it, and manage it throughout the lifecycle. That means your AI team should budget for test data, evaluator time, and regression runs in the same planning cycle as feature development.

A team that runs 500 evaluations after every change may create unnecessary spend. A team that runs none has no evidence. Use tiers:

  • A 25-case smoke set on every pull request
  • A 200-case regression set before release
  • A larger sampled set each week from real traffic
  • Human review for high-risk or low-confidence cases

Evaluation cost is often small compared with the cost of shipping an unmeasured failure. One incorrect answer to a customer, clinician, or employee can create support work and damaged trust that does not appear on the model invoice.

And yes, a spreadsheet of examples is better than a sophisticated evaluation platform with no useful cases. (I have watched teams buy tooling before they agree on what "right" even means.) Start there.

Cost is a behavior, not a finance report

Many teams track AI spend at the end of the month. Too late to steer anything. Cost changes when product behavior changes.

A user who asks one question may trigger retrieval, a primary model call, a tool call, a safety check, and a rewrite. If each step is invisible, the team sees only a blended invoice. That number cannot tell you which behavior to change.

Instrument every request with a trace ID and record:

  • Model name and version
  • Input and output tokens
  • Cache hits and misses
  • Retry count and reason
  • Tool calls and latency
  • Evaluation result and escalation status

OpenTelemetry can carry traces across services. Postgres can store request-level cost records. A dashboard can then show cost per completed task, not just cost per model. That distinction matters. A cheap answer that fails and triggers a human escalation may cost more than a larger first response that resolves the issue.

Suppose an internal IT assistant costs $0.018 for a normal answer. A retrieval timeout causes a retry, then a fallback model call, pushing the request to $0.11. If 40,000 monthly requests hit that path, the avoidable spend is $3,680. The fix may be a timeout policy or retrieval index repair, not a cheaper model.

Set a unit budget before launch. Examples include cost per resolved support ticket, cost per generated campaign brief, or cost per completed onboarding task. Then define an alert when the unit cost rises by 20 percent for two consecutive days.

Here's the part most people miss: the industry repeats a simple rule - use the smallest model that works. That is directionally useful but incomplete. A smaller model with three retries, poor extraction, and frequent human review may be more expensive than a larger model that finishes in one call.

Cost telemetry belongs beside quality telemetry. If the dashboard shows only dollars, the team will cut capability blindly. If it shows only accuracy, the team will spend without limits.

Design the AI team around control surfaces

An AI team does not need every person to own every layer. It does need clear ownership for the places where system behavior can change.

For a small product team, assign control surfaces rather than rigid job titles. One person may own retrieval quality while another owns model routing, but product still owns the user outcome.

Useful ownership areas include:

  • Memory policy and deletion rules
  • Evaluation data and scoring changes
  • Model routing and fallback behavior
  • Cost telemetry and budget alerts
  • Incident response for unsafe or incorrect output

This is where MLOps earns its place. MLOps is not just model deployment. In an AI product, it includes versioning prompts, retrieval sources, model settings, evaluation data, and production traces so the team can explain why behavior changed.

Imagine a team at a healthcare scheduling company. A new prompt improves appointment extraction in staging but lowers performance on Spanish-language requests. Without versioned evaluation data and traffic slices, the regression looks like random production noise. With those controls, the team can identify the affected segment and roll back the prompt.

Hiring managers should screen for this systems behavior. Ask candidates to draw the path of a request that fails after a model call. Strong candidates usually ask where the failure is logged, what the retry policy is, how the user is protected, and how the team will know whether the fix worked.

Weak answers jump straight to prompt wording. Not always a bad skill. An incomplete one.

A senior AI product leader should make budgets visible in planning. Put memory limits, evaluation coverage, and unit cost beside activation, retention, and latency. Those measures describe whether the feature can survive contact with real users.

Turn budgets into operating rules

Budgets become useful when the system can enforce them. A document that says "keep costs reasonable" is not a control.

Start by writing limits into the request path. Stop after a defined retry count. Trim context when the request exceeds the memory budget. Route low-risk classification to a smaller model. Escalate when confidence or evaluation signals fall below the accepted threshold.

For a production workflow, define at least these rules:

  • Maximum model calls per user action
  • Maximum input and output tokens
  • Maximum wall-clock time
  • Maximum cost per completed task
  • Conditions that require human review

Then test the limits deliberately. Send malformed tool results. Remove a retrieval source. Add a long conversation. Simulate a provider timeout. Ask what the user sees and what the team can inspect.

During one launch, I would rather see a system return a plain escalation message after two failed calls than continue spending and inventing an answer. Graceful failure is a product feature. It protects the user and gives the team a bounded incident to investigate. (If you've ever watched a live demo invent a refund policy on the spot, you already understand why this matters.)

Use staged rollout to learn the real distribution of costs. Start with internal users, then a small percentage of production traffic, then expand only when quality and unit economics stay inside the system budget. Compare traffic slices by task, model, language, account type, and failure path.

Do not wait for a large MLOps program before adding these controls. A Postgres table, a trace ID, a small evaluation set, and a scheduled report can provide a sound beginning. Sophistication can come later. Visibility cannot.

So the deeper lesson is that budgets are part of product design. They tell the system when to stop, when to ask for help, and when a feature is no longer economically safe.

What to do in your next planning session

Bring one AI workflow to the meeting. Not the whole platform. Pick the support bot, document assistant, or campaign generator that has a real user and a real cost.

Map one request from input to final answer. Record every model call, retrieval step, memory item, retry, and human handoff. Then write down four numbers:

  • Maximum context size
  • Evaluation coverage before release
  • Maximum cost per completed task
  • Maximum retry count

Run 25 representative cases through the current system. Include at least five failure cases. Compare the expected path with the observed path, and fix the largest gap before adding another feature.

I have seen this exercise expose missing logs, duplicate retrieval, stale memory, and retry storms in a single afternoon. That is the point. Systems thinking turns vague concern into an engineering backlog.

The model is not the product. The system that controls memory, quality, and spend is the product. Build those controls early, and your AI team can make better decisions before production makes them for you.

FAQ

What does AI systems thinking mean for an AI team?

AI systems thinking means evaluating the full path from user request to final outcome, including memory, retrieval, model calls, tools, retries, evaluation, and human review. It helps an AI team manage quality and cost as connected system behaviors rather than isolated technical choices.

How should an AI team budget memory in an LLM product?

Separate working context, durable user facts, retrieved evidence, and operational logs. Set limits for each category, attach source and expiration metadata to stored facts, and measure how context size affects accuracy, latency, and token spend.

What is the role of MLOps in generative AI products?

MLOps provides versioning, monitoring, evaluation, and rollback for models and the surrounding system. In generative AI, that includes prompts, retrieval sources, model settings, evaluation cases, traces, and routing rules.

How do you measure AI cost accurately?

Measure cost per completed task, not only cost per model call or monthly invoice. Record model, token usage, retries, tool calls, cache behavior, latency, evaluation outcome, and human escalation for every request.

What should AI leaders ask before shipping a new feature?

Ask what the feature remembers, how the team will measure correctness, how many model calls one user action can trigger, and what happens when the system fails. If those answers are missing, the feature is not ready for an uncontrolled launch.

0 comments

Join the conversation

Subscribe to comment

Join Curtis Foster's newsletter to leave a comment and get new posts in your inbox.

Read next

Hero image for blog post: Five signs your AI feature is a demo, not a product

Five signs your AI feature is a demo, not a product

Nov 10, 2026
Hero image for blog post: The AI production readiness review: 12 questions I ask before launch

The AI production readiness review: 12 questions I ask before launch

Oct 31, 2026
Hero image for blog post: How to design human handoffs for AI agents that cannot finish the job

How to design human handoffs for AI agents that cannot finish the job

Oct 23, 2026
AI systems thinking for teams: memory, evals, cost