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:
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:
| Builtin | Injects |
|---|---|
datetime / date | Current date and time |
user | Calling user identity |
session | Session metadata (workdir, ids) |
identity | App / agent identity |
environment / env | Environment values |
code_index | Repository map of the workdir |
memory_index | .digitorn/memory/ + the file-memory write directive |
Other places durable knowledge lives
| Mechanism | When to use |
|---|---|
memory_index (above) | Facts the agent discovers and writes itself. |
agents[].system_prompt | Short standing rules, fixed at author time. |
context: sections | Per-turn injected blocks (custom text, folders). |
dev.skills | Longer playbooks invoked as slash commands. |
Cognitive memory module | In-session goal / tasks / facts (remember, set_goal). |
Example combining author-time rules with agent-written memory:
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.