Note I · Field notes
File every voice memo as a dated note with Cue
Apple Voice Memos already transcribes on device and hides the text inside the audio file. A small script pulls it out, and a two-step Cue pipeline hands each transcript to any agent Maestro runs, which titles it and files it as a dated note.
The cheapest way to capture a thought is to say it out loud. On an iPhone that can be one gesture: add Voice Memos to the lock screen, long-press, talk, stop. The hard part is the other end. A memo that never becomes text is a memo you never read again.
This post builds the other end. Every hour, Maestro checks for new recordings, pulls out the transcript Apple has already written, and gives it to one of your agents. The agent writes a real title and appends the memo to a dated note. No hand transcription, no cloud speech API, no clicks between the thought and the record.
The pipeline has three parts:
- Apple records and transcribes. iCloud syncs the recording to your Mac.
- A Python script (standard library only) reads the transcript out of the audio file.
- A Cue pipeline runs the script on a timer and, when there is something new, sends it to an agent to file.
The agent step is provider and harness agnostic. Any agent you run in Maestro can do it, on any model source you have connected, because the work is “read a Markdown file, append to another one.”
Where Apple keeps the transcript
On iOS 18 and macOS 15 or later, Voice Memos transcribes each recording on device. You would expect the text in the app’s database at ~/Library/Group Containers/group.com.apple.VoiceMemos.shared/Recordings/CloudRecordings.db. It is not there. That database holds duration, folder, title, playback state and favorites, but no transcript.
The transcript is stored inside the audio file, as a custom MP4 atom named tsrp. The Voice Memos binary shows the write path:
$ strings /System/Applications/VoiceMemos.app/Contents/MacOS/VoiceMemos | grep -i transcript
rc_transcriptionDataForURL:
rc_updateFile:withTranscriptionData:error:
...
Those selectors read and write transcription data keyed by file URL. Under the hood they patch bytes into the MP4 container that holds the audio.
The payload is UTF-8 JSON:
{
"attributedString": {
"string": "Testing my new voice memo pattern...",
"runs": ["Testing", 0, " my", 1, " new", 2, ...]
},
"attributeTable": [
{ "timeRange": { "start": 0.0, "duration": 0.38 } },
...
],
"locale": "en-US"
}
runs alternates token and index. Each index points into attributeTable, which holds a timeRange (start and duration) for each token. It is an NSAttributedString flattened to JSON. The full text sits in attributedString.string, which is all this pipeline needs.
Two containers, one scanner
The first attempt was an MP4 atom-tree walker: descend moov.udta, find tsrp, read the body. It worked on one memo and failed on the next, because Voice Memos writes two container formats into the same folder:
.m4a(older or unedited recordings). The transcript is a directtsrpatom atmoov.udta.tsrp..qta(after you enhance the audio or trim the memo). The transcript is inmoov.meta.ilst, keyed bycom.apple.VoiceMemos.tsrpthrough a QuickTime-stylemdta/keysindirection. There is notsrpatom in the tree at all. The string appears once, in thekeystable, and the JSON lives inilst[1].data.
A walker must handle both layouts. It also hits a second trap: meta boxes in QuickTime-style contexts lack the version and flags prefix that iTunes-style udta.meta boxes have, so naive parsers fail again.
Two walkers is the wrong answer. Every transcript is a JSON object that starts with the same prefix, {"attributedString":. So the scanner searches the raw bytes for that prefix, walks forward with a brace counter that ignores braces inside string literals, and parses the window:
_TRANSCRIPT_SENTINEL = b'{"attributedString":'
def read_native_transcript(audio_path):
data = audio_path.read_bytes()
i = 0
while True:
i = data.find(_TRANSCRIPT_SENTINEL, i)
if i < 0:
return None
depth = 0
in_str = False
escape = False
for j in range(i, len(data)):
b = data[j]
if in_str:
if escape: escape = False
elif b == 0x5C: escape = True
elif b == 0x22: in_str = False
continue
if b == 0x22: in_str = True
elif b == 0x7B: depth += 1
elif b == 0x7D:
depth -= 1
if depth == 0:
try:
return json.loads(data[i:j+1])
except (json.JSONDecodeError, UnicodeDecodeError):
break
i += len(_TRANSCRIPT_SENTINEL)
One code path covers both formats, and any future layout that still embeds the JSON.
The extractor script
Put the scanner in a small script inside the project of the agent that will file your notes. That project can be a folder of Markdown, a docs repo, or a notes app’s vault. Obsidian works well as the destination, but nothing here depends on it.
Save this as scripts/voice_memo_inbox.py, with the scanner above pasted where marked:
#!/usr/bin/env python3
"""Copy new Voice Memos transcripts into ./inbox/voice-memos/ and print what is pending."""
import json
import os
import sys
from datetime import datetime
from pathlib import Path
RECORDINGS = Path(os.environ.get(
"VOICE_MEMOS_DIR",
Path.home() / "Library/Group Containers/group.com.apple.VoiceMemos.shared/Recordings",
))
INBOX = Path("inbox/voice-memos")
LEDGER = INBOX / ".seen"
# ... _TRANSCRIPT_SENTINEL and read_native_transcript() from above ...
def main():
INBOX.mkdir(parents=True, exist_ok=True)
seen = set(LEDGER.read_text().splitlines()) if LEDGER.exists() else set()
new = []
for audio in sorted(RECORDINGS.iterdir()):
if audio.suffix not in (".m4a", ".qta") or audio.name in seen:
continue
doc = read_native_transcript(audio)
if not doc:
continue # not transcribed yet; the next pass retries
recorded = datetime.fromtimestamp(audio.stat().st_birthtime)
text = doc["attributedString"]["string"].strip()
(INBOX / (audio.stem + ".md")).write_text(
"---\nrecorded: %s\naudio: %s\nlocale: %s\n---\n\n%s\n"
% (recorded.isoformat(timespec="minutes"), audio, doc.get("locale", ""), text)
)
new.append(audio.name)
if new:
with LEDGER.open("a") as f:
f.write("".join(name + "\n" for name in new))
pending = sorted(INBOX.glob("*.md"))
for path in pending:
print(path.resolve())
sys.exit(0 if pending else 1) # exit 1 = nothing to file, so the chain stays quiet
if __name__ == "__main__":
main()
The script does three things:
- It writes one inbox file per new transcript, with the recording time, the audio path and the locale in frontmatter.
- It records each processed memo in a ledger (
.seen), so a memo is extracted once. - It prints the absolute path of every file still in the inbox, and exits 1 when the inbox is empty.
A memo that Apple has not transcribed yet is skipped and not added to the ledger. The next pass picks it up. Inbox files that an agent failed to file are printed again on every pass until they are gone.
It runs on the system /usr/bin/python3 (3.9 on current macOS) with no packages to install.
The Cue pipeline
Two subscriptions go in the agent’s .maestro/cue.yaml. The first is a command node on a timer. The second is an agent run that fires only when the command succeeded.
Fig. 1 · The Cue pipeline
A script decides whether the agent runs
flowchart LR
T["time.heartbeat<br/>every 60 min"] --> C["command<br/>voice_memo_inbox.py"]
C -- "exit 0: paths on stdout" --> A["agent.completed<br/>agent titles and files"]
C e1@-. "exit 1: nothing new" .-> X["chain does not fire"]
class C gate
class e1 loop
# Pipeline: Voice Memos (color: #f59e0b)
subscriptions:
- name: Voice Memos
pipeline_name: Voice Memos
label: Pull new transcripts
event: time.heartbeat
interval_minutes: 60
action: command
command:
mode: shell
shell: /usr/bin/python3 scripts/voice_memo_inbox.py
- name: Voice Memos-chain-1
pipeline_name: Voice Memos
label: File transcripts as notes
event: agent.completed
source_session: Notes # this agent's name in the Left Bar
source_sub: Voice Memos
filter:
status: completed
tier: low
prompt: |
New voice memo transcripts are waiting. Each path below is a Markdown
file with the recording time in its frontmatter and the transcript as
its body:
{{CUE_SOURCE_OUTPUT}}
For each file, oldest first:
1. Read it. Write a title of three to six words that names the topic.
Summarize; do not just copy the first words of the transcript.
2. Append to notes/daily/YYYY-MM-DD.md, using the date from `recorded`.
Create the file if it does not exist. Add a heading `## HH:MM Title`,
the transcript text unchanged, and a line `Audio: <audio path>`.
Never rewrite or reorder what is already in the file.
3. Delete the inbox file only after the append succeeded.
How each piece behaves, checked against the Cue docs and source:
time.heartbeatfires when the engine starts, then everyinterval_minutes. If the Mac sleeps through several intervals, Cue fires one catch-up run on wake. That matches how memos arrive: in bursts, synced whenever the phone and Mac are both awake.action: commandwithmode: shellruns through your shell with the agent’s project root as the working directory, so the relativescripts/andinbox/paths resolve inside the project. The command’s stdout becomes{{CUE_SOURCE_OUTPUT}}for the chained run (truncated to 5,000 characters, which is why the script prints paths, not transcripts).agent.completedwithsource_subfires only on completions of that command node, not on every run of the agent. Thefilter: status: completedline is the gate. A command that exits non-zero completes asfailed, so an empty inbox ends the chain and no model is called.tier: lowruns the filing step on a cheaper model. Titling and appending text does not need a frontier model. Cue mapslowto Claude Code’s and Factory Droid’s model ladders. Codex, Copilot-CLI and OpenCode have no tier table: for those, replacetierwith an exactmodel, or drop it. If a provider cannot honor the tier, the run still happens on the agent’s own model and the Cue log records a warning.
To test it without waiting an hour, record a memo, wait for it to sync, and run:
maestro-cli cue trigger "Voice Memos"
maestro-cli cue activity --limit 5
Gotchas
Full Disk Access. macOS protects ~/Library/Group Containers/. The script inherits its permissions from the process that runs it, which is Maestro. If the command fails with Operation not permitted, grant Maestro Full Disk Access in System Settings, Privacy & Security, then restart it. The failed run’s stderr in the Cue Activity Log shows the error.
An idle hour shows as a failed run. The exit-1 gate means each pass with nothing to file appears in the Activity Log as a failed command. That is the gate working, and it costs no tokens. If you would rather not see it, raise interval_minutes.
Apple’s transcription is asynchronous. It usually lands seconds after a save. Sometimes it does not land until you open the memo in the app, or another device in your iCloud account processes it. The hourly pass absorbs this. If you need every memo filed on the first pass, add a local fallback for memos with no transcript: whisperkit-cli (brew install whisperkit-cli) runs Whisper on Apple Silicon, on device, with whisperkit-cli transcribe --audio-path <file>.
.qta files are common. Enhance a recording or trim it, and the file switches from .m4a to .qta and the transcript moves. The scanner handles both. Do not filter on one extension.
Titles are an agent’s job. The first version cut a title from the first N words of the transcript. That often ended on a dangling “the” or “my”, or on a word you would not want in a heading. Summarizing a paragraph into five words is a task models do well, which is why the title moved into the agent step.
The audio stays where it is. The note links to the original recording, and the script never moves or edits it. Searchable text sits next to the raw audio, so you can listen again when tone matters more than words.
Adapting it
The script and the YAML are the fixed parts. The prompt is yours to change. Some variations:
- Different destination. Point step 2 at a single running log, a per-week file, or a folder of one note per memo.
- Routing. Ask the agent to put memos that mention a project into that project’s notes, and the rest into the daily file.
- Follow-ups. Ask the agent to pull out any “remind me to” line and add it to an Auto Run document as a checkbox. See A Maestro-native reminder system for that pattern.
- A different agent. Move the chain subscription to another agent’s
cue.yamland changesource_session. The command node stays with the agent whose project holds the inbox.
The capture side stays one gesture on the lock screen. Apple already ships the transcription engine; this pipeline finds where the output is filed, and Maestro’s agent does the rest.