Recap: Coding Agents for Spatial Aggregation
By Nora Maybury
Thank you to all who joined us for CAFE University’s Coding Agents for Spatial Aggregation. This webinar was presented by Mahima Kaur, MS, a data analytics engineer at the Harvard School of Public Health and member of CAFE’s Data Management team. After reviewing key concepts, Ms. Kaur discussed promising practices in utilizing Artificial Intelligence (AI) agents and building trustworthy workflows.
Key concepts
Learn the difference between:
- Large Language Models (LLM): An LLM responds to prompts and can generate code, explain problems, and suggest solutions. On its own, an LLM cannot act on code or files.
- Agents use an LLM to reason, make decisions, and take actions through tools in an agent loop. An agent harness is the software layer that turns an LLM into an agent.
Check out this graphic to visualize the AI coding ecosystem and better understand how AI providers, models, agent harnesses, project repositories, and the development environment work together.
Coding trustworthy workflows
There is a range of agent autonomy in coding workflows, from human-directed (assistance) to agent-directed (delegation).
- Walk through an example of a delegation prompt instructing two different agents to build a pipeline that processes data to generate precipitation estimates. While both agents A and B generated reasonable-looking maps, the results demonstrate that there is a gap between intent and implementation.
- Explore four dimensions of trustworthiness when building an analytical workflow that lessens this gap; methodological correctness, data quality and fitness, traceability, and validation.
- Successful workflows also benefit from multi-step prompting. It’s a good practice to review and refine prompts at each stage to improve development.
Preserving Context
As workflows become more complex, maintaining context and intent across tasks and sessions becomes more challenging. Explore three strategies:
- Persistent project instructions: These instruction files (AGENTS.md and CLAUDE.md) live in the project’s root directory and serve as memory for AI coding agents.
- Spec-driven Development: This development approach ensures your intent is explicit and durable by providing your agent with structured specifications that act as shared artifacts.
- Reusable agent skills: Build agent capacity by creating portable, self-contained folders of procedural knowledge that helps agents perform repetitive, consistent tasks.
- Walk through what this process would look like using an example prompt.
GitHub Repository Demo
CAFE’s publicly available GitHub repository includes code, examples, and tutorials on common data formats and sources. The ‘Coding Agents for Spatial Aggregation’ demo provides a reproducible scientific workflow for PRISM precipitation spatial aggregation using the methods for preserving context discussed in the webinar. Watch the demo as you follow along in the GitHub repository.
Summary and Questions
In summary, the following practices are beneficial when using coding agents:
- Make decisions explicit and well defined
- Use agent skills for reusable expertise
- Validate against scientific intent
Audience questions included:
- Cross-checking between agents
- QA/QC skills
- How to check your code
- Adjusting workflows when working with confidential data.
As mentioned by moderator and CAFE Capacity Building Team Co-Lead, Dr. Rachel Nethery, Associate Professor of Biostatistics at Harvard T.H. Chan School of Public Health, CAFE hosted a previous webinar on synthetic data that may be useful when developing code for use on data that cannot be openly shared (e.g., data that includes protected health information, or “PHI”).







