Chapter 7: What can a single call do?
In earlier chapters, we established the fundamental mental models: an LLM is a stateless pure function (Chapter 4), governed by a system prompt control plane (Chapter 5), and bounded by a finite context window (Chapter 6).
Before we jump into building complex multi-step agents, loops, and retrieval architectures, we must appreciate a profound architectural shift: a single, isolated API call to an LLM can replace months of traditional machine learning infrastructure.

The Single-Call Architectural Revolution
In traditional software engineering, solving natural language problems required dedicated machine learning pipelines:
- Collecting and cleaning thousands of domain-specific training examples.
- Training or fine-tuning specialized models (BERT, spaCy, custom classifiers).
- Managing dedicated GPU inference servers, model registries, and drift monitoring.
- Writing custom feature extraction code for every new language or format.
With modern foundation models, these distinct NLP tasks collapse into prompt engineering over a single HTTP POST request.
You do not need a multi-agent framework or complex orchestrator for the majority of everyday backend problems. A single well-structured call can reliably perform six core primitives.
+-------------------+
| Single LLM Call |
+---------+---------+
|
+------------+------------+----+----+------------+------------+
| | | | | |
v v v v v v
Transform Classify Extract Summarize Evaluate Expand
The Six Core Single-Call Primitives
1. Transformation and Translation
Transformation takes an input payload in one representation and converts it to another without changing its underlying semantic meaning:
- Format Conversion: Natural language questions to SQL queries, raw CSV logs to structured JSON, or Markdown to HTML.
- Code Translation: Translating legacy Python scripts into idiomatic Go or Rust structs.
- Natural Language Translation: Translating user reviews across dozens of human languages with cultural nuance.
// Prompt: "Convert the following user request into a SQL SELECT query for PostgreSQL 16"
// Input: "Find the top 5 customers in Toronto by revenue this year"
// Output:
"SELECT customer_id, name, SUM(amount) AS revenue FROM orders WHERE city = 'Toronto' AND EXTRACT(YEAR FROM created_at) = 2026 GROUP BY customer_id, name ORDER BY revenue DESC LIMIT 5;"
2. Classification and Routing
Classification maps unstructured input text into a bounded, deterministic set of categories. It is the backbone of automated ticket routing, spam filtering, and sentiment detection:
// System Prompt: "Classify incoming tickets into one category: BILLING, TECHNICAL, or ACCESS."
// User: "My security key expired and I cannot log into the admin dashboard."
// Assistant:
{
"category": "ACCESS",
"confidence": 0.99,
"urgent": true
}
By enforcing a strict JSON schema, host applications can route the ticket directly into an internal message queue (e.g., Kafka or RabbitMQ) without manual human triage.
3. Structured Entity Extraction
Extraction pulls specific, structured data fields out of unstructured or messy text:
- Extracting invoice numbers, line items, tax IDs, and totals from noisy OCR scans.
- Isolating error codes, stack traces, and affected user IDs from distributed server logs.
- Parsing contract terms, termination clauses, and renewal dates from legal PDFs.
// User: "Dr. Elena Vance examined patient #9042 at St. Jude's on Aug 18, prescribing 20mg Lisinopril daily."
// Assistant:
{
"doctor": "Dr. Elena Vance",
"patient_id": "9042",
"date": "2026-08-18",
"facility": "St. Jude's",
"prescription": {
"medication": "Lisinopril",
"dosage": "20mg",
"frequency": "daily"
}
}
4. Summarization and Condensation
Summarization compresses large volumes of text while preserving the critical facts, numbers, and decisions.
- Executive Briefings: Condensing an hour-long engineering post-mortem into three bullet points.
- Context Compression: Summarizing the first twenty turns of a customer support transcript before passing it to a human agent.
5. Evaluation and Policy Grading (LLM as a Judge)
Evaluation uses the model to grade content against an explicit rubric or compliance checklist.
- Pull Request Policy Checks: Does this code diff introduce unparameterized SQL queries or hardcoded API keys?
- Customer Support QA: Did the customer service agent follow company tone guidelines and verify identity before discussing account details?
// System Prompt: "Evaluate the support response against our verification policy."
// Assistant:
{
"passed": false,
"violations": [
"Agent discussed account balance before confirming 2FA pin."
],
"score": 3.5
}
6. Expansion and Synthesis
Expansion takes sparse, structured inputs (bullet points, configuration flags, or schemas) and synthesizes rich, formatted artifacts:
- Generating draft release notes from a list of Git commit messages.
- Creating sample test cases from an OpenAPI specification.
- Expanding short error descriptions into customer-facing help articles.
Architectural Best Practice: Keep It Single-Shot First
A common anti-pattern in modern AI engineering is reaching for complex, multi-turn autonomous agent loops when a simple single-shot API call is sufficient.
Autonomous agents introduce latency, cost, nondeterminism, and potential loop failure modes. Whenever your problem can be framed as a single transformation, classification, extraction, or evaluation, use a single stateless call.
Only when a task requires dynamic environmental feedback (invoking tools, reading database results, branching based on intermediate outputs, and retrying) do you need to step up to multi-turn agent architectures.
Before we build multi-turn systems, however, we must examine the failure modes of single calls. In Chapter 8, we explore Gotchas, Part 1.