Context Engineering
for AI Agents

Making your project knowledge durable

Anthony Arendt · University of Washington / eScience Institute
Joachim Meyer · Boise State University

NASA Responsible GenAI Hackweek - August 2026

Your agent does not remember
most of your project context

Blind to your project
Doesn't know your data, conventions, or goals
Resets every session
No memory carries over — starts fresh each time
Fills gaps confidently
Good at reverse engineering — and eager to guess wrong
Durability is up to you
You decide what persists — the agent won't do it for you

Persistent context options in current landscape

Agents are building "memory" features, but durability is still largely in your hands.

Always loaded
Context documents read every time, regardless of task
AGENTS.md
Invoked on match
Skills and named procedures loaded when a task fits
Skills
Auto-triggered
Rules and path-scoped constraints that fire on specific files
Rules
Delegated
Subagents and specialized personas summoned for expertise
Subagents
← Always present On demand →

Today: Two options on the spectrum

1 Context document AGENTS.md Always-on, loaded every session — the foundation of what your agent knows
2 Skill On-demand, invoked when the task matches — a recipe reached for only when needed
Not covered today Rules Auto-triggered on specific files
Not covered today Subagents Delegated specialized personas

snowexsql — A Python library
for the SnowEx database

NASA SnowEx campaign — multi-year field and airborne snow measurements across western US and Alaska

PostgreSQL/PostGIS database — snow depths, density, temperature, stratigraphy, SWE

Python package — query via a Lambda client (no credentials) or direct DB connection

Returns DataFrames — filters by campaign, date, type, location

Your code snowexsql PointMeasurements LayerMeasurements .from_filter() SnowEx DB returns DataFrame

Clone the forked repo: github.com/jomey/snowexsql — Agents cheat! (Ask me later)

Scientific use case: Querying snow depth layer data

"Create me a code block that queries the database and returns snow depth layer data for a snow pit and date during the Alaska campaign"
Power user

Advanced joins and raw SQL for complex multi-table queries. More flexible, steeper learning curve.

This question has multiple valid answers — we guide the agent to recommend the simple solution first.

Live Demo

Repository with no context

claude

Running the snow depth query prompt against a bare repository — no AGENTS.md, no skills.

Watch for

What does the agent do when it has no guidance? Where does it guess?

Confident, fast, and complicated

Reverse engineered Dove into the source code instead of using documented patterns
Chose the complex path Suggested the advanced solution when the README shows simpler as preferred
Burned tokens guessing Spent effort guessing query parameters it could have been told
Your Turn

Run the prompt, then compare with a partner

Run prompt
Compare outputs
Discuss

Paste this prompt into your terminal

"Create me a code block that queries the database and returns snow depth layer data for a snow pit and date during the Alaska campaign"

Discuss

How different are the outputs? Did you get the same solution?

How to guide the LLM with context?
Add a central context document

"Think of AGENTS.md as a README for agents: a dedicated, predictable place to provide the context and instructions to help AI coding agents"

An open standard — supported by Copilot, Codex, Cursor, Claude Code, and many more. Used in 60k+ open-source projects.

AGENTS.md

A good AGENTS.md is concise and actionable

Be specific
Not "follow best practices" — instead Run lint after every change
Start simple
Begin with a few lines — expand as you learn what the agent needs
Keep it short
Under 200 lines or 32 KiB — less to parse, less to contradict
It's a guide, not enforcement
No guarantee agents honor "DO NOT EDIT" — verify what matters
Nest for big repos
Subdirectory files override the root — the "closest" one wins
Public repos: models may learn from it
Future models might train on your file — keep secrets out
Live Demo

Re-run with AGENTS.md

claude

Same prompt, same repo — but now with an AGENTS.md guiding the agent.

Watch for

Does it pick the right connection type? Does it still guess at filter options?

Your Turn

Compare again — what changed?

How different are the outputs from each other?

How do they compare to the first attempt?

Discuss

Did the AGENTS.md make a difference? What improved? What still needs work?

What goes in, what stays out

Include

Domain vocabulary the model can't infer

Build and test commands

Project structure overview

Naming conventions

Common pitfalls and gotchas

Leave out

Anything discoverable by reading code

Information that changes frequently

Contradictions with the actual codebase

Lengthy tutorials or explanations

The guiding principle: if the agent can figure it out by reading, don't repeat it. If it can't, write it down.

AGENTS.md
Skills

What if you need guidance
only for specific tasks?

AGENTS.md loads every time — but some procedures only matter for specific kinds of work. You don't want a database query recipe firing on a plotting task.

Context documents are always-on.
Skills are on-demand.

AGENTS.md
Always loaded
Fires every session, every task — the foundation of what your agent knows about this project
Skill
On demand
A named procedure invoked only when the task matches — pulled from the drawer when you need that specific recipe
Think of it like a kitchen: AGENTS.md is the house rules posted on the wall. A skill is a recipe card you pull from the drawer when you're making a specific dish.
Tip: Reference your skills in AGENTS.md — any agent that reads it will discover them, regardless of tool.

A real skill: db-query

---
name: db-query
description: Guide to answering SnowEx database query questions
whenToUse: When the user asks how to query, access, or filter data
---

## No setup required
Use the preferred Lambda client. No env vars, credentials, or AWS account.

... (filtering, query limits)
name
How you invoke it — short and memorable
description + whenToUse
How the agent decides whether to load this skill — match criteria
body (instructions)
The procedure the agent follows — constraints, tips, and guardrails
Live Demo

Adding a skill and re-running

claude

Same prompt again — but now with a skill registered for database queries.

Watch for

Does the agent invoke the skill? Does the output follow the skill's prescribed pattern?

Your Turn

What changed with the skill?

Is the output more consistent between partners?

Think of ways to improve the skill

Discuss

What would you add or change in the skill to get better results?

What we built today

Bare repo
No guidance
Confident but wrong
+ AGENTS.md
Always-on context
Right direction
+ Skill
On-demand procedure
Consistent output
Each layer reduced guessing — the agent spent tokens following your instructions instead of reverse-engineering your project.

You're a context engineer now

AGENTS.md

Start with 5 lines — project name, build command, test command

Add domain vocabulary the model gets wrong

Grow it as you observe agent mistakes

Skills

Identify a task you repeat — that's your first skill

Write the steps you'd tell a colleague

Reference the skill from AGENTS.md so the agent finds it

Context engineering is iterative: observe what the agent gets wrong, then write the context that would have prevented it.

1 / 0