{"slug": "context-rules-and-memory", "title": "Build context, rules, examples and visible memory", "summary": "Separate temporary context, retrieved evidence, durable reviewed memory and model fine-tuning, then express reusable teaching as inspectable files.", "audience": "Teachers preparing agent files and maintainers reviewing what an agent may remember.", "version": "1.0.0", "reviewed_on": "2026-10-03", "author": "Finn Andre Hotvedt", "assistance": "Developed with assistance from ChatGPT and Codex by OpenAI.", "lesson_ids": ["TTC-108", "TTC-109", "TTC-110", "TTC-111", "TTC-112"], "sections": [{"title": "Keep four mechanisms distinct", "paragraphs": ["Context is the material available during one run. Retrieval selects relevant passages from an approved collection. Visible memory is durable, reviewable project material. Fine-tuning changes model behavior through training and is not what this classroom claims to do.", "A useful agent can be taught without changing model weights. Clear files, bounded retrieval, examples, tests and explicit approval often provide a more inspectable first step."], "checklist": [], "copyable": ""}, {"title": "Use a small portable file contract", "paragraphs": ["AGENTS.md states purpose, scope, working rules and stop conditions. Structured YAML stores narrowly defined reusable rules. Teacher notes preserve grounded explanations. Examples demonstrate desired and rejected behavior. Every file should have a clear owner and revision history.", "Do not hide the entire operating method in one long prompt. Split stable policy from changing knowledge and task-specific context so each part can be reviewed and replaced independently."], "checklist": ["Keep instructions separate from untrusted source text.", "Record the source and reason for every durable rule.", "Use examples that include boundaries and counterexamples.", "Retire superseded files instead of silently overwriting history."], "copyable": "# Agent purpose\n<what this agent helps with>\n\n# Allowed evidence\n<named files or collections>\n\n# Rules\n<short, testable instructions>\n\n# Stop and ask\n<uncertainty, conflict, permission or consequence triggers>"}, {"title": "Turn corrections into reviewed memory", "paragraphs": ["When a teacher corrects an answer, retain the exact explanation and a grounded interpretation. A proposed reusable rule remains a draft until a person approves it. Approval makes the rule available to the agent; it does not publish or execute anything.", "Memory should reduce repeated clarification without erasing uncertainty. If two approved sources conflict, preserve both and ask the named decision owner."], "checklist": [], "copyable": ""}], "canonical_url": "https://teachthecompany.com/manuals/context-rules-and-memory/", "public_manuals_repository": "https://gitlab.finnandre.no/finnandrehotvedt/teach-the-company-public-manuals", "repository_scope": "Dedicated public manuals and version history; complete application source is linked from the self-host page.", "license": "Apache-2.0"}