Skip to content

API Reference parrot_tools.audio_note_capture

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.audio_note_capture

View source

AudioNoteCaptureToolkit — structure and persist audio/text notes.

Captures a raw transcript (voice-transcribed or typed), structures it via a single LLM call into title / tags / summary / key-points / action-items, writes it as a frontmattered Obsidian note, and best-effort ingests it into a wiki plane.

Originally built as an agent-local toolkit inside agents/fireflies_wiki.py (FEAT-452, Module 3). Extracted into ai-parrot-tools so any agent that has an ObsidianToolkit and (optionally) a wiki plane can reuse the capture path via post_configure.

Example — wiring into an existing agent::

from parrot_tools.audio_note_capture import AudioNoteCaptureToolkit

class MyAgent(Agent):
    async def post_configure(self) -> None:
        await super().post_configure()
        capture = AudioNoteCaptureToolkit(
            obsidian_toolkit=self.obsidian_toolkit,
            notes_wiki_provider=lambda: self._notes_wiki,
            llm_call=self.client.complete,
            vault_path=self.vault_path,
        )
        tools = self.tool_manager.register_toolkit(capture)
        self.tools.extend(tools)

Class AudioNoteCaptureToolkit

Single-purpose toolkit exposing exactly one tool: capture_audio_note.

Holds references to collaborators (Obsidian vault, wiki, LLM) because a bare @tool function cannot close over agent state. AbstractToolkit converts every public async method into a tool, so this class exposes exactly one — every helper is underscore-prefixed.

Wire it into any agent that already has an ObsidianToolkit via :meth:~parrot.bots.abstract.AbstractBot.post_configure::

async def post_configure(self) -> None:
    await super().post_configure()
    capture = AudioNoteCaptureToolkit(
        obsidian_toolkit=self.obsidian_toolkit,
        notes_wiki_provider=lambda: self._notes_wiki,
        llm_call=self.client.complete,
        vault_path=self.vault_path,
    )
    tools = self.tool_manager.register_toolkit(capture)
    self.tools.extend(tools)
Parameter Type Default Description
obsidian_toolkit Any The agent's ObsidianToolkit — create_note must be in its allowed_operations.
notes_wiki_provider Callable[[], Optional[Any]] Zero-arg callable returning the agent's wiki toolkit (None when unavailable). A callable rather than the instance itself, so the tool always observes the latest value.
llm_call Callable[[str], Awaitable[str]] Single-prompt callable routed through the agent's configured AbstractClient.
vault_path Path The agent's Obsidian vault root.
notes_folder str 'audio-notes' Vault subfolder for captures (default "audio-notes").
wiki_name str 'notes' Target wiki identifier for ingest_source (default "notes").

Method AudioNoteCaptureToolkit.capture_audio_note

Save a note as a structured Obsidian note and wiki page.

Call this when the user is recording something to REMEMBER (a note, idea, decision, reminder or follow-up) rather than asking a question.

Transport-neutral: the text may come from a transcribed voice note OR from a typed message — voice is only the vehicle. language is the transcript's detected language for voice input, and None for typed input.

capture_audio_note(transcript: str, language: Optional[str] = None) -> Dict[str, Any]

Parameter Type Default Description
transcript str The raw note text (transcribed or typed).
language Optional[str] None ISO 639-1 language code for voice input, or None for typed input.

Returns: Dict[str, Any] — class:AudioNoteResult, as a dict: note_title, vault_path, wiki_ingested, wiki_reason, structured.

Class AudioNoteResult

Return value of :meth:AudioNoteCaptureToolkit.capture_audio_note.

Fields:

Field Type Default Description
note_title str 'YYYY-MM-DD-slug'
vault_path str 'audio-notes/YYYY-MM-DD-slug.md'
wiki_ingested bool
wiki_reason Optional[str] None Populated when wiki_ingested is False
structured bool False when the verbatim fallback path was used

Class AudioNoteStructure

LLM-structured form of a raw voice/text transcript.

title and tags are always English. summary, key_points and action_items are in the transcript's source language.

Fields:

Field Type Default Description
title str English title, used for the slug
tags List[str] English OKF/frontmatter tags
summary str Summary, source language
key_points List[str] Key points, source language
action_items List[str] Action items, source language; may be empty

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally