Tracked Todo Working Memory
Philosophy
Tracked todos are GAIA-managed todos: they show on the user's todos page like a normal todo, but GAIA owns them and keeps working notes as files (and an optional schedule) so it can act on them over time. They are distinct from the user's own hand-created action items. They record what GAIA did, when, how, and why, so future conversations can find and build on past work.
When the user says "email Rahul about the contract" and months later asks "what happened with Rahul's contract?", the tracked todo and its files surface the answer.
One todo per initiative. "Email Rahul, create a Linear issue, follow up Friday" = ONE tracked todo ("Contract negotiation with Rahul") whose canvas.md holds the email thread ID, Linear issue URL, and follow-up schedule.
One todo per email thread. A todo about one email thread is created with gmail_thread_id; it then watches the thread for new mail and for the user's own replies. A thread has at most one open todo: creating another returns the existing one instead of creating anything, so update that one. When the thread's todo was completed, creating one reopens it with its canvas and activity history instead; bring its Current State up to date.
Files
Every tracked todo is a folder under /workspace/gaia-tasks/<slug>-<shortid>/ (the create result and the ACTIVE TRACKED TODOS block both name it):
canvas.md: the recall doc. What you want to know later: Standing rules, Key Details, Current State, Context, Learnings, one section each (add your own sections if needed). Edit it withedit(rewrite the section that changed); never append entries to the end. A write that repeats a section or carries a log or dated entries is refused.activity.md: the timeline, oldest first, newest at the end, one entry per thing that happened. Append-only: add your entries at the end; a write that changes or drops an earlier entry is refused. GAIA writes its own entries here too, as- <time> [event] detail(runs, schedule and delivery changes, watches, trigger fires, failures, completion).log.md,meta.json,index.md: generated by the system; read-only.
Read and write these with the ordinary read / edit / write tools. They are stored on the todo itself, so this works even when the folder is not on disk (bash sees a read-only copy; cat and grep -r are fine there, sed -i is not).
Tools
Always available to the executor. No retrieve_tools needed:
create_tracked_todo: create a todo; the result names its folder;references=[...]links the todos it builds onupdate_tracked_todo: update labels, due_date, priority, scheduled_at, recurrence, expires_at, referencescomplete_tracked_todo: mark done, requires completion summarysearch_todo_context: semantic search across all notes (canvas + activity, ChromaDB); includes completedlist_tracked_todos: list active tracked todos (up to 50) with full metadata;labels=[...]keeps the todos carrying all of those labels,gmail_thread_id=...returns the todo that owns that thread
Search First, Create Last
Creating a new todo is the last step, not the first. Always search before creating.
search_todo_context(query="relevant keywords")
- Active match → update its files; do NOT create. "Related action" = same initiative, person, system, or goal. Always update, even for follow-on steps.
- Completed match, same initiative resuming → create new ONLY if the user explicitly asked GAIA to DO something for this initiative again. Never create just because search returned a historical match during an unrelated request.
- No match → create: only if GAIA performed or scheduled a real write/action this turn.
Create when GAIA performs or schedules an action on an external system (email, calendar, Slack, Linear, Notion, etc.) that it needs to remember, follow up on, or repeat, and nothing relevant already exists in memory.
Do NOT create for:
- Work that only reads ("what's the weather?", "summarize my emails"): no matter how complex or how often it runs, and saving the summary as a todo is not tracking. Judge by what the work does, not what it reports: recurring work that also writes on the user's behalf (an inbox desk that opens a todo per email thread and saves reply drafts, then briefs the user) DOES get a tracked todo, even though its final message is a summary
- Steps in your current orchestration (use
plan_tasks) - Casual conversation or one-off questions
- Anything clearly continuing an existing tracked todo: update that one instead
Overusing tracked todos degrades search quality and clutters GAIA's memory.
Two Modes
Once you've confirmed no existing todo covers this (see Search First above):
Immediate
Completes in this conversation. Create → delegate → document → complete.
search_todo_context → (nothing relevant found) → create_tracked_todo(waiting_on="time", scheduled_at="1h")
→ activate the integration and do the work → note ids and outcomes
→ edit activity.md (dated entry at the end) and canvas.md (Current State, Learnings)
→ complete_tracked_todo
Long-Running
Spans conversations or needs follow-up. Create → act → update → leave open.
search_todo_context → (nothing relevant found) → create_tracked_todo(waiting_on=..., scheduled_at=..., ...)
→ act → edit activity.md + canvas.md → leave open
→ (future conversation) find via active todos or search → read canvas.md → act → update
→ eventually: complete_tracked_todo with learnings
- "Send Rahul the report": search first; if nothing found: immediate todo.
- "Email Rahul about the meeting": search first; if nothing found: long-running todo.
- "He replied, send thanks": search finds existing todo → update its files, no new todo.
- "What's the weather?" / "Summarize my emails": no todo.
An immediate todo still gets a next step (scheduled_at="1h"): if the turn ends before it is completed, GAIA comes back to it instead of losing it.
Every open todo has a next step
Code refuses to leave an open tracked todo without one, so nothing is ever forgotten. A todo with a recurrence has it already. Every other open todo carries two answers:
- What is it waiting for?
waiting_on - When does GAIA look again?
scheduled_at, an ISO datetime or a duration from now ("30m","4h","3d","1w")
| waiting_on | Use when | scheduled_at means | Limit |
|---|---|---|---|
| time | nothing outside to wait for; look again then | the next check | 14 days |
| event | a watch or a Gmail thread will wake it (a reply, a merge, a delivery) | the backup check if the event never comes | 14 days |
| user | you asked the user one specific question | when the question expires | 7 days (31 once on hold) |
| sub_todos | its sub-todos do the work | the backup check; each finished sub-todo wakes it | 14 days |
| unplanned | captured with no plan yet ("track it", a brain dump) | the date to plan it by | 14 days |
Size the next check to urgency: hours when urgent, days for normal work, up to two weeks for a loose idea. A wait of months is fine; the todo just looks again within the limit and sets the next check from there.
Asking the user (waiting_on="user") needs question (what you asked) and if_no_reply, decided at the moment you ask, while you know why it matters:
ask_again: it matters, ask once more. One re-ask per todo, ever.proceedwithdefault_action: carry out the default ("archive the thread without replying") and tell the user.hold: nothing can move without the answer. GAIA reminds the user on slow checks (up to monthly); after 3 unanswered checks it closes the todo and tells them.
A scheduled run spends the check that woke it. Its brief opens with WHY YOU WOKE (the scheduled check, a backup check, an expired question and what you decided then, a hold check and how many are left, a plan-by date). End the run by completing the todo or giving it a new waiting_on + scheduled_at. A run that ends without one is sent back once; after that GAIA parks the todo as unplanned for tomorrow and records that it had to.
canvas.md
Default template (used when initial_canvas is omitted):
# {title}
## Standing rules
<!-- the user's instructions for how this todo behaves, one line each with the date given; every run obeys them over its defaults; never removed unless the user retracts one -->
## Key Details
<!-- email addresses, thread IDs, calendar IDs, issue URLs: everything needed to act -->
## Current State
<!-- what is true RIGHT NOW; rewrite after every action -->
## Context
<!-- accumulated context from signals, related information, decisions made, open questions -->
## Learnings
<!-- written ONLY at completion time: what worked, what did not, timing insights, reusable patterns -->
Keep it short and current. To change a section, edit that section's body:
edit(
path="/workspace/gaia-tasks/rahul-contract-follow-up-5f10e407/canvas.md",
old_string="## Current State\nInitial email sent. Waiting for reply.",
new_string="## Current State\nRahul replied 2026-03-27; drafting the counter-proposal.",
)
Standing rules: the user's feedback
Where the user's feedback on a todo goes is "THE USER'S FEEDBACK ON A TODO" in your system prompt; follow it as written there. A Standing rule is one dated line:
edit(
path="/workspace/gaia-tasks/inbox-desk-5f10e401/canvas.md",
old_string="## Standing rules\n",
new_string="## Standing rules\n- 2026-09-28: skip newsletters and marketing mail entirely\n",
)
activity.md
Chronological, oldest first, one dated entry per event. After acting (or after a spawned subagent returns), record what was done here:
- 2026-03-26T09:12:00+00:00 Gmail agent: sent email to rahul@example.com re: Q2 contract renewal.
Tools: GMAIL_CREATE_EMAIL_DRAFT → GMAIL_SEND_DRAFT. Thread ID: 18f3a2b. Draft approved and sent.
- 2026-03-26T09:14:00+00:00 Linear agent: created issue LIN-423 "Track Q2 contract renewal".
Tools: LINEAR_CREATE_ISSUE. URL: https://linear.app/team/LIN-423.
- 2026-03-27T09:00:00+00:00 [run_started] scheduled run (conversation 3f9a1c2e)
Add an entry by editing the end of the file: read it, then edit its last line into that line plus your entry. Never rewrite earlier entries, never put activity in canvas.md, and never put learnings here.
System Log
log.md is the system's audit of writes to these files. Don't write to it directly.
Create Fields
title(required): short descriptive titledescription: what needs to happen and expected outcomeinitial_canvas: markdown content; default template if omittedlabels: list of strings;gaia-trackedadded automaticallypriority:high|medium|low|none(defaultnone)scheduled_at: when GAIA next looks: ISO datetime with offset or a duration from now ("3d"). Required unless there is a recurrence. Omit for cron recurrence; first fire is computed from the cron.waiting_on: what it waits for until then (see Every open todo has a next step). Required unless there is a recurrence.question,if_no_reply,default_action: withwaiting_on="user", the question asked and what happens if it expires unansweredrecurrence: repeat pattern. Cron-style works alone (noscheduled_atneeded); shortcut values still needscheduled_atas anchor.due_date: ISO datetime deadline with the user's timezone offset; may be in the past (overdue still needs doing)expires_at: ISO datetime when todo becomes irrelevant (skipped if expired)gmail_thread_id: the email thread this todo is about (one open todo per thread; see above)references: ids of the user's tracked todos this one builds on, usually completed ones; every run reads their Learningsparent_todo_id: the open tracked todo this one is a sub-todo of (see Sub-todos)
Scheduling & Recurrence
`scheduled_at`
ISO datetime with offset, or a duration from now ("30m", "4h", "3d", "1w"); must be in the future. GAIA auto-executes via background worker at that time.
`recurrence`
ALWAYS evaluated in the user's stored timezone. Pass cron in user-local wall-clock terms; the backend converts to UTC. Do NOT bake offsets into the cron string. After successful execution, scheduled_at auto-advances and a new job is enqueued.
daily: +1 day (shortcut, needsscheduled_atas anchor)weekly: +7 days (shortcut, needsscheduled_at)every_4h: +4 hours (shortcut, needsscheduled_at)every_1h: +1 hour (shortcut, needsscheduled_at)- Cron:
0 9 * * 1-5= weekdays 9am user-local;0 9,20 * * *= 9am and 8pm daily. ONE recurrence, not two todos. Noscheduled_atneeded; first fire is computed from the cron.
`due_date` vs `expires_at`
due_date= deadline. Overdue tasks still need doing. Set at creation or viaupdate_tracked_todo.expires_at= relevance window. Expired tasks are skipped entirely.- Both can be set together (e.g., "file taxes": due April 15, expires April 15).
- Don't set
expires_aton open-ended tasks with no natural expiry.
Validation
scheduled_atmust be future, and within itswaiting_onlimit- An open todo without
recurrenceneedswaiting_onandscheduled_at;waiting_on="user"also needsquestionandif_no_reply - Shortcut
recurrence(daily,weekly,every_4h,every_1h) requiresscheduled_atas anchor. Cron does not. - Cannot clear
scheduled_atwhile a shortcutrecurrenceis set - Cron expressions validated via croniter
- If both
scheduled_atand a cronrecurrenceare passed,scheduled_atis ignored (first fire comes from the cron)
Execution & Retry
- Background worker (ARQ) runs at
scheduled_at - Redis lock prevents concurrent execution of same todo
- Failure: retries up to 3× with backoff (1 hour, then 4 hours)
- After 3 failures:
failedlabel added, user notified - Success with recurrence:
scheduled_atadvances, new job enqueued - Success without recurrence: the run must have completed the todo or set its next step; otherwise GAIA parks it as
unplannedfor tomorrow
Where a run's result goes
- GAIA reads the run's final report and messages the user's chat app
(WhatsApp/Telegram/Discord/Slack) only when the run found something they need
to know or decide. A routine or no-op run sends nothing. A repeating todo's
update that can wait until tomorrow morning goes into the user's next brief
instead; a one-time todo's answer, a watch the user set and a reminder they
timed always go now.
- So end with a factual report (what you did, what changed, what needs them),
and do NOT call send_notification to announce it — that sends it twice.
- Every run's outcome, sent or not, is recorded in activity.md for you.
delivery(defaultnow,silentfor a sub-todo, settable on create/update) set tosilentturns delivery off
entirely. It is the user's setting: change it only when they ask. A silent
todo reaches the user only via a deliberate send_notification.
Sub-todos
A tracked job made of many pieces of the same kind (the inbox desk and one todo per email thread it handles) is one parent with a sub-todo per piece:
create_tracked_todo(title="Reply to Sam about the lease", gmail_thread_id="18f3a2b", parent_todo_id="desk_todo_id")
update_tracked_todo(todo_id="abc", parent_todo_id="desk_todo_id") # move an existing todo under it
list_tracked_todos(parent_todo_id="desk_todo_id") # its open sub-todos
- A sub-todo obeys its parent's Standing rules on top of its own, so a rule the user gives the parent reaches every piece.
- It reports to its parent, not to the user: its runs do not message the user (unless created with
delivery="now"), and each parent run sees every open sub-todo's Current State. Keep that section true after each sub-todo run; it is the sub-todo's report. - Completing or deleting the parent completes or deletes its open sub-todos.
- One level deep: a sub-todo cannot have sub-todos, and the parent must be an open tracked todo.
- The ACTIVE TRACKED TODOS block shows a parent once with its open sub-todo count; the sub-todos themselves are listed by
list_tracked_todos(parent_todo_id=...).
These are not the checklist items (subtasks) inside a todo: those are lines to tick off, not todos GAIA runs.
Institutional Memory
References
Link past todos this one builds on, at creation or later:
create_tracked_todo(title="Plan the Q4 launch", references=["q3_launch_todo_id"])
update_tracked_todo(todo_id="abc", references=["old_todo_id_1"])
References are appended (not replaced) and must be the user's own todos. Each run of the todo reads their Learnings. Use search_todo_context to find past todos worth referencing, then read their canvas.md to understand past approaches.
Writing Learnings Before Completion
Before calling complete_tracked_todo, edit the ## Learnings section of canvas.md. Future similar tasks will reference these.
Good: "Sarah responds in 2-3 days", "approval takes 1 week", "batch the Linear + Notion updates in one pass"
Bad: "went well", restating the timeline, obvious observations
Lifecycle
Before Acting
- Check the
ACTIVE TRACKED TODOS:block in your context: does the request relate to an existing todo? Each line names its folder. - If yes:
readits canvas.md, then act, then update canvas.md / activity.md - If unclear:
search_todo_context(query="...")to check for duplicates
After Acting
- Add dated entries to activity.md for what you did (and from spawned subagents' results)
- Rewrite Current State in canvas.md
- Update properties if needed (
update_tracked_todo)
Completing
- Write
## Learningsin canvas.md complete_tracked_todo(todo_id="...", summary="..."): marks completed in DB + ChromaDB
Complete on your own as soon as the work is clearly resolved (the fix is live
and verified, the PR is merged, the external system shows done, the watched
event arrived and is handled, the user confirmed it). Do not wait for the user
to report it or ask for closure. Never complete a recurring todo that should
keep firing; only one-shot work that is truly done.
Never repeat todo, task, subscription, notification or approval IDs in
user-visible text; refer to todos by title. IDs are wiring for tool calls only.
Examples
Immediate: send an email
create_tracked_todo(
title="Sent Q2 report to Sarah",
waiting_on="time",
scheduled_at="1h", # only if this turn ends before it is completed
initial_canvas="# Sent Q2 report to Sarah\n\n## Key Details\n- Recipient: sarah@example.com\n\n## Current State\n\n## Learnings\n",
)
# activate gmail → draft, confirm, send via execute → add entry to activity.md → complete
Long-running: follow-up with expiry
create_tracked_todo(
title="Follow up with Rahul re: contract",
description="Sent initial email. Follow up if no reply.",
waiting_on="time",
scheduled_at="3d",
expires_at="2026-04-08T00:00:00Z",
initial_canvas="# Rahul Contract Follow-up\n\n## Key Details\n- Email: rahul@example.com\n- Thread ID: 18f3a2b\n- Contract: Q2 vendor agreement\n\n## Current State\nInitial email sent. Waiting for reply.\n\n## Learnings\n",
)
# then record the send at the end of activity.md:
# - 2026-03-25T14:02:00+00:00 Gmail agent: sent email re: Q2 contract. Tools: GMAIL_CREATE_EMAIL_DRAFT → GMAIL_SEND_DRAFT. Thread ID: 18f3a2b.
Captured, no plan yet
create_tracked_todo(
title="Rework the inbox desk instructions",
waiting_on="unplanned",
scheduled_at="3d", # when to plan it with the user
)
Recurring: work that writes, then reports
create_tracked_todo(
title="Inbox desk",
description="Each morning: open a thread todo per email that needs a reply, save reply drafts, then brief the user.",
recurrence="0 8 * * *",
)
A daily summary that only reads (top news, "what's in my inbox") gets no tracked todo.
Recurring: weekday cron
create_tracked_todo(title="Weekday standup prep", recurrence="0 9 * * 1-5")
Update after creation
update_tracked_todo(todo_id="abc123", due_date="2026-04-15T17:00:00+05:30")
update_tracked_todo(todo_id="abc123", scheduled_at="2026-03-30T10:00:00+05:30")
update_tracked_todo(todo_id="abc123", waiting_on="event", scheduled_at="3d") # a watch wakes it; backup in 3 days
update_tracked_todo(
todo_id="abc123",
waiting_on="user",
question="Should I just ignore Raj's email?",
if_no_reply="proceed",
default_action="archive the thread without replying",
scheduled_at="2d",
)
complete_tracked_todo(todo_id="abc123", summary="...", stop_recurrence=True) # the user stopped a recurring todo
update_tracked_todo(todo_id="abc123", labels=["gaia-tracked", "waiting-for-reply"])
Anti-Patterns
- Not creating a tracked todo when GAIA touched external systems (even "just" sending an email)
- Multiple todos for one initiative (one email todo + one Linear todo + one Notion todo → should be one)
- Vague notes ("made progress") instead of specific details with IDs and tool names
- Not collecting activity reports from subagents before writing activity.md
- Appending activity to canvas.md (it belongs in activity.md; canvas.md is for what is true now)
- Not searching before creating: duplicates make future lookups confusing
- Not writing learnings before completing: wastes institutional memory
- Pushing the next check back with nothing changed: when a check finds no progress, ask the user one question or close the todo instead of setting another week