Deciding what to build and what to buy
How to split an agent into parts, buy each unless building is verifiably better, read a benchmark sceptically, settle thin evidence by measuring vendors on your own data, and order the build as thin slices.
- Split an agent into parts that can each be bought or built, and say which parts must be your own.
- Apply the rule "buy unless building is verifiably better", and explain why the burden of proof sits on building.
- Ask four questions of any benchmark, and tell a maker's claim from an independent result.
- Decide between vendors by measuring them on your own data when the published evidence is thin.
- Order a build as thin vertical slices, and look up how a thing is normally done before designing it.
- Week
- 2 of 14
- Before it
- Chapter 1 and Chapter 2; Definition 9, Property 1 and Property 4 of the model.
- Read first
- [Miller 2024]; [Parnas 1972].
- Laboratory
- None; the method is used in the project proposal
- Problem set
- 1
3.1The problem: every part has a seller
An agent is assembled from many parts, and for almost every one a company will sell you a finished product with a page saying it is the best. Take one case. Your agent needs a browser, for sites that have no interface for programs. You can rent a hosted browser whose vendor supplies its own browsing agent; you can rent a plain browser and have your own model drive it click by click; or you can run Chrome yourself on your own server. One hosted-browser company publishes a comparison of every vendor's success at getting past websites' defences against automated visitors, and ranks itself first at 90.5%. Which do you choose, and on what evidence?
This chapter teaches a method for that decision. The current choices for Odysseus come at the end, but they will date and the method will not.
3.2The concepts
- Stack
- The full set of parts a system is assembled from: which model, which hosting, which libraries, which outside services.
- Buy or build decision
- For one part, the choice between adopting someone else's product or library and writing the part yourself. The point is who writes and maintains the code, not whether money changes hands. It is possible only for a part with a narrow boundary; a part whose job is smeared across the program cannot be swapped.
- Benchmark
- A fixed set of tasks with a way of scoring the answers, used to compare products. Its number means only what the tasks, the scoring and the people who ran it allow.
Evidence carries one of the four grades defined in Chapter 1. A buy or build decision should record the grade of the evidence it rests on, because the grade says how soon the decision ought to be revisited.
- Bake-off
- A comparison of vendors that you run yourself, on your own inputs, with a scoring rule you wrote before seeing the results.
- Thin slice
- The smallest version of a system that runs from one end to the other. It does very little, but every part that will exist later is present in some simple form, so that problems between the parts show up early.
3.3Splitting an agent into parts
An agent of the kind this book builds splits naturally into five layers. A channel carries the conversation (Telegram, WhatsApp). A model and loop choose actions. Hands and senses reach the world: search, mail and calendar, other apps, a browser, reading files, hearing voice. The control layer decides what may run and records what did: the gate, the budget, the journal, the delivery of results. State keeps memory and the schedule. Under all of it sits hosting, and beside it a way of observing what happened.
Buy unless building is verifiably better
The rule for each part is: buy it, unless building it is verifiably better. The burden of proof sits on building. A vendor maintains the part when the services it talks to change, which for an agent is constantly; and every line you write is a line you must test, which this book shows is far more work than writing it (Chapter 17).
"Verifiably better" can be shown in two quite different ways, by an argument about what the part guarantees or by measurement. Odysseus has a clear case of the first, and for memory and scheduling a case where the measurement came out level.
Better because the part decides trust. The gate, the journal, the budget and the delivery of results decide whether the system can be trusted. If they belong to someone else, you cannot say what they do, or show where the asking happens. The same argument rules out running a ready-made open-source agent as the whole system: it would give a conversation, file memory and a scheduler in an afternoon, but its control layer would be somebody else's. It remains a sensible baseline to measure against.
Level on the evidence. For memory and scheduling, no vendor was found to perform measurably better than a simple build, and no build was shown to be better than the vendors either. For memory the makers' scores did not reproduce (worked example below), and plain files matched or beat a dedicated product in two small independent tests. Three independent systems studied in the research had arrived at the same shape: a short file always loaded, dated notes searched when needed, a save before the conversation is condensed, and a later tidy-up. That agreement is better evidence than any single score. Odysseus has the first two, and the other two in its own form: what the owner said is offered for saving just after a conversation is condensed, not before, and a tidy-up is offered once a week. For scheduling, nothing beats a table of jobs for one user (Chapter 5, Chapter 6). By the rule as stated, a tie is not enough to build. These two parts were built on a tie, and the theory section below returns to that.
A tie goes to the vendor. Where the evidence shows a simple build only matching the products on sale, the rule says buy; building needs a clear win on the measure, or an argument that the part decides trust.
A bought part still needs a boundary you own
Buying a part does not mean handing it the keys. The connector service that reaches mail holds the tokens that open the owner's mailbox, and every message read passes through its servers; if it were breached, the gate would be irrelevant, because the gate guards what Odysseus does. The owner accepted that cost for the coverage. What keeps the choice reversible is that mail is reached through a few narrow tools of Odysseus's own, so the supplier behind them can be changed without disturbing anything else (Chapter 11).
When a service can be reached more than one way, prefer the vendor's own server: it offers more tools, the vendor maintains them, and one company fewer sees the data. For the firm's customer database it offered 58 tools, including synced emails, meetings and call recordings that the general connector's list did not (Chapter 13).
3.4How to read a benchmark
Most published comparisons of agent parts turn out to be run by one of the companies they rank. When a research pass read what the leading assistants connect to, it reported for every category (search, browser, connectors, text recognition, tracing) that most comparisons were written by one of the vendors compared. That does not make them useless. It means each must be read with four questions.
- Who ran it? A company testing itself chooses the conditions.
- How were the test cases chosen? A sample picked where one product is known to do well measures the picking.
- Who judged the answers? When a model marks the work, its mistakes become part of the score.
- Has anyone else reproduced it? A number that only its owner can obtain is a claim.
A memory product. Maker's claim One vendor of memory for agents reports scores above 92% on two standard tests (its report). Secondary An independent test of the same vendor's open-source edition reported 32.4% on one of them (write-up).
Apply the questions. The high figure was run by the maker (question 1), and the independent run did not reproduce it (question 4). The two tested different editions with different settings, so neither settles how good the product is. What the pair settles is narrower: a decision should not rest on the headline number. A separate audit reportedly found that the automated judge on a widely used memory test accepts a large share of deliberately wrong answers, which is question 3 failing for the whole field.
A browser service. Maker's claim The hosted-browser company of the opening scenario ranks itself first at 90.5% (its comparison). Its own write-up says the sites were chosen where its product had historically succeeded and ordinary Chrome had not. That is question 2, answered candidly by the company itself.
Which part of a vendor's ranking to believe
A vendor's comparison is not equally biased throughout. The vendor has an interest in its own position, and usually none in which rival comes second. So the order of the other vendors in a vendor's test is more believable than the top line. In the browser comparison, one rival was the only vendor that scored well on a test it did not run, which is worth more than the winner's figure.
3.5When the evidence is thin, measure on your own data
Sometimes the four questions leave nothing standing. The venture firm of this book's worked application needs a paid source of data about young companies and their founders (Chapter 23). Seven vendors sell it. The one independent benchmark found does not cover the companies this firm sees. But the firm has what no benchmark has: its own records of companies it already knows. So the decision is made by measurement: look up each known company in every vendor and count what comes back, with scripts/bakeoff.py.
3.6The mechanism: a bake-off in code
A bake-off has three pieces: a test set, a way to ask each vendor the same question, and a scoring rule fixed in advance. The rule decides whether the result means anything, and the script's documentation states it:
# scripts/bakeoff.py (module documentation)
What a row of the result means, per vendor and company:
found the answer names the company's own website, or its exact name
people the answer names a founder or team member the firm has on record for that company
funding the answer mentions a round, an amount raised or an investor
chars how much came back, as a crude measure of depth
A lookup is one read of the vendor, by website if the company has one and by name otherwise. Free tiers allow about a
hundred reads a day, so a run stops at the limit given and can be continued the next day; rows already done are kept.
Each column answers a partner's question of a vendor: does it know the company, the people, the money. None asks a model to judge, deliberately: a model as judge would put the judge's mistakes into the score, which is question 3 again. The rule is one function:
# scripts/bakeoff.py
def judge(answer: str, company: dict[str, str]) -> dict[str, object]:
low, flat = answer.lower(), norm(answer)
site, name = company.get("domain", "").lower(), norm(company.get("name", ""))
found = bool((site and site in low) or (name and len(name) >= 4 and re.search(rf"\b{re.escape(name)}\b", flat)))
people = [p for p in (x.strip() for x in company.get("people", "").split(";")) if p]
return {"found": found, "people": bool(found and any(norm(p) in flat for p in people)) if people else "",
"funding": bool(found and _MONEY.search(answer)), "chars": len(answer) if found else 0}
Three details carry the weight. A name shorter than four characters never counts as found, because a short name matches by accident. People and funding count only if the company was found, so a vendor cannot score for describing someone else's founders. And when the firm has no people on record, the people column is left empty rather than false, so no vendor is marked down for a question that could not be asked.
Each vendor names its lookup tool and its input differently. The script picks one from the names alone:
# scripts/bakeoff.py
def choose(tools: dict[str, dict]) -> tuple[str, str] | None:
"""The tool and input most likely to look one company up, from names alone. Checked by eye with `tools`."""
best = None
for name, row in tools.items():
low = name.lower()
if "compan" not in low and "organization" not in low and "entity" not in low:
continue
if not re.search(r"search|lookup|find|enrich|get|typeahead|resolve|snapshot", low):
continue
props = ((row.get("inputs") or row.get("input_schema") or {}).get("properties") or {})
field = next((p for p in _BY_SITE if p in props), None) or next((p for p in _BY_TEXT if p in props), None)
if field is None:
continue
score = (2 if field in _BY_SITE else 1) + (1 if re.search(r"enrich|lookup|typeahead|resolve|snapshot", low) else 0) - (1 if "list" in low else 0)
if best is None or score > best[0]:
best = (score, name, field)
return (best[1], best[2]) if best else None
An input that takes a website scores higher than free text, which encodes the main lesson of the measurement: a name finds the wrong company. The guess is "checked by eye": the tools command prints every vendor's tools and the choice made, and a fixed table, LOOKUPS, can override it once a person has checked the choice; it is empty, since no vendor is connected. A bake-off with badly chosen lookups would measure the guesser, not the vendors. Finally, the loop that asks:
# scripts/bakeoff.py, inside run()
for c in companies:
if (app.slug, c["name"]) in seen or made >= limit:
continue
value = c["domain"] if (field in _BY_SITE and c["domain"]) else c["name"]
if field in _BY_SITE and not c["domain"]:
continue # this vendor's lookup is by website and the firm has none on record
got = await handlers[f"{app.slug}_run"]({"tool": tool, "arguments": {field: [value] if field == "domains" else value}})
answer = got["content"][0]["text"]
row = {"vendor": app.slug, "name": c["name"], "error": bool(got.get("is_error")), **judge("" if got.get("is_error") else answer, c)}
done.append(row)
made += 1
with done_file.open("a", encoding="utf-8") as f:
f.write(json.dumps(row) + "\n")
Every row is written as soon as it exists, and rows already done are skipped: at about a hundred free reads a day, a bake-off across seven vendors takes days, and a crash on day three must not start it again. An error is recorded and judged as an empty answer, so a failing vendor is not silently dropped from its own denominator. Everything read and written stays in a folder kept out of the repository, because the test set is the firm's own pipeline.
3.7A worked example: two answers, one rule
The test set is a CSV file of companies. Take one invented row: name Orbit Labs, domain orbitlabs.example, people Jo Rivera; Sam Lee.
Vendor A is looked up by website and answers: "Orbit Labs (orbitlabs.example) raised a $2M seed round. Founded by Jo Rivera." The judge lower-cases the answer and finds orbitlabs.example in it, so found is true. It normalises the answer to orbit labs orbitlabs example raised a 2m seed round founded by jo rivera and finds jo rivera there, so people is true. The pattern for money matches "raised", so funding is true. chars is the length of the answer.
Vendor B is looked up by name and answers about a different business: "Orbit Labs Inc, a logistics firm at orbit-labs.example." The website check fails, because orbitlabs.example is not in the text. But the normalised answer begins orbit labs inc, and the name orbit labs appears there as whole words, so found is true. People and funding are false. The vendor is credited with finding a company it did not find.
Two lessons follow. The scoring rule is crude: the column is called "found", not "correct". And this fault is why website lookup is preferred throughout the script: a company's website is close to a unique identifier, and its name is not. A bake-off's result should be read with the same four questions as anyone else's benchmark: the owner ran it, the cases come from the firm's own records (so lean towards companies it already met), and a regular expression judges, with the blind spot just shown.
The state of this example in reality: a test set of 29 companies was written from the firm's database, 28 with a website and 12 with people on record. Verified: all seven vendors' addresses answer as servers of the right kind, three at addresses their own documentation gives and four at addresses on their own domains that were tried and answered. Not tested: any lookup at all. No vendor is connected, because each needs an account that only the owner can open, and choose and judge have been tested only on invented names (see "How to test a buy or build decision").
3.8Building in thin vertical slices
Choosing the parts is half the decision; the other half is the order in which they are joined. Building each part fully and joining them at the end postpones the hardest discoveries, which are found at the joins: a scheduler that runs a job but cannot deliver its result to the chat, or a stop command that the browser worker never hears. One builder's account describes scheduled jobs that ran correctly for a week and delivered nothing, and looked exactly like "nothing to report" (write-up). Secondary
Odysseus was built in six slices, each with a test stated before it began: a thread (a stranger gets no answer, "stop" ends a task mid-reply, a task over budget ends and says so); memory (a preference stated on Monday is used unprompted on Thursday); a schedule (every run ends as delivered, nothing to say, or failed, and a failure is announced); the gate, then mail (a planted instruction in a test email cannot cause a send without a tap); the browser (no saved secret reaches the model; a bot check reaches the owner), which was built to a different design and never met that test (Chapter 14); and measurement (a score checked by something other than the agent, with its sample size), which has been met only in a simulated world, on errands written by the builders.
Why the order matters
Stop, budget and log come first, because every later slice is observed and halted through them. Memory and scheduling come before any account, because they touch nothing outside the system. The browser comes last, because it is the largest piece and reads whatever any page chooses to show it.
The gate is built before the first tool that needs it. If mail were connected first and the gate added afterwards, there would be a period in which the model could send mail unchecked; built in the other order, that period never exists. Even reading mail early is a risk, because it puts untrusted text before the model, and any tool added before the gate would be reachable by instructions planted in that text. A strict order removes the need to reason about each case (Chapter 8, Chapter 9).
3.9Look up how the thing is done before designing it
Before buy or build comes knowing what the thing should be. The worked application needed a layout for the firm's database: what a deal is, its stages, what is recorded about it.
A first draft of the layout was made from the firm's earlier design and common sense. Asked whether it matched how early-stage funds work, the answer was that nobody had checked. Reading the database vendor's guide for venture firms, and one consultancy's write-up (sales material), found six gaps, among them no rule for when a deal leaves a stage, a single reason for passing where several are needed, and nothing recorded about a holding after investing.
The same happened when buying. A search for a document-sharing vendor's server found nothing; the vendor's own page of integrations, pointed out by the owner, listed one.
Look up how the thing is done before designing it. A design made from first principles reads as complete to the person who made it. The same was found of tests (Chapter 17) and of a whole program read by someone who did not write it (Chapter 19).
The same applies to buying: a search engine does not always find what the vendor publishes on its own pages.
3.10The current choices, part by part
| Part | Choice | Reason | Evidence |
|---|---|---|---|
| Model for conversation | Claude Sonnet 5.5 | Mid-priced ($2 in, $10 out per million tokens); the maker advises the cheapest model that passes your tests | Price Verified; no head-to-head run here |
| Model for unattended routines | Claude Haiku 5.5 | Runs often and needs little judgement | Not benchmarked for this job |
| Agent loop | Claude Agent SDK, run in the program's own process | The maker's own loop for these models, with a place to attach the gate in code | No public head-to-head of loops on assistant tasks. The maker's hosted loop was read against this design and not adopted: see below |
| Channel | Telegram through aiogram; WhatsApp through Meta's own Cloud API | The only Telegram library found supporting the current Bot API; Meta's route has no company in between, where an unofficial library breaks WhatsApp's terms | Verified at the source |
| Web search | Exa | Published comparisons disagree and differ by a few points; price and free credit read at the source | Weak on quality; price Verified |
| Mail, calendar, other apps | Composio | Widest coverage found (1,700+ apps), with sign-in handled by the service | Coverage Verified; no independent reliability test exists for any such service |
| Services with their own server | The vendor's own server where one exists | More tools, maintained by the vendor, one company fewer sees the data | Tool counts Verified live |
| Browser | Browser Use Cloud, its own browsing agent | Leads the one cross-vendor test of getting past bot defences; the owner chose to use it at full capability | Weak: Maker's claim |
| Reading files, hearing voice | Mistral | Text recognition that keeps headings and tables; the same key serves speech-to-text | Secondary; not compared with a rival here |
| Traces | Langfuse | Ordinary work others have done well, with instrumentation for the agent library | Secondary; not compared with a rival here |
| Memory | Plain files with search; built | The makers' scores did not reproduce; plain files matched or beat a product in two small tests | Medium; the independent tests are small |
| Scheduling | The program's own table of jobs; built | No vendor performs measurably better for one user | Not a question of performance |
| Gate, budget, journal | Built | They decide whether the system can be trusted | A design argument, not a measurement |
| Hosting | Fly.io, one small machine with a disk (prepared, not in use); the owner's laptop (in use). Hosting is deliberately the last part to be built | With the browser hosted elsewhere, the server runs only the bot and the agent | Price Verified; ran for five minutes (see Chapter 7) |
| Company and people data | None | To be chosen by the bake-off above | Not tested |
A review of what the leading assistants connect to concluded that nothing chosen should be replaced, but it read comparisons mostly written by vendors, so it carries their weakness.
A loop the maker hosts, read against this design
The maker of the model also sells the loop as a hosted service: it runs the agent loop and a container for the agent's tools, keeps the session, and adds scheduled runs, a grader that reworks a piece of output against a rubric, shared memory and a vault for credentials. The buy-first rule says to look. The comparison below was made from the service's reference documentation; nothing was run on it, so every row is a reading and not a measurement.
| Part of this design | What the hosted loop offers | What that means here |
|---|---|---|
| The gate: allow, ask or refuse each call by its inputs, in code | Each tool can be set to always run, always ask, or be judged by the service's own evaluator. Under "always ask" the customer's code is shown the call's inputs and answers | The gate's rules could be kept only by setting every tool to ask and answering from this program. The program must then be running and reachable for every call, which is the hosting the service was meant to remove |
| Tools that live in this program (mail, calendar, the chat, the firm's database) | A tool the customer runs is a round trip: the session stops, the customer's process runs the tool and sends the result back | About forty tools would each become such a round trip. The session waits while the process is away |
| Marking what was read, and cleaning it before the model sees it | The service can call a remote server of tools itself, with credentials kept in its vault. The documentation describes no way for the customer's code to alter a result before the model reads it | The record of what was read from the owner's accounts, on which the check on outgoing searches rests (Chapter 9), needs every result to pass through this program. So those tools would have to stay here |
| Where conversations are kept | The service keeps the session's whole history, with tool inputs and results, until the customer deletes it, and the documentation says it is not eligible for the maker's arrangement under which nothing is retained | Today the transcript of a conversation stays on the owner's machine. Moving the loop would put the text of mail and of the firm's records into a history held by the vendor |
| The rented machine for code and documents | A container with no outbound access unless hosts are listed, with an office suite and a browser already installed, billed by the hour of running time at about half the rate paid now | The one part that is attractive: no image to build, and the grader could replace the look-then-correct trial. Which typefaces it has is not documented |
| Routines | Scheduled runs by a timetable, with no machine of the customer's running | A routine here reads mail and the database through this program's tools and reports to the chat through it. With those elsewhere, a scheduled run would need an address of this program's to call, which again is hosting |
| Memory | Files the agent reads and writes; every change is kept as a version and can be reviewed afterwards | Here a write to memory made after reading other people's text is put to the owner first (Chapter 5). Review afterwards is weaker |
| Budget and stop | A spending limit per session, at list prices, and an interrupt | Equivalent. The limit per day across tasks would still be totalled here |
The reading: the loop is the light part of this program. The gate, the record of what was read and the tools are the heavy part, and they would stay in a process of the owner's whichever loop is used. So the hosted loop does not remove the need to host this program, and it would move the conversation's history to the vendor. The service's own guidance agrees: it names a customer who already hosts the loop, or who needs nothing retained, as cases for the plain interface. The core stays as it is.
One narrower use is worth a measured trial, under the rule of this chapter: making a document. That task takes files in and gives a file out, needs none of this program's tools while it runs, and has a natural rubric. A session on the hosted container with the grader can be compared with the present route on the same brief, by cost, time and the pages produced.
That trial was run once (scripts/bakeoff_documents.py): one made-up brief for a two-page memo with five figures in cards, a chart, a table, three risks and an empty box, given word for word to both, on the same model.
| The present route | The hosted loop with its grader | |
|---|---|---|
| Time | 76 seconds | 127 seconds |
| Cost | 17 cents, of which a tenth of a cent for the rented machine | 28 cents at list price, as the service reported it |
| Tries | One trial look at the pages, then the sending run | Two: the grader sent the first back, then passed the second on all thirteen points of the rubric |
| The pages | Two pages, everything asked for, denser. It followed the memo skill, so it also had numbered sections and a list of open questions. It put a dollar sign on the amounts, which the brief did not give | Two pages, everything asked for, more open in layout, and nothing added |
Both produced a memo that could be sent. The hosted route cost about two thirds more and took about two thirds longer, and bought a second reader that checks each stated requirement by itself. On one brief that is not a reason to move the task. It is a reason to note what the grader did that the trial look does not: it checked the file against a written list, point by point, in a context that had not written the file. The same model looking at its own pages let an unasked currency sign through. That one idea was taken and built here: a second reader for a trial's pages (Chapter 15). Not tested: more than one brief; a longer document; a slide deck; the owner's own template, which the hosted container would have to be given as a file. The service is marked as a beta.
3.11The theory
The rule is a decision under uncertainty, written here with the estimators of the model. Fix a part, a build a, the best vendor b, and a measure that matters for the part. Run both on the same cases i = 1…n drawn from the owner's own inputs, as in Definition 9, and take the paired difference with its bootstrap interval [L, U] over cases:
Δ = (1/n) Σi (ȳia − ȳib)
Then "buy unless building is verifiably better" reads: build if L > 0 and Δ exceeds the noise floor; otherwise buy. The burden of proof is the asymmetry: when the interval contains zero, the answer is buy. The costs the chapter gives as reasons (a vendor keeps the part working as the services it talks to change; every line built must be tested) do not appear in Δ, and the rule charges them to building by requiring it to win clearly.
"Verifiably" then has a precise content. The chapter's four questions of a benchmark are conditions on this comparison. Who ran it: the cases and the scoring rule were fixed before the results were seen, so that Property 4 applies and the error level is spent once. How the cases were chosen: they are a sample of the owner's inputs, not of inputs where one product is known to do well. Who judged: the score is computed by a rule whose mistakes are known, under which a do-nothing baseline scores zero. Has it been reproduced: the same Δ is obtained again. Definition 9 adds two conditions the questions leave implicit: the comparison is paired on the same cases, and the measure has headroom, since if both options score near one neither can be shown better.
Take k = 1 and a yes-or-no score, so each per-case difference is −1, 0 or 1. Let u be the number of cases only the build gets right and v the number only the vendor gets right, so Δ = (u − v)/n. If the two were equally good, each of the u + v cases on which they disagree would favour either side with probability one half, so u − v would have mean 0 and standard deviation √(u + v). At about two standard deviations, a difference is distinguishable from chance only if
|u − v| > 2√(u + v)
On a test set of 29 companies, an option that is right on 5 cases where the other is wrong, and wrong on none where the other is right, clears the bar (5 > 4.47); 4 such cases do not (4 = 4). This is the normal approximation to the sign test; with few disagreements an exact binomial calculation should replace it.
For the gate, the budget, the journal and the delivery of results the chapter decides by argument, not by Δ. The argument is Property 1: complete mediation can be argued only about a mediator whose code paths can be read and checked. A bought control layer could be measured, but no measurement establishes that every path passes through it. For these parts building is verifiably better in the sense of a property, and no bake-off would help.
The chapter's measured decisions fall short of the rule in ways it mostly states. None carries an interval; the document trial is one brief, so none can exist. The company-data bake-off fixes its rule in advance, as required, but no lookup has been made, and its found column credits a match by name, so it would measure a match in text and not the identity of a company. Memory was built on two small independent tests, read by research and not run on the owner's data, which at best place Δ near zero. So memory is where the decision departs from the rule. A different rule, which builds when a simple build matches the best vendor and buys only when a vendor is clearly better, agrees with "buy unless building is verifiably better" when the interval excludes zero and disagrees exactly when it contains zero, which is where the memory decision sits: memory was built under that other rule, on a tie.
| Claim in this chapter | Kind | How it is known |
|---|---|---|
| The control layer must be built | Argument from Property 1 | No measurement could replace it |
| Plain files serve memory as well as a product | Measurement, secondary | Two small independent tests, not on the owner's data, no interval |
An empty answer scores zero under judge | Property of the scoring rule | Argued from the code; an error is judged as an empty answer |
| The hosted loop cost about two thirds more on a document | Measurement | One brief, one run each |
| A hosted browser leads at 90.5% | Maker's claim | Sites chosen where its product had succeeded |
3.12What goes wrong
A promised comparison that never runs. The browser was to be settled by running two vendors on the sites the owner uses. That comparison has not been run. A provisional decision becomes permanent once code is built around it; the defence is to keep the missing comparison on the status map (Chapter 25).
A requirement picks the product, not just the vendor. The chosen browser vendor lets its automatic handling of bot checks be switched off only on its plain browser, not on its browsing agent. When the owner decided that bot checks should not come to them, that decision picked the design: the vendor's agent deciding each click inside the vendor's service (Chapter 14).
The stack was proposed three times before it was settled. The first proposal was the cheapest that works: one small server running the bot, the agent and a copy of Chrome, with a mid-priced model. The owner asked instead for the most performant vendors, which moved three choices: the top-priced model, a hosted browser, and one connector service for every app. The owner then restored the mid-priced model on cost: the stated reason was that the top model's list price was four times higher. (The program's own price table, in odysseus/agent.py, has it at twice: $4 and $20 per million tokens against $2 and $10.) Nobody has published what a month of a single-user assistant costs. Each reversal should be recorded with its reason rather than tidied away.
3.13How to test a buy or build decision
A decision to buy is tested the way a feature is: by something other than the vendor's word. The test must use your inputs, a scoring rule fixed before the results are seen, a baseline that cannot score (a lookup that returns nothing must score zero), and a stated sample size.
What exists is limited. The bake-off script has one unit test (in tests/test_startup.py), on invented companies and invented tool names: it checks that choose prefers a lookup by website and finds nothing in a tool set with only a people search, and that judge credits a matching answer, does not credit a different company of a similar name and website, and leaves the people column empty when the firm has nobody on record. It does not test the case in the worked example, where the name alone matches. No vendor has been compared with another by Odysseus on real use, for any part. The one decision resting on measurement is memory, and that was two small independent tests read by research, not runs made for this project. The model choice rests on price and the maker's guidance.
Verified: prices and coverage read at the source; that seven data vendors answer as servers of the right kind; that a test set of 29 known companies exists; that the scoring rule and the tool chooser pass one unit test on invented names. Maker's claim: every quality figure for the browser vendor. Not tested: any bake-off lookup; the comparison of two browser vendors on the owner's sites; any head-to-head of models on the owner's errands; the monthly cost of the whole stack.
What is least certain, in order. The browser vendor, the weakest choice on the evidence. The company-data vendor, to be chosen by a measurement that has not been run. The model maker: the comparison leans towards one maker partly because its documentation was the easiest to read, which is a fact about the research, and the tools used to research and draft this project run on that maker's models, so weigh the recommendation by the evidence cited. And the monthly bill, which will be known only after weeks of running (Chapter 20).
3.14Where this sits in the literature
The make-or-buy question is older than software. [Coase 1937] explained the boundary of the firm by comparing the cost of using the market with the cost of organising internally, and [Williamson 1979] showed how asset specificity and uncertainty push a transaction from buying towards integration. The chapter's split agrees with that account where it is plainest: the gate, the budget and the journal are specific to this owner and to this program's guarantees, and no contract with a supplier could make their behaviour something the program can argue about, so they are built. The same theory names the risk in the bought parts, dependence on a supplier who cannot cheaply be replaced, and the chapter's answer, reaching mail through a few narrow tools of the program's own, is an engineering way of keeping that dependence small. The economics does not say how to price the upkeep of a part whose surroundings change constantly, which is the cost the rule here charges to building; for components of this kind that is not settled.
The narrow boundary that makes a part swappable is the criterion of [Parnas 1972]: cut modules around the design decisions likely to change, not around steps of processing. Which company supplies mail is such a decision, and the chapter's definition of a buy or build decision, possible only for a part with a narrow boundary, is Parnas's criterion applied to procurement. [Sculley et al. 2015] catalogued the system-level costs that surround models in production, glue code among them. Each bought part here comes with glue (the program's own tools wrapped around a connector, the bake-off's guess at each vendor's lookup tool), and that glue must be tested like any other code, which weakens the argument that buying saves testing.
On evidence, the published work is stronger than this chapter's practice. [Miller 2024] argue that evaluation results should carry standard errors and confidence intervals, and treat clustered errors, paired differences and power. None of the chapter's decisions carries an interval, and the trial of the hosted loop is one brief. [Zhu et al. 2025] analyse validity problems in agent benchmarks, among them flaws in task setup and in graders, and give a checklist for building benchmarks; the chapter's four questions are a short subset of it. [Bean et al. 2025] reviewed 445 language-model benchmarks against validity criteria and report recurring weaknesses in what they measure and how they score it. The bake-off's found column is a small instance, as the worked example shows: it measures a match in text, not the identity of a company. [Kapoor et al. 2024] ask that agent evaluations report cost beside accuracy and guard against overfitting with held-out tasks. The document trial reports cost and time beside the pages, which meets the first request; with one brief there is nothing to hold out.
The memory example shows why the first of the four questions comes first. The authors of the Mem0 paper are the system's developers [Chhikara et al. 2025], so its results are vendor-reported, and the chapter's case of a maker's score that an independent run did not reproduce is that pattern at work. The reproduction failing does not show the product is weak, as the chapter says; it shows the headline number cannot carry a decision.
Last, the order of building. Thin vertical slices are the tracer bullets of [Thomas and Hunt 2019]: a thin path from one end to the other, built first and then refined. The chapter adds a constraint the general advice does not have. The gate must come before the first tool that needs it, because in an agent the join between two slices can be a period in which an instruction planted in what the model reads meets a tool that nothing checks.
- Split the agent into parts with narrow boundaries, so each can be bought, swapped or built on its own.
- Buy unless building is verifiably better. Building wins where a part decides trust (gate, budget, journal) or where the evidence shows a build clearly better. A tie goes to the vendor; memory and scheduling were built on a tie, which the rule does not by itself license.
- Most comparison pages are written by a vendor in them. Ask who ran it, how cases were chosen, who judged, and whether it was reproduced. A maker's score above 92% met an independent 32.4%.
- When published evidence does not cover your data, run a bake-off on records you already hold, with a scoring rule fixed in advance, no model as judge, and lookups by a unique identifier, since a name finds the wrong company.
- Build in thin vertical slices, with stop, budget and log first and the gate before the first tool that needs it.
- Look up how a thing is normally done before designing it.
Review
- A vendor's benchmark ranks itself first and three rivals second to fourth. Which part of the ranking deserves more trust, and why?
- Using the rule "buy unless building is verifiably better", explain why search and the browser were bought, and say whether the rule as stated licenses building memory and scheduling on the evidence the chapter gives.
- In the worked example, Vendor B was credited with finding a company it did not find. Change
judgeso that, when the firm has a website on record, a match by name alone is reported separately from a match by website. What new column would you add to the printed summary, and what would it tell you? - The bake-off has no baseline. Write a stand-in vendor that returns an empty answer for every lookup, and state what its row of the summary must show. Then write a second stand-in that returns the company's name and nothing else. What does its row reveal about the scoring rule?
- Design the browser comparison that was promised and never run: which sites, what counts as success, who or what judges, how many runs per site, and what result would make you switch vendors. Say which of the four benchmark questions your design is weakest on.
Analysis
- Two company-data vendors, P and Q, are each looked up once on the 29 companies of the test set. P finds 21, Q finds 17, and 15 are found by both. (a) Compute the paired difference Δ in favour of P and the numbers u and v of the derivation in the theory section. (b) Does the difference clear |u − v| > 2√(u + v)? (c) Keeping the number of companies only Q finds at 2, what is the smallest number found only by P that would clear it? And if Q found nothing that P missed? (d) Say why the 15 companies both found play no part in your answers.
- Show from the code of
judgethat an empty answer scores zero in every column, or leaves the people column empty. Then, for the invented rowOrbit Labs,orbitlabs.example, write a vendor answer that describes no company at all yet scores found and funding true. Say which assumption about vendors' answers the rule makes without stating it, and change the rule so that your answer scores zero while the answer of Vendor A in the worked example still scores as before. - Write the rule "build when a simple build matches the best vendor; buy only when a vendor is clearly better" in the notation of the theory section, as a condition on Δ, L and U. Give one result on which it agrees with "buy unless building is verifiably better" and one on which they disagree. For the memory decision, say which of the two the chapter actually applied, which you think it should apply, and what measurement on the owner's own data would settle the case under either rule.
- The chapter builds the gate by argument and not by measurement. Using Property 1, show that no bake-off result, however large, could establish that a bought gate mediates every call. Then state the hypotheses under which a bought gate could satisfy Property 1 after all, and for each say what you would have to be able to see or test to check it.
Design
- A vendor offers a hosted policy engine for agents: each proposed tool call is sent to its service, which answers allow or deny from rules the customer writes in the vendor's own language. The owner asks whether it should replace
gate.py. Using the rule of this chapter, decide; say what the engine guarantees whatever the model does, under what conditions Property 1 would still hold, what is given up (consider the record of reading, approval questions built from the call, and what happens when the service does not answer), and what would make you change your decision. - Design the bake-off that would choose a web search vendor for this program. Give the cases and where they come from, the scoring rule fixed in advance, the baseline that must score zero, whether any model judges, the number of cases needed for a disagreement of 10 percentage points to clear the bar of the derivation if the two vendors disagree on a fifth of cases (treat the counts as proportions of the number of cases, ignoring rounding), and the result that would make you change vendors. State what your design guarantees about the decision and what it gives up.
Reading
- [Miller 2024]. In about four hundred words: what it claims about reporting evaluation results; why it matters for this chapter's decisions on memory and on the hosted loop, neither of which carries an interval; where you were not convinced, given that the chapter's cases are few and costly to run; and what you would measure next. Say which decision in the chapter you would reopen first under their standards, and how many cases it would need.
- [Parnas 1972]. In about four hundred words: what it claims about decomposing a system into modules; why it matters for this chapter's definition of a buy or build decision and for reaching mail through a few narrow tools of the program's own; where you were not convinced, for instance whether a connector service's whole catalogue can sit behind a narrow boundary; and what you would build next to test that the supplier behind the mail tools could be changed without touching anything else.
Open
- (Open.) The company-data bake-off draws its test set from companies the firm already met, which biases it towards companies that are easy to find. Propose a way to build a test set of companies the firm had not yet met at the time, without using any vendor's data to choose them, and argue whether the bias you remove is larger than the one you introduce.
- The rule's burden of proof rests on a cost nobody has measured: the upkeep of a built part as the services around it change, against the risk of depending on a vendor. Propose a way to measure both for the parts of an agent, in units that can be compared with Δ, such as hours of work or failures per month. Progress would be estimates with intervals for several parts of one program, measured over enough months to say whether, for any part, the upkeep of building exceeds the difference in performance that the rule asks building to show.