20 Complete Example: Document Processor
This chapter is a full example focused on file I/O and robust data processing, with an agent in the loop where it adds real value.
20.1 This Chapter Will Cover
- Reading and writing files safely
- Iterating over documents/data with durable progress tracking
- Extracting structured data from messy inputs
- Error handling patterns that survive retries and restarts
- Specs + mocks for deterministic tests, plus evals for extraction quality