Speech notes
Save text notes directly or transcribe audio before saving it through a child call. Prepare the SDK and CLI from the repository root:
Capabilities
| Capability | Kind | Signature | Module | Summary |
|---|---|---|---|---|
read_note | traversal | (session_id: str) -> dict | examples/python/speech_notes/agent.py | |
save_note | traversal | (session_id: str, text: str) -> dict | examples/python/speech_notes/agent.py | |
transcribe_and_save | traversal | (session_id: str, audio_b64: str, format: str = 'webm') -> dict | examples/python/speech_notes/agent.py | |
voice | traversal | (session_id: str, audio_b64: str, transport: str = 'websocket') -> dict | examples/python/speech_notes/agent.py | PCM16 mono 24 kHz input over the worker's realtime transport. |
Commands
atfg server start
cargo build --bin atfgraphd --bin atfg
python -m atfgraph.worker --module examples.python.speech_notes.agent:app
python -m examples.python.speech_notes.call read_note '{"session_id":"notes-a"}' --session notes-a
python -m examples.python.speech_notes.call save_note '{"session_id":"notes-a","text":"Pack passports"}' --session notes-a
python -m examples.python.speech_notes.web
python -m pip install -e ./python
python -m pip install aiohttp
Files
examples/python/speech_notes/README.mdexamples/python/speech_notes/__init__.pyexamples/python/speech_notes/agent.pyexamples/python/speech_notes/agentnode.yamlexamples/python/speech_notes/call.pyexamples/python/speech_notes/requirements.txtexamples/python/speech_notes/web/index.htmlexamples/python/speech_notes/web.py
README
Save text notes directly or transcribe audio before saving it through a child call. Prepare the SDK and CLI from the repository root:
python -m pip install -e ./python
cargo build --bin atfgraphd --bin atfg
export PATH="$PWD/target/debug:$PATH"
atfg server start
Connect to the default server at http://127.0.0.1:18880, or configure its URL/key. The Console is served under /ui/.
First try persistent text notes without a model:
python -m atfgraph.worker --module examples.python.speech_notes.agent:app
# Another terminal:
python -m examples.python.speech_notes.call save_note '{"session_id":"notes-a","text":"Pack passports"}' --session notes-a
python -m examples.python.speech_notes.call read_note '{"session_id":"notes-a"}' --session notes-a
For browser dictation, configure OPENAI_API_KEY and optional TRANSCRIPTION_MODEL (default whisper-1) on the worker before startup. Then start the local bridge:
python -m pip install aiohttp
python -m examples.python.speech_notes.web
Open http://127.0.0.1:8041/, allow microphone access, record, then select Stop and save. The bridge calls transcribe_and_save, which invokes the recorded save_note child. Reuse the session name to retrieve notes. Graph/provider credentials remain on the bridge/worker. The loopback bridge has no public-service user authentication.
Browser dictation records WebM/Ogg/M4A and transcribes after recording stops. For realtime worker sessions, invoke speech-notes.voice with a session ID, base64 PCM16 mono 24 kHz audio, and WebSocket or WebRTC transport; WebRTC needs aiortc. Set REALTIME_MODEL as required. The worker transcribes and saves through the same child capability. Local tests use provider fixtures; validate microphone behavior and live endpoint compatibility separately.