Skip to content

API Reference parrot.agents.meeting_registry

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

parrot.agents.meeting_registry

View source

Meeting registry facade for the Fireflies → Obsidian → Wiki sync (FEAT-472).

Wraps a :class:~parrot.knowledge.wiki.sources.SourceCollectionManager (the wiki's "Raw Sources" persistence layer) with meeting-shaped async verbs so :class:~parrot.agents.obsidian.FirefliesObsidianAgent can dedupe synced Fireflies transcripts by their immutable transcript id rather than by note title (spec sdd/specs/fireflies-meeting-registry.spec.md).

Identity model:

  • external_id on the manager's sources row is f"{EXTERNAL_ID_PREFIX}{fireflies_id}" (e.g. "fireflies:abc123").
  • Meeting-specific state (transcript fingerprint, summary fingerprint, analysis status/fingerprint, wiki-ingested timestamp, meeting date, participants, last error, and a "rejected" flag written by :meth:MeetingRegistry.forget) lives in the row's doc_metadata JSON column under the DOC_METADATA_KEY ("fireflies") key, written through :meth:SourceCollectionManager.record_document_metadata — a read-merge-write that never clobbers sibling keys (e.g. the FEAT-451 DocumentMetadata the vault ingest writes on the same row).

The manager's public API is synchronous by design (its own module docstring); every call from this facade is dispatched through asyncio.to_thread so no manager call ever blocks the event loop.

Attribute AnalysisStatus

Class BackfillReport

Result of :meth:MeetingRegistry.backfill_from_vault.

Fields:

Field Type Default Description
seeded int
without_analysis int
duplicates list[MergeResult]
unmerged list[str]

Attribute Classification

Class Classified

Result of :meth:MeetingRegistry.classify for one listing item.

Fields:

Field Type Default Description
action Classification
record MeetingRecord | None None
fetched_text str | None None
fingerprint str | None None
summary_fingerprint str | None None
probable_duplicate_of list[str]

Attribute DOC_METADATA_KEY

Attribute EXTERNAL_ID_PREFIX

Alias FIREFLIES_RECHECK_DAYS

Re-exported from parrot.agents.conf.FIREFLIES_RECHECK_DAYS.

Alias FirefliesObsidianAgent

Re-exported from parrot.agents.obsidian.FirefliesObsidianAgent.

Class MeetingRecord

Meeting-side view of one sources row (doc_metadata['fireflies'] + external_id).

Fields:

Field Type Default Description
fireflies_id str
external_id str
source_id str
note_path str
title str
meeting_date str
participants list[str]
duration_minutes float 0.0
fingerprint str | None None
summary_fingerprint str | None None
synced_at str
analysis_status AnalysisStatus 'pending'
analysis_fingerprint str | None None
wiki_ingested_at str | None None
last_error str | None None

Class MeetingRegistry

Meeting-shaped async facade over :class:SourceCollectionManager.

Degraded mode: if the underlying manager cannot be constructed (or a later call raises sqlite3.Error/OSError), :attr:available becomes False after one WARNING log, and every verb returns a neutral value (see each verb's docstring) instead of raising — the calling agent is expected to fall back to its own title-based dedup logic for that run (spec §2 G10).

Parameter Type Default Description
registry_dir Path Directory whose wiki.db (and sources/ subdirectory) back this registry. Created if needed.
manager SourceCollectionManager | None None An already-constructed manager to wrap instead of creating a new one (e.g. so the wiki toolkit's own manager instance can be shared). When omitted, a :class:SourceCollectionManager is opened on registry_dir/"sources" with db_path=registry_dir/"wiki.db".

Attributes:

Attribute Type Description
registry_dir Path Directory whose wiki.db/sources/ back this registry (shared with the wiki toolkit once it opens the same path — spec §2 G5).
logger logging.Logger Standard Python logger.
available bool True when the underlying manager is usable.

Method MeetingRegistry.lookup

Look up a meeting by its Fireflies transcript id.

lookup(fireflies_id: str) -> MeetingRecord | None

Parameter Type Default Description
fireflies_id str The raw Fireflies transcript id (no prefix).

Returns: MeetingRecord | None — class:MeetingRecord, or None if unknown or the registry is unavailable.

Method MeetingRegistry.classify

Classify one Fireflies listing item as create/skip/revise.

See spec §2 "Sync loop" step 2 for the full decision table.

classify(item: dict[str, Any], *, fetch: Callable[[str], Awaitable[str]], fetch_summary: Callable[[str], Awaitable[str | None]] | None = None, force_refetch: bool = False) -> Classified

Parameter Type Default Description
item dict[str, Any] One listing dict from FirefliesObsidianAgent._parse_fireflies_response (keys: id, title, date, participants, duration).
fetch Callable[[str], Awaitable[str]] Awaitable returning the full transcript text for a given Fireflies id. Called at most once.
fetch_summary Callable[[str], Awaitable[str | None]] | None None Optional awaitable returning the Fireflies native summary text (or None) for a given id.
force_refetch bool False Bypass the cheap-skip path and always fetch + fingerprint when the id is already known.

Returns: Classified — class:Classified result. When the registry is unavailable, always action="create" with nothing fetched — the calling agent is expected to use its own fallback dedup path instead of calling classify in that case.

Method MeetingRegistry.pending_analysis

Meetings needing (re-)analysis.

pending_analysis() -> list[MeetingRecord]

Returns: list[MeetingRecord] — Records with analysis_status != "done" OR analysis_fingerprint != fingerprint, excluding rejected rows. Empty when the registry is unavailable.

Method MeetingRegistry.all_records

Every tracked meeting, regardless of analysis status.

Unlike :meth:pending_analysis (which excludes done-and-current rows by construction), this is the full set — used by a force=True re-analysis run that must reach every meeting, not just the ones already flagged as needing it.

all_records() -> list[MeetingRecord]

Returns: list[MeetingRecord] — Every non-rejected fireflies row as a :class:MeetingRecord. Rejected rows (:meth:forget with reject=True) are still excluded — a permanently-skipped meeting has no content to re-analyze. Empty when the registry is unavailable.

Method MeetingRegistry.suggest_from_date

Suggest the Fireflies listing fromDate from registry history.

suggest_from_date(*, overlap_days: int) -> str | None

Parameter Type Default Description
overlap_days int Days to subtract from the most recent synced_at in the registry.

Returns: str | None — max(synced_at).date() - overlap_days as an ISO YYYY-MM-DD string, or None when the registry has no rows (or is unavailable) — callers should send no fromDate in that case (today's behaviour).

Method MeetingRegistry.unique_slug

Disambiguate a note title against the registry and the filesystem.

unique_slug(meetings_folder: str, base_title: str, *, vault_path: Path) -> str

Parameter Type Default Description
meetings_folder str Vault-relative meetings folder (e.g. "meetings").
base_title str The candidate note title (no .md suffix), typically FirefliesObsidianAgent._make_note_title(...).
vault_path Path Absolute path to the vault root.

Returns: str — base_title if free, else "{base_title}-2", "{base_title}-3", ... — the first suffix not present in the registry (by URI) nor on disk.

Method MeetingRegistry.record_synced

Record (or refresh) a meeting's synced state.

Registers the note file if untracked (or attaches external_id to an already-tracked, id-less row), then merges the doc_metadata["fireflies"] block with the new sync state.

record_synced(*, fireflies_id: str, note_path: Path, title: str, meeting_date: str, participants: list[str], duration_minutes: float, fingerprint: str, summary_fingerprint: str | None, reset_analysis: bool) -> MeetingRecord

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id.
note_path Path Path to the note file (must exist).
title str Meeting title.
meeting_date str YYYY-MM-DD.
participants list[str] Participant emails/names.
duration_minutes float Meeting duration.
fingerprint str SHA-256 of the normalised transcript.
summary_fingerprint str | None SHA-256 of the Fireflies summary, if any.
reset_analysis bool When True, resets analysis_status="pending" and clears analysis_fingerprint (a revise always does this).

Returns: MeetingRecord — The resulting :class:MeetingRecord. When the registry is unavailable, a record built from the given arguments is returned WITHOUT being persisted (logged once).

Method MeetingRegistry.mark_analyzed

Record a successful analysis for a meeting.

mark_analyzed(fireflies_id: str, fingerprint: str) -> None

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id.
fingerprint str The transcript fingerprint the analysis was computed against.

Method MeetingRegistry.mark_analysis_failed

Record a failed analysis attempt for a meeting.

mark_analysis_failed(fireflies_id: str, error: str) -> None

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id.
error str Human-readable error description.

Method MeetingRegistry.mark_wiki_ingested

Stamp wiki_ingested_at on every up-to-date, ingested fireflies row.

mark_wiki_ingested(*, at: str | None = None) -> int

Parameter Type Default Description
at str | None None Timestamp to stamp (ISO-8601 UTC). Defaults to now.

Returns: int — Number of rows stamped. 0 when the registry is unavailable.

Method MeetingRegistry.forget

Remove (or permanently reject) a tracked meeting.

forget(fireflies_id: str, *, reject: bool = False) -> bool

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id.
reject bool False When True, the row is kept but flagged rejected in doc_metadata["fireflies"] so :meth:classify returns "skip" for it forever (used when the note was deleted by the user but the meeting must never be re-created). When False (default), the row is removed entirely.

Returns: bool — True if a tracked row was found and updated/removed; False otherwise (including when the registry is unavailable).

Method MeetingRegistry.backfill_from_vault

Seed the registry from existing vault note frontmatter (spec §2 G8).

No-op (seeded=0) when the registry already has any fireflies:* row — this is a ONE-TIME migration for a vault that predates the registry, never a repeated resync.

backfill_from_vault(*, toolkit: ObsidianToolkit, meetings_folder: str, analysis_heading: str, merge: bool = True) -> BackfillReport

Parameter Type Default Description
toolkit ObsidianToolkit An :class:ObsidianToolkit (local backend) scoped to the vault, with "read"/"bulk_read"/"list" allowed, plus "move"/"delete" when merge=True.
meetings_folder str Vault-relative meetings folder.
analysis_heading str Heading marking a note as already analysed (e.g. "## Analysis").
merge bool True When False, duplicate ids are left entirely alone (reported in unmerged, nothing deleted or registered) — a dry run.

Returns: BackfillReport — class:BackfillReport summarising what was seeded.

Method MeetingRegistry.merge_duplicates

Merge duplicate notes registered under one Fireflies id (spec §3 Module 3).

Keep rule: the note whose body contains analysis_heading; if several or none qualify, the newest by mtime. The kept note is moved to the canonical path ({meetings_folder}/{_make_note_title(date, title)}.md) when that path is free (not on disk, not registry-owned by a different id); every other note is deleted. Never deletes a note whose frontmatter failed to parse.

merge_duplicates(fireflies_id: str, paths: list[str], *, toolkit: ObsidianToolkit, meetings_folder: str, analysis_heading: str) -> MergeResult

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id shared by paths.
paths list[str] Vault-relative note paths registered under this id (must all be inside meetings_folder).
toolkit ObsidianToolkit An :class:ObsidianToolkit with "read", "bulk_read", "list", "move", and "delete" allowed.
meetings_folder str Vault-relative meetings folder.
analysis_heading str Heading marking a note as already analysed.

Returns: MergeResult — class:MergeResult with the kept path and every removed path.

Method MeetingRegistry.repair_path

Repair a renamed/moved note's registered path (spec §2 G7).

repair_path(fireflies_id: str, *, toolkit: ObsidianToolkit, meetings_folder: str, canonical_title: str) -> RepairResult

Parameter Type Default Description
fireflies_id str Raw Fireflies transcript id.
toolkit ObsidianToolkit An :class:ObsidianToolkit with "read", "bulk_read", "list", and "move" allowed.
meetings_folder str Vault-relative meetings folder.
canonical_title str The note title (no .md suffix) the note should live at, e.g. FirefliesObsidianAgent._make_note_title(date, title).

Returns: RepairResult — class:RepairResult. to_path=None means the note could not be found anywhere in meetings_folder — the caller should treat this as unregistered (create a new note).

Class MergeResult

Result of :meth:MeetingRegistry.merge_duplicates for one meeting id.

Fields:

Field Type Default Description
fireflies_id str
kept str
removed list[str]

Alias ObsidianToolkit

Re-exported from parrot.tools.obsidian.ObsidianToolkit.

Class RepairResult

Result of :meth:MeetingRegistry.repair_path for one meeting id.

Fields:

Field Type Default Description
fireflies_id str
from_path str | None
to_path str | None
moved bool

Alias SourceCollectionManager

Re-exported from parrot.knowledge.wiki.sources.SourceCollectionManager.

Alias SourceManifestEntry

Re-exported from parrot.knowledge.wiki.models.SourceManifestEntry.

Function fingerprint

SHA-256 hex digest of the normalised transcript text.

fingerprint(text: str) -> str

Parameter Type Default Description
text str Raw transcript text (the Fireflies native summary, if any, must be fingerprinted separately — never passed here).

Returns: str — Lowercase hexadecimal SHA-256 digest of normalise_transcript(text).

Attribute logger

Function normalise_transcript

Normalise transcript text so content-only changes drive fingerprint.

Rules (spec §2 New Public Interfaces): strip a leading BOM, normalise \r\n/\r line endings to \n, right-strip every line, collapse runs of more than two consecutive blank lines down to two, and strip leading/trailing blank lines.

normalise_transcript(text: str) -> str

Parameter Type Default Description
text str Raw transcript text.

Returns: str — The normalised text, ready for :func:fingerprint.

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