Skip to main content

Project memory

Persistent, file-backed knowledge that survives context compaction and session restarts.

Give an agent a memory folder

Declare a context section with the memory_index builtin:

app.yaml
context:
sections:
- id: project_memory
builtin: memory_index
when: session.workdir
priority: 45

Every turn, the runtime reads .digitorn/memory/ under the session workdir, injects its contents as a <system-reminder>, and appends a directive telling the agent to write durable facts back into that folder. The agent builds its own knowledge base across sessions.

when: session.workdir matters: the folder is resolved relative to the session workspace, so the section only activates once a workdir is set.

Context builtins

memory_index is one of the builtins accepted by context.sections[].builtin:

BuiltinInjects
datetime / dateCurrent date and time
userCalling user identity
sessionSession metadata (workdir, ids)
identityApp / agent identity
environment / envEnvironment values
code_indexRepository map of the workdir
memory_index.digitorn/memory/ + the file-memory write directive

Other places durable knowledge lives

MechanismWhen to use
memory_index (above)Facts the agent discovers and writes itself.
agents[].system_promptShort standing rules, fixed at author time.
context: sectionsPer-turn injected blocks (custom text, folders).
dev.skillsLonger playbooks invoked as slash commands.
Cognitive memory moduleIn-session goal / tasks / facts (remember, set_goal).

Example combining author-time rules with agent-written memory:

app.yaml
context:
sections:
- id: project_memory
builtin: memory_index
when: session.workdir
priority: 45

agents:
- id: assistant
role: assistant
system_prompt: |
Project conventions:
- Prefer go test ./... over ad-hoc scripts.
- Do not commit secrets.