Skip to content

feat(notes): consolidate note generation on a shared spec and improve structure#114

Merged
Valtora merged 1 commit into
mainfrom
improve/note-generation-prompts
Jul 22, 2026
Merged

feat(notes): consolidate note generation on a shared spec and improve structure#114
Valtora merged 1 commit into
mainfrom
improve/note-generation-prompts

Conversation

@Valtora

@Valtora Valtora commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Description

A pass over Nojoin's note-generation prompts to improve the consistency and quality of generated meeting notes.

The core problem: the automatic first pass (the unified meeting-intelligence prompt) and the "Regenerate Notes" button (the standalone notes prompt) used two separate, drifted prompt bodies, so regenerating notes could produce a different structure from the original. This change makes both paths share a single source of truth and adopts an evidence-based note structure.

What changed:

  • Added NOTES_BODY_SPEC in backend/utils/meeting_notes.py as the single source of truth for note structure and fidelity rules. Both note-generation prompts (unified meeting_intelligence.py and standalone base.py) embed it verbatim, so they can no longer drift. A drift-guard test asserts both contain it.
  • Restructured notes to a best-practice, follow-through-oriented layout: Summary first, a dedicated scannable Key Decisions section (with rationale), prominent Action Items (single named owner plus due date), then per-topic Detailed Notes, then Miscellaneous. This replaces the previous topic-list-first layout that buried decisions.
  • Added anti-hallucination fidelity rules to the notes body (never invent facts, decisions, figures, or attributions; attribute claims to the speaker who made them; favour signal over volume). The primary path previously had none.
  • Notes now begin at the Summary section and no longer emit their own top-level title heading, which duplicated and sometimes contradicted the meeting title the app already displays. Enforced by the prompt instruction, the JSON schema example, a defensive strip_leading_title_heading() helper applied in both paths, and an updated result contract (notes must start with a ## section heading).
  • Unified the persona to "expert meeting-notes assistant" across the notes and title prompts, and routed the standalone title prompt through the shared short-title instruction so both title paths behave consistently.
  • Raised the Anthropic standalone-notes max_tokens from 2048 to 4096 to match the unified path so comprehensive notes are not silently truncated.
  • Removed the dead legacy speaker-table prompt and its helpers (get_default_speaker_prompt_template, get_speaker_prompt_template, build_speaker_prompt, parse_mapping_table); the evidence-JSON speaker-suggestion path fully supersedes them and they had no production or test callers.

No new dependencies.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation update

Checks run

  • Backend tests: source .venv/bin/activate && pytest (864 passed)
  • Python quality: python scripts/check.py (Ruff lint, format check, mypy, doc and Alembic validators)
  • Frontend lint: cd frontend && npm run lint (not run: no frontend paths changed)
  • Frontend unit tests: cd frontend && npm run test (not run: no frontend paths changed)
  • Frontend build: cd frontend && npm run build (not run: no frontend paths changed)
  • Docs validation: python3 scripts/validate_docs.py
  • Alembic validation: python3 scripts/validate_alembic.py

Migration impact

  • No database migration in this PR.

Documentation impact

  • No documentation change required. Confirmed no guide specifies the note section layout; docs/USAGE.md describes only what the notes-language setting controls (still accurate) and docs/ARCHITECTURE.md covers prompt caching (unaffected).

Security impact

  • No security-sensitive change.

Manual verification

Automated coverage only in this PR (864 backend tests pass, including new drift-guard and title-strip tests). Recommended live smoke check before or after merge: process a recording and use "Regenerate Notes", confirming the notes open at the Summary heading, carry a scannable Key Decisions section, and contain no duplicate title line. No capture, context-menu, auth, or migration paths are touched.

…e notes summary-first with a dedicated Key Decisions section, and stop emitting a redundant notes title heading
@Valtora
Valtora merged commit 138bbde into main Jul 22, 2026
16 checks passed
@Valtora
Valtora deleted the improve/note-generation-prompts branch July 22, 2026 21:13
@Valtora Valtora mentioned this pull request Jul 22, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant