C.W.K.
Stream
Lesson 02 of 05 · published

The Body: Selective Sources and References

~25 min · sources, retrieval, selectivity

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

Body is the working set

The body is the layer between spine and tail: source files in scope for this turn, retrieved documents, recent tool results that still matter. It is selective on purpose. Loading the entire repo or the entire knowledge base into the body is the failure mode this layer is designed to prevent.

Annotate sources

Every body item benefits from a short header: where it came from, when it was loaded, and why it is here. The model uses these headers to locate facts and to discount stale or irrelevant material. They also help the human auditing the prompt later.

Body churn is normal

Unlike the spine, the body is meant to change. New questions load new sources. Old sources get evicted when they stop earning attention. A static body is usually a sign that the workflow is over-loading and under-paging.

The body is a working set, not a corpus. Treat it like CPU cache: load on demand, evict when stale.

Code

Annotated body section·xml
<sources>
  <file path="backend/auth.py" loaded="this-turn" reason="task references auth flow">
    ... contents ...
  </file>
  <retrieval doc="OAuth RFC 6749" relevance=0.91 loaded="this-turn">
    ... excerpt ...
  </retrieval>
</sources>
Body loader pattern·python
def build_body(task):
    body = []
    for path in task.required_files:
        body.append({"kind": "file", "path": path, "text": read(path)})
    for q in task.retrieval_queries:
        for hit in retrieve(q, top_k=3):
            body.append({"kind": "retrieval", "doc": hit.id, "text": hit.text})
    return body

External links

Exercise

Design an annotated body section for a code-review workflow. Include at least one source-file entry and one retrieval entry, both with provenance and reason.
Hint
If the model has to guess where a fact came from, the prompt is missing annotations.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.