diff --git a/MeetingAssistant.Tests/MeetingSummaryInstructionBuilderTests.cs b/MeetingAssistant.Tests/MeetingSummaryInstructionBuilderTests.cs index 36b5732..b2a498f 100644 --- a/MeetingAssistant.Tests/MeetingSummaryInstructionBuilderTests.cs +++ b/MeetingAssistant.Tests/MeetingSummaryInstructionBuilderTests.cs @@ -40,6 +40,27 @@ public sealed class MeetingSummaryInstructionBuilderTests Assert.Contains("title parameter", instructions); } + [Fact] + public async Task DefaultPromptTreatsAssistantContextAsMeetingMemoryForUncertainty() + { + var root = Path.Combine(Path.GetTempPath(), "meeting-assistant-tests", Guid.NewGuid().ToString("N")); + var artifacts = CreateArtifacts(root); + await WriteMeetingNoteAsync(artifacts.MeetingNotePath, []); + var builder = new MeetingSummaryInstructionBuilder(Options.Create(new MeetingAssistantOptions + { + Agent = new AgentOptions { InitialPrompt = " " }, + Vault = new VaultOptions { ProjectsFolder = Path.Combine(root, "Projects") } + })); + + var instructions = await builder.BuildAsync(artifacts, CancellationToken.None); + + Assert.Contains("meeting-specific memory", instructions); + Assert.Contains("unexpected problems", instructions); + Assert.Contains("missing information", instructions); + Assert.Contains("assumptions", instructions); + Assert.Contains("write_context", instructions); + } + [Fact] public async Task BuilderUsesConfiguredPrompt() { diff --git a/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs b/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs index 1675392..d3e615d 100644 --- a/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs +++ b/MeetingAssistant.Tests/WorkflowRulesEditorTests.cs @@ -760,6 +760,29 @@ public sealed class WorkflowRulesEditorTests Assert.Contains("matching correction", instructions); } + [Fact] + public async Task InstructionBuilderTreatsAssistantContextAsMeetingMemoryDuringRepairs() + { + var builder = new WorkflowRulesEditorInstructionBuilder( + NullLogger.Instance); + var options = new MeetingAssistantOptions + { + WorkflowRulesEditor = new WorkflowRulesEditorOptions + { + InitialPrompt = "Custom interactive agent instructions." + } + }; + + var instructions = await builder.BuildAsync(options, CancellationToken.None); + + Assert.Contains("Custom interactive agent instructions.", instructions); + Assert.Contains("meeting-specific memory", instructions); + Assert.Contains("fix or investigate a meeting or summary", instructions); + Assert.Contains("read the matching assistant context", instructions); + Assert.Contains("problems, missing information, assumptions, prior fixes, and conclusions", instructions); + Assert.Contains("append a concise record of your fixes and conclusions", instructions); + } + [Fact] public async Task RulesEditorToolsCrudAndSearchSpeakerIdentities() { diff --git a/MeetingAssistant/Summary/MeetingSummaryInstructionBuilder.cs b/MeetingAssistant/Summary/MeetingSummaryInstructionBuilder.cs index 393ff84..902b74c 100644 --- a/MeetingAssistant/Summary/MeetingSummaryInstructionBuilder.cs +++ b/MeetingAssistant/Summary/MeetingSummaryInstructionBuilder.cs @@ -14,7 +14,7 @@ public sealed class MeetingSummaryInstructionBuilder : IMeetingSummaryInstructio write_summary is only for the current meeting's summary file. Past project meeting summaries are read-only historical context; use list_past_project_meetings and read_past_project_meeting_summary to inspect them, and never try to mutate them. If the meeting note has no title, or still has a generated default title like `Meeting yyyy-MM-dd HH:mm`, provide a concise title parameter to write_summary when the purpose of the meeting is clear from transcript, user notes, or assistant context. If the purpose is not clear, omit the title parameter. Use read_meetingnote to inspect frontmatter such as title, attendees, projects, start_time, and end_time. - Use read_context and write_context as your own meeting notebook. Its frontmatter may include agenda from the calendar appointment. Record useful internal notes, missing context, requests for future tools, suggested improvements, and relevant context discovered from other sources. write_context appends by default; use replace_file=true only when you are intentionally replacing the whole assistant context body. Keep user-facing summary content in the summary note. + Treat the assistant context as persistent meeting-specific memory and use read_context and write_context as your own meeting notebook. Its frontmatter may include agenda from the calendar appointment. Whenever you encounter unexpected problems, discover missing information, or make assumptions while summarizing, use write_context to append a concise note so later agents working on this meeting can understand them. Also record useful internal notes, requests for future tools, suggested improvements, and relevant context discovered from other sources. write_context appends by default; use replace_file=true only when you are intentionally replacing the whole assistant context body. Keep user-facing summary content in the summary note. Use add_dictation_word when project context, user notes, or transcript evidence show that a domain term, acronym, name, or unusual word is likely to be repeatedly mistranscribed. Add only the canonical spelling, one term at a time. Use add_attendee and remove_attendee to sharpen the meeting attendees list from clear transcript evidence and screenshot OCR participant evidence. Treat OCR that says visible people are a partial screenshot result as incomplete evidence; do not remove attendees solely because they are absent from a partial screenshot. Use override_speaker only when you are very certain that a transcript speaker label belongs to a named person, for example from user notes, OCR evidence with a matching timestamp, or very clear context cues. Provide the exact speaker label from the transcript and the replacement speaker name. If the replacement speaker already exists in the transcript, use merge=true only when you are certain both speaker labels are the same identity; otherwise do not merge them. diff --git a/MeetingAssistant/Workflow/WorkflowRulesEditorInstructionBuilder.cs b/MeetingAssistant/Workflow/WorkflowRulesEditorInstructionBuilder.cs index f9b46b3..7921c83 100644 --- a/MeetingAssistant/Workflow/WorkflowRulesEditorInstructionBuilder.cs +++ b/MeetingAssistant/Workflow/WorkflowRulesEditorInstructionBuilder.cs @@ -60,7 +60,7 @@ public sealed class WorkflowRulesEditorInstructionBuilder : IWorkflowRulesEditor "Log tools can read and search the current application-owned log file and four rotated older files under the temp log folder." + Environment.NewLine + Environment.NewLine + "Spec tools can search and read copied OpenSpec markdown files from openspec/specs." + Environment.NewLine + Environment.NewLine + "Project tools can create project folders and read, write, list, and search files in configured projects." + Environment.NewLine + Environment.NewLine + - "Meeting artifact tools can list recent summaries and read/search/write summaries, transcripts, meeting notes, and assistant context files for note post-processing and repair. Prefer frontmatter-specific write tools for metadata-only fixes." + Environment.NewLine + Environment.NewLine + + "Meeting artifact tools can list recent summaries and read/search/write summaries, transcripts, meeting notes, and assistant context files for note post-processing and repair. Prefer frontmatter-specific write tools for metadata-only fixes. Treat each assistant context file as meeting-specific memory. When asked to fix or investigate a meeting or summary, read the matching assistant context for clues about problems, missing information, assumptions, prior fixes, and conclusions. After completing repairs, use write_context to append a concise record of your fixes and conclusions to that assistant context for future work on the meeting." + Environment.NewLine + Environment.NewLine + "Diagnostic tools mirror the local health, recording status, Outlook metadata, speaker identity merge, workflow reload, and ASR diagnostic endpoints without requiring HTTP." + Environment.NewLine + Environment.NewLine + "Speaker identity tools can search/list/read/update/delete/merge identities, refuse sampleless identity creation, list/read/delete identity samples, and queue a sample for local playback. Do not delete the last sample from an identity; delete the identity instead." + Environment.NewLine + Environment.NewLine + "Workflow rules reference documentation:" + Environment.NewLine + diff --git a/docs/meeting-assistant-configuration.md b/docs/meeting-assistant-configuration.md index 4eebb81..17947ff 100644 --- a/docs/meeting-assistant-configuration.md +++ b/docs/meeting-assistant-configuration.md @@ -352,6 +352,8 @@ When enabled on Windows, Meeting Assistant periodically syncs today's Outlook Cl After transcription has fully finished, Meeting Assistant automatically runs the summary pipeline for the meeting. The summary agent writes the full markdown summary through `write_summary` and must provide a required `oneliner` value, which is stored in summary frontmatter and must not contain line breaks. +The built-in summary-agent instructions treat assistant context as persistent meeting-specific memory. When the agent encounters an unexpected problem, missing information, or an assumption while summarizing, it appends a concise note through `write_context` so later work on the same meeting can use that history. A configured `Agent:InitialPrompt` completely replaces the built-in instructions, so custom prompts must include equivalent guidance when this behavior is desired. + The summary agent can add and remove meeting-note attendees when transcript or OCR evidence is clear. It can override transcript speaker labels only when the evidence is very certain, and it can delete wrongfully matched identities. Final speaker identity learning and candidate updates run after the summary pipeline finishes so they use the summary-refined attendee list and any recorded speaker identity changes. `ContextWindowTokens`, `MaxOutputTokens`, `EnableCompaction`, and `CompactionRemainingRatio` configure summary-agent context monitoring. Meeting Assistant estimates the outgoing Responses payload size, logs the estimated token count and remaining context, and compacts the conversation when only the configured remaining ratio is left. @@ -364,6 +366,8 @@ The overridable fields are `Endpoint`, `Key`, `KeyEnv`, `Model`, `EnableThinking The assistant can edit workflow rules, manage speaker identities, read and replace the local appsettings file, read this configuration document, search and read copied OpenSpec specs, inspect application logs, create/search/read/write project files, and post-process past meeting artifacts by listing recent summaries and reading, writing, or searching summaries, transcripts, meeting notes, and assistant context files. For artifact metadata repairs, it has frontmatter-specific write tools that preserve the markdown body. +When asked to fix or investigate a meeting or summary, the agent is instructed to treat the matching assistant context as meeting-specific memory and read it for clues about problems, missing information, assumptions, prior fixes, and conclusions. After completing a repair, it appends a concise record of its fixes and conclusions to that context for future work on the meeting. This meeting-memory guidance is appended to the effective interactive-agent prompt even when `WorkflowRulesEditor:InitialPrompt` is configured. + It also has in-process diagnostic tools that mirror the local HTTP diagnostics for health, recording status, current Outlook meeting lookup, recent speaker identity merging, workflow configuration reload, and ASR transcribe/diarize checks. The `search_spec` and `read_spec_file` tools are scoped to the copied `openspec/specs` markdown tree. Spec files are copied into build and publish output through an MSBuild glob, so newly added folders under `openspec/specs` are included automatically. diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/.openspec.yaml b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/.openspec.yaml new file mode 100644 index 0000000..ff5f854 --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-07-17 diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/design.md b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/design.md new file mode 100644 index 0000000..a8f9050 --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/design.md @@ -0,0 +1,45 @@ +## Context + +Meeting Assistant already creates one assistant context artifact per meeting and gives both the automatic summary agent and the interactive agent window tools that can read and append to it. The current summary prompt calls the file a notebook, while the interactive agent prompt describes only generic artifact repair. Neither prompt establishes assistant context as the durable handoff point for uncertainty, failures, assumptions, repairs, and conclusions about one meeting. + +## Goals / Non-Goals + +**Goals:** + +- Make the assistant context's meeting-specific memory role explicit to both agents. +- Preserve summarization problems, missing information, and assumptions for later investigation. +- Make the interactive agent consult that memory before repairing a meeting or summary. +- Make the interactive agent record completed fixes and conclusions for later agents. + +**Non-Goals:** + +- Add a new artifact type, schema, section format, or database. +- Automatically rewrite or summarize existing assistant context files. +- Change tool permissions or allow agents to access artifacts outside existing configured scopes. +- Override an explicitly configured custom summary-agent prompt with built-in summary guidance. + +## Decisions + +### Extend the existing instruction builders + +The automatic summary behavior will be added to `MeetingSummaryInstructionBuilder.DefaultInitialPrompt`. This preserves the existing contract that a configured `Agent:InitialPrompt` replaces the built-in summary prompt. + +The interactive behavior will be included in the instruction builder's always-appended meeting-artifact guidance. This keeps the meeting-memory reminder available even when the interactive agent has a custom initial prompt, alongside the tool capabilities that Meeting Assistant already appends. + +Alternative considered: implement automatic interception or mandatory writes whenever an agent encounters uncertainty. The application cannot reliably infer those semantic events from arbitrary model turns, so explicit instructions are the smallest dependable mechanism. + +### Keep memory entries append-oriented and concise + +Agents will be told to append problems, missing information, assumptions, fixes, and conclusions to the matching assistant context. Existing `write_context` behavior already appends by default, which preserves earlier observations and avoids introducing a structured migration. + +Alternative considered: define mandatory headings or a machine-readable memory schema. That would add formatting and compatibility obligations without being necessary for the requested agent handoff behavior. + +### Keep user-facing summary content separate + +Assistant context remains internal meeting memory; the generated summary remains the user-facing artifact. Assumptions and missing evidence can inform explicit uncertainty in the summary, but diagnostic notes and repair history belong in assistant context. + +## Risks / Trade-offs + +- [Repeated agents may append duplicate observations] → Instruct agents to read existing context first and keep entries concise. +- [Assistant context can grow over time] → Preserve existing ranged and tail reads; no new retention mechanism is introduced. +- [Configured custom summary prompts omit the new built-in guidance] → Preserve the documented replacement semantics and leave responsibility with the custom prompt author. diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/proposal.md b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/proposal.md new file mode 100644 index 0000000..d982ad4 --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/proposal.md @@ -0,0 +1,27 @@ +## Why + +The automatic summarizer and interactive agent window can encounter uncertainty, missing information, and repair conclusions that are useful to later work on the same meeting. Those observations currently depend on the active agent turn instead of being consistently preserved in the meeting's assistant context. + +## What Changes + +- Treat each assistant context file as meeting-specific memory shared by agents working on that meeting. +- Guide the automatic summarizer to record unexpected problems, missing information, and assumptions in assistant context. +- Guide the interactive agent window to consult assistant context when repairing a meeting or summary. +- Guide the interactive agent window to append its fixes and conclusions to assistant context for future work on that meeting. + +## Capabilities + +### New Capabilities + +None. + +### Modified Capabilities + +- `meeting-summary`: Define the automatic summarizer's responsibility to persist uncertainty and problems in meeting-specific assistant context. +- `meeting-session`: Define how the interactive agent window uses and updates assistant context during meeting and summary repairs. + +## Impact + +- Summary-agent default instructions and their behavior tests. +- Interactive agent-window instructions and their behavior tests. +- Agent documentation describing assistant context usage. diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-session/spec.md b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-session/spec.md new file mode 100644 index 0000000..8095f5e --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-session/spec.md @@ -0,0 +1,14 @@ +## ADDED Requirements + +### Requirement: Interactive agent uses assistant context as meeting memory +The interactive agent window instructions SHALL identify each assistant context file as meeting-specific memory. + +When the user asks the interactive agent to fix or investigate a meeting or summary, the instructions SHALL direct the agent to read the matching assistant context for clues about problems, missing information, assumptions, prior fixes, and conclusions. + +After repairing a meeting or summary, the instructions SHALL direct the agent to append a concise record of its fixes and conclusions to the matching assistant context. + +#### Scenario: Interactive agent repairs a meeting artifact +- **GIVEN** a meeting has an assistant context file +- **WHEN** the user asks the interactive agent to fix that meeting or its summary +- **THEN** the agent instructions direct it to inspect the matching assistant context for relevant meeting-specific memory +- **AND** direct it to append its fixes and conclusions to that assistant context diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-summary/spec.md b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-summary/spec.md new file mode 100644 index 0000000..b36b8ac --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/specs/meeting-summary/spec.md @@ -0,0 +1,12 @@ +## ADDED Requirements + +### Requirement: Summary agent preserves meeting-specific working memory +When Meeting Assistant uses the built-in summary-agent instructions, those instructions SHALL identify assistant context as persistent meeting-specific memory. + +The built-in instructions SHALL direct the summary agent to append unexpected problems, missing information, and assumptions encountered while summarizing to assistant context. + +#### Scenario: Summarizer encounters uncertainty +- **GIVEN** the built-in summary-agent instructions are in use +- **WHEN** the summary agent encounters an unexpected problem, cannot find needed information, or must make an assumption +- **THEN** its instructions direct it to append a concise record to the meeting's assistant context +- **AND** later agents can discover that record when working on the same meeting diff --git a/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/tasks.md b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/tasks.md new file mode 100644 index 0000000..f87df17 --- /dev/null +++ b/openspec/changes/archive/2026-07-17-use-assistant-context-as-meeting-memory/tasks.md @@ -0,0 +1,14 @@ +## 1. Automatic Summary Agent + +- [x] 1.1 Add a behavior test that requires the built-in summary instructions to treat assistant context as meeting-specific memory and record problems, missing information, and assumptions. +- [x] 1.2 Update the built-in summary-agent guidance to satisfy the memory behavior. + +## 2. Interactive Agent Window + +- [x] 2.1 Add a behavior test that requires the interactive instructions to inspect assistant context during meeting or summary repair and record fixes and conclusions. +- [x] 2.2 Update the interactive agent-window guidance to satisfy the memory behavior. + +## 3. Documentation and Validation + +- [x] 3.1 Document assistant context as shared meeting-specific agent memory. +- [x] 3.2 Run focused behavior tests, the full test suite, and strict OpenSpec validation. diff --git a/openspec/specs/meeting-session/spec.md b/openspec/specs/meeting-session/spec.md index 6328cb9..a922882 100644 --- a/openspec/specs/meeting-session/spec.md +++ b/openspec/specs/meeting-session/spec.md @@ -362,3 +362,16 @@ Meeting Assistant SHALL provide a diagnostic endpoint that opens the workflow ru - **GIVEN** the rules editor chat window content fits without scrolling or is already near the bottom - **WHEN** a new user or assistant message is appended - **THEN** the conversation scrolls to the bottom of the newly rendered message content + +### Requirement: Interactive agent uses assistant context as meeting memory +The interactive agent window instructions SHALL identify each assistant context file as meeting-specific memory. + +When the user asks the interactive agent to fix or investigate a meeting or summary, the instructions SHALL direct the agent to read the matching assistant context for clues about problems, missing information, assumptions, prior fixes, and conclusions. + +After repairing a meeting or summary, the instructions SHALL direct the agent to append a concise record of its fixes and conclusions to the matching assistant context. + +#### Scenario: Interactive agent repairs a meeting artifact +- **GIVEN** a meeting has an assistant context file +- **WHEN** the user asks the interactive agent to fix that meeting or its summary +- **THEN** the agent instructions direct it to inspect the matching assistant context for relevant meeting-specific memory +- **AND** direct it to append its fixes and conclusions to that assistant context diff --git a/openspec/specs/meeting-summary/spec.md b/openspec/specs/meeting-summary/spec.md index 762a2c9..41818e0 100644 --- a/openspec/specs/meeting-summary/spec.md +++ b/openspec/specs/meeting-summary/spec.md @@ -140,3 +140,14 @@ The summary-agent instructions SHALL tell the agent to keep the one-line summary - **THEN** Meeting Assistant refuses the write - **AND** does not mark the summary as written +### Requirement: Summary agent preserves meeting-specific working memory +When Meeting Assistant uses the built-in summary-agent instructions, those instructions SHALL identify assistant context as persistent meeting-specific memory. + +The built-in instructions SHALL direct the summary agent to append unexpected problems, missing information, and assumptions encountered while summarizing to assistant context. + +#### Scenario: Summarizer encounters uncertainty +- **GIVEN** the built-in summary-agent instructions are in use +- **WHEN** the summary agent encounters an unexpected problem, cannot find needed information, or must make an assumption +- **THEN** its instructions direct it to append a concise record to the meeting's assistant context +- **AND** later agents can discover that record when working on the same meeting +