---
title: "Engineering"
url: https://eldan.ai/writing/engineering
canonical: https://eldan.ai/writing/engineering
locale: en
language: en
updated: 2026-11-23
author: "Eldan Abdrashim"
cite_as: "Eldan Abdrashim. \"Engineering.\" Eldan.ai, updated 23 November 2026. https://eldan.ai/writing/engineering."
---

# Engineering

> Hands-on AI engineering: agents, evals, retrieval, and code you can run.

- **[Caching LLM calls without fooling yourself](https://eldan.ai/writing/cache-llm-calls-honestly.md)**: Provider prompt caching and response caching solve different problems. Know which one you use, build cache keys from everything that shapes the answer, let prompt and model changes invalidate them, and keep response caches out of the evals that decide releases.
- **[Write the eval before the prompt](https://eldan.ai/writing/write-the-eval-before-the-prompt.md)**: Most teams tune prompts by feel and learn about regressions from users. Reverse the order: define what right means, collect twenty real inputs, get a baseline, then write the prompt.
- **[Most RAG bugs are search bugs](https://eldan.ai/writing/most-rag-bugs-are-search-bugs.md)**: When a retrieval-augmented answer is wrong, the model is usually the last suspect. Measure what reached the prompt before you touch the prompt.
- **[Tool output is untrusted input](https://eldan.ai/writing/tool-output-is-untrusted-input.md)**: An agent that reads text written by strangers can be talked into things. You cannot filter your way out of it, so design so that a persuaded model can do little harm.
- **[Tokens are a budget](https://eldan.ai/writing/tokens-are-a-budget.md)**: Every model call has a bill and a clock. Treat cost and latency as design constraints, the way you treat memory on a phone, and write the budget down before you write the feature.
- **[Read the trace before you touch the prompt](https://eldan.ai/writing/read-the-trace-first.md)**: When an agent misbehaves, the reflex is to edit the prompt. Read the trace first: which tools ran with which arguments, what they returned, what the model actually saw and where the time went. A six-step checklist.
- **[Structured output is a contract, not a prompt](https://eldan.ai/writing/structured-output-is-a-contract.md)**: Asking the model nicely for JSON is a hope, not an interface. Write the schema first, validate every response in code, retry once with the validation error, version the schema, and track the parse rate as an eval metric.
