Design the pipeline from input to feedback
Write an end-to-end architecture outline for a Claude use case that covers input, processing, output and a feedback loop with a named signal, and judge a proposed architecture for the stage it leaves out.
Scenario
An online retailer ships a Claude feature that writes product descriptions for 40,000 marketplace listings from supplier spec sheets. The pilot looked great.
Four months later the returns team notices a pattern: listings call jackets "waterproof" when the spec sheet says "water resistant". Nobody can say how many listings are affected, which prompt version wrote them, or which spec sheets were half-empty scans to begin with.
The design was a prompt and a model. It had no input stage, no output contract and no way to learn from what went wrong.
Explanation
An architecture for a Claude solution has four stages. Each one answers a question the design must settle before anything ships.
1. Input: what reaches the model, and in what state?
- The sources (forms, email, documents, system records) and their formats.
- Checks before the model: unreadable files, empty fields, wrong language, duplicates. Failures go to an exception queue, not to Claude, which would otherwise produce a plausible answer from a bad input.
- The context added: reference data, retrieved documents, examples. Putting everything in every prompt raises cost and latency and can hit the context limit, so large knowledge bases usually need retrieval.
2. Processing: what does Claude do, and what does code do?
- The task given to Claude, the prompt (versioned, so you can tie any output to it) and the model.
- The pattern: one call, a fixed workflow, or an agent (the next lesson). Start with the simplest that works.
- The deterministic steps around it, from the previous lesson.
3. Output: what comes out, and where does it go?
- A contract: structured outputs make Claude's response follow a JSON schema, so downstream code can parse it. Code then checks the business rules the schema can't express.
- Grounding where readers must verify: citations return the passages that support each claim.
- The destination and the routing: which outputs go straight to a system, which to a person, by risk.
4. Feedback loop: how does the system get better?
- A named signal: an observable event such as a reviewer's correction, an overturned decision, a return, a complaint. "Users will tell us" is not a signal.
- Capture: log the input, prompt version, model, output and the outcome together, or you can't trace a failure to its cause.
- Change: failures become test cases in an evaluation set; a prompt change ships only after it passes that set. Anthropic's guides describe this cycle: define success criteria, test against them, refine, and keep evaluating in production.
A quick test for any outline: point to one bad output and ask where would we have caught it, and how would the next version avoid it? If no stage answers, a stage is missing.
Worked example
A city's 311 service receives 9,000 resident messages a month. The first proposal:
Resident messages go to Claude, which assigns a department and writes a reply.
It names processing only. The revised outline:
Input: messages from the app, email and web form, with location and photos. A script drops exact duplicates, attaches the case ID and sends unreadable or empty messages to the contact centre queue.
Processing: Claude (prompt v-tagged) classifies each message into one of 24 service categories and urgency, and drafts an acknowledgement. Code looks up the department and the SLA for the category.
Output: JSON with category, urgency, a one-sentence summary and the draft. Code checks the category is valid. Urgent safety reports (gas, a fallen tree on a road) go to a duty officer at once; the rest go to the department's queue.
Feedback: when a department sends a case back as wrongly routed, the case, prompt version and correct category are logged. Every month the team adds these to the evaluation set and tests any prompt change against it before release.
Each stage now answers its question. The feedback signal is concrete (a case sent back), it is captured with the prompt version, and it changes the system through the evaluation set rather than through ad hoc prompt edits.