Context engineering

Primary source

A primary source is the authoritative original: the actual code, the real types, the official docs. Point agents at primary sources so they read reality instead of guessing from memory.

James Phoenix
Understanding Data Updated July 2, 2026

A primary source is the authoritative original: the actual code in the repo, the real type definitions, the official documentation, the live API response. It is reality, not someone's account of reality. When you want an agent to be right, you point it at a primary source and let it read.

Why it matters so much for agents

A model defaults to answering from memory, which is frozen at its training cutoff and often subtly out of date. A primary source overrides that. When the agent reads the real file, its answer becomes contextual knowledge: grounded in what is actually there, right now. This is the single biggest defence against confidently wrong output.

The move in practice is simple:

  • Let the agent open the real file instead of recalling the library's shape.
  • Point it at the official docs, not a half-remembered blog.
  • Have it run the code and read the actual error, not imagine one.

You often do this with a context pointer: hand over the path or URL and let the agent fetch the source itself. Contrast this with a secondary source, which is second-hand and needs checking.

Tip
When an agent asserts something you cannot verify, ask which primary source it read. If the honest answer is "none, from memory," treat the claim as a guess until it opens the real thing.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help