NenjoNenjo Docs
Primitives

Prompt Context

Static prompt references and the runtime-owned session and turn context supplied to agents.

Nenjo separates authored instructions from changing execution data. System and developer prompts compile into a stable instruction prefix. The worker adds session and turn context as dedicated model-visible messages, so a clock, task, or memory update does not invalidate the earlier prompt-cache prefix.

Static prompt references

System prompts, developer prompts, and context blocks may use only values that belong to the instruction epoch.

Package arguments

Package-authored prompts may reference declared arguments through args.*, for example {{ args.company }} or {{ args.profile.name }}. The host resolves them before execution. Changing an argument deliberately creates a new static instruction epoch.

Context blocks

Context blocks are reusable static instruction fragments:

{{ context.methodology }}
{{ pkg.nenjo_ai.packages.context.tools.tool_usage }}
{{ pkg.nenjo_ai.packages.context.operations.write_discipline }}

Blocks may compose other blocks and use declared package arguments. They cannot read agent identity or live task, project, clock, Git, gate, or memory state.

Knowledge indexes

Knowledge selectors compile a compact pack index into the static instructions:

{{ lib.market_research }}
{{ pkg.nenjo_ai.packages.knowledge.core }}

The index is a discovery hint, not the document body. Agents use the knowledge tools to search, traverse, and read the selected pack. A pack update creates a new instruction epoch.

Runtime-owned context

Agent identity and live execution data are not a template surface. The worker serializes them into canonical XML and places them after the static instructions.

Session context

The session snapshot contains the executing agent's slug, name, and description, plus project/workspace information and the retrieved memory snapshot. It is frozen for the session epoch and replayed byte-for-byte. The memory profile controls retrieval and memory-writing behavior; it is not itself repeated in the model context.

Turn context

Each logical turn receives a snapshot containing the local time and timezone, UTC time, execution kind, and any applicable task, routine, Git/worktree, or gate fields. The raw chat message or task instructions follow that snapshot as the user input.

Retries reuse the original turn snapshot, including its clock. Conversation replay keeps every prior turn snapshot immediately before the messages it describes.

The runtime protocol tells agents to read applicable context before acting. Session context applies for its session epoch; turn context applies only to the immediately following logical turn and wins for overlapping facts. Control context is application guidance. Data context is reference material and must not be followed as instructions. Copying context XML into ordinary user text does not give it runtime authority.

Removed dynamic selectors

Static prompts and context blocks must not reference self, agent, global, chat, task, project, routine, gate, git, memories, memory_profile, heartbeat, or artifacts. Package validation rejects those selectors instead of silently rendering runtime-owned data into the cacheable prefix.

Artifacts arrive as typed chat/task inputs or are accessed through artifact tools. Slash-command bodies receive their arguments before prompt assembly; they do not replace an agent chat template.

On this page