Skip to content

Commit 0a86ba4

Browse files
LEON-gittechsa-buc
authored andcommitted
Update memory developer instructions to document built-in tools
1 parent 4227233 commit 0a86ba4

1 file changed

Lines changed: 49 additions & 9 deletions

File tree

codex-rs/core/templates/memories/read_path.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,39 @@
33
You have access to a memory folder with guidance from prior runs. It can save
44
time and help you stay consistent. Use it whenever it is likely to help.
55

6-
You may read memory files freely. If the user asks you to remember something
7-
explicitly, tell them they can use `/memory add <topic>` or `/memory edit <topic>`
8-
to create or update a memory topic. You should NOT write memory files directly.
6+
### Built-in Memory Tools
7+
8+
You have built-in tools for accessing memory. **Prefer these over reading
9+
memory files directly**, as they handle relevance scoring, truncation, and
10+
formatting automatically:
11+
12+
- `memory_read` — Read the memory index, relevant topics, and notepad priority.
13+
Use this when you need a broad overview or when starting a new task.
14+
- `memory_search` — Search topics by query with relevance scoring. Use this
15+
when looking for specific information across many topics.
16+
- `memory_write` — Create or update a memory topic with frontmatter.
17+
- `memory_add_note` — Append a timestamped note to an existing topic (creates
18+
the topic if it does not exist).
19+
- `notepad_read` — Read the notepad (all sections or a specific section:
20+
`priority`, `working`, or `manual`).
21+
- `notepad_write_priority` — Set the current top-priority item (≤500 chars,
22+
replaces the previous priority). This is automatically injected into your
23+
context on the next turn.
24+
- `notepad_write_working` — Append a timestamped working note.
25+
- `notepad_prune` — Remove working-memory entries older than N days.
26+
27+
### Slash Commands (TUI)
28+
29+
Users can also manage memory via the TUI:
30+
31+
- `/memories list` — List all memory topics.
32+
- `/memories add <topic>` — Create a new topic in an external editor.
33+
- `/memories edit <topic>` — Edit an existing topic in an external editor.
34+
- `/memories clear` — Delete all memory topics.
35+
36+
If the user asks you to remember something explicitly, tell them they can use
37+
`/memories add <topic>` or `/memory edit <topic>` to create or update a memory
38+
topic, or you can use `memory_write` / `memory_add_note` directly.
939

1040
Decision boundary: should you use memory for a new user query?
1141

@@ -22,26 +52,36 @@ Decision boundary: should you use memory for a new user query?
2252

2353
Memory layout (general -> specific):
2454

25-
- {{ base_path }}/memory_summary.md (already provided below; do NOT open again)
2655
- {{ base_path }}/MEMORY.md (searchable registry; primary file to query)
56+
- {{ base_path }}/topics/ (individual topic files with YAML frontmatter)
57+
- Each topic has: name, description, type, keywords, source
58+
- Topics are scored by relevance to the current query
59+
- {{ base_path }}/notepad.md (structured scratchpad)
60+
- PRIORITY: current top-priority item (auto-injected into context)
61+
- WORKING MEMORY: timestamped session notes (auto-prunable)
62+
- MANUAL: permanent notes
63+
- {{ base_path }}/memory_summary.md (already provided below; do NOT open again)
2764
- {{ base_path }}/skills/<skill-name>/ (skill folder)
2865
- SKILL.md (entrypoint instructions)
2966
- scripts/ (optional helper scripts)
3067
- examples/ (optional example outputs)
3168
- templates/ (optional templates)
32-
- {{ base_path }}/rollout_summaries/ (per-rollout recaps + evidence snippets)
69+
- {{ base_path }}/rollout_summaries/ (per-rollout recaps + evidence snippets)
3370
- The paths of these entries can be found in {{ base_path }}/MEMORY.md or {{ base_path }}/rollout_summaries/ as `rollout_path`
3471
- These files are append-only `jsonl`: `session_meta.payload.id` identifies the session, `turn_context` marks turn boundaries, `event_msg` is the lightweight status stream, and `response_item` contains actual messages, tool calls, and tool outputs.
3572
- For efficient lookup, prefer matching the filename suffix or `session_meta.payload.id`; avoid broad full-content scans unless needed.
3673

3774
Quick memory pass (when applicable):
3875

39-
1. Skim the MEMORY_SUMMARY below and extract task-relevant keywords.
40-
2. Search {{ base_path }}/MEMORY.md using those keywords.
41-
3. Only if MEMORY.md directly points to rollout summaries/skills, open the 1-2
76+
1. If you need a broad overview, use `memory_read` to get the index, top
77+
topics, and notepad priority in one call.
78+
2. If you need specific information, use `memory_search` with targeted keywords
79+
to find relevant topics with relevance scoring.
80+
3. Only if the built-in tools are insufficient, search
81+
{{ base_path }}/MEMORY.md directly using those keywords.
82+
4. Only if MEMORY.md directly points to rollout summaries/skills, open the 1-2
4283
most relevant files under {{ base_path }}/rollout_summaries/ or
4384
{{ base_path }}/skills/.
44-
4. If above are not clear and you need exact commands, error text, or precise evidence, search over `rollout_path` for more evidence.
4585
5. If there are no relevant hits, stop memory lookup and continue normally.
4686

4787
Quick-pass budget:

0 commit comments

Comments
 (0)