docs: office-assistant MVP example workflows#166
Conversation
Two manually-run workflows plus a Postgres full-text knowledge base that implement the office-assistant MVP: - office-assistant-ingest-meeting.yaml: LLM summarizes a pasted transcript and extracts action items, stores the note in the KB, opens a Jira issue, and posts the summary to Teams. - office-assistant-ask.yaml: full-text searches the KB and has an LLM synthesize a grounded, cited answer. - office-assistant-kb-schema.sql: the tsvector-backed KB schema (v0 retrieval; pgvector upgrade path noted, tracked by #153). - docs/office-assistant-mvp.md: setup, usage, and caveats. Retrieval is Postgres full-text search rather than embeddings so the whole flow runs on stock connectors. Both workflows pass `mantle validate`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnKgCRfMvFcZAkoVbr8k79
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a new office-assistant example: a Postgres knowledge-base schema, an ingest-meeting workflow (AI summarization, DB insert, conditional Jira issue, Teams post), an ask-question workflow (full-text search plus grounded AI answer), and a documentation page describing prerequisites, usage, and MVP limitations. ChangesOffice-assistant MVP
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d0413e0a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| required: | ||
| - title |
There was a problem hiding this comment.
Require every action item field in strict schema
With the default OpenAI credential used by this workflow, the AI connector sends every output_schema as response_format.json_schema with strict: true (packages/engine/internal/connector/provider_openai.go:58-65). OpenAI rejects strict object schemas when declared properties are omitted from required; this item schema declares description and owner but only requires title, so the summarize step fails with an API 400 before the meeting can be stored or posted. Make those fields required, or keep them required and allow null values for missing owners/descriptions.
Useful? React with 👍 / 👎.
|
|
||
| | Credential name | Type | Used for | | ||
| | --------------- | ---- | -------- | | ||
| | `openai` | `openai` | `ai/completion` (summarize + answer). Swap the `credential:` and `model:` for `bedrock` to use Claude via Bedrock. | |
There was a problem hiding this comment.
Include the provider flag in Bedrock instructions
Following this guidance by changing only credential: and model: still runs the OpenAI provider, because ai/completion defaults params.provider to openai unless provider: bedrock is set (packages/engine/internal/connector/ai.go:24-27, and the Bedrock branch is selected only at ai.go:101). Users trying the documented Bedrock swap will send an OpenAI-compatible request with AWS credentials and fail; the setup should instruct them to add provider: bedrock (and usually region) in both AI steps.
Useful? React with 👍 / 👎.
Addresses PR review feedback: - ingest-meeting: OpenAI structured output is sent with strict:true, which requires every declared property to appear in `required`. The action_items item schema listed description/owner but only required title, so the summarize step would 400. Make them required and nullable (type: [string, null]) so absent values are expressible. - docs: the Bedrock swap needs `provider: bedrock` (+ region); provider defaults to openai, so changing only credential/model still sends an OpenAI-format request. Corrected the guidance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnKgCRfMvFcZAkoVbr8k79
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
packages/site/src/content/examples/office-assistant-kb-schema.sql (1)
13-31: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winNo idempotency/dedup safeguard on
meeting_notes.The table has no unique/natural key. If the
store-noteinsert inoffice-assistant-ingest-meeting.yamlis ever retried (transient DB error, workflow re-run), the same meeting will be duplicated in the knowledge base, degradingoffice-assistant-ask.yamlsearch results with redundant hits. Worth adding a dedup key (e.g. a hash oftranscript, or a caller-suppliedexternal_id) with a unique index, paired withON CONFLICT DO NOTHING/DO UPDATEon insert.♻️ Example dedup key
transcript TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), + dedupe_key TEXT GENERATED ALWAYS AS (md5(transcript)) STORED,+CREATE UNIQUE INDEX IF NOT EXISTS idx_meeting_notes_dedupe + ON meeting_notes (dedupe_key);Please verify whether the workflow engine retries
postgres/querysteps automatically — if it does, this becomes a more pressing fix.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/site/src/content/examples/office-assistant-kb-schema.sql` around lines 13 - 31, The meeting_notes schema lacks an idempotency/dedup key, so repeated inserts can create duplicate notes and pollute search results. Add a unique natural key to the CREATE TABLE definition in office-assistant-kb-schema.sql, such as an external_id or a hash-derived dedup column, and enforce it with a unique constraint or index. Then update the store-note insert path in office-assistant-ingest-meeting.yaml to use the new key with ON CONFLICT DO NOTHING or DO UPDATE, and keep office-assistant-ask.yaml compatible with the deduped records.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/site/src/content/docs/office-assistant-mvp.md`:
- Around line 29-34: The KB schema setup command in the office-assistant-mvp
docs uses a relative filename that only works from the examples directory, so
update the text around the office-assistant-kb-schema.sql reference and the psql
command to use a path readers can run from the repo root or explicitly instruct
them to cd into the examples directory first. Make the command in
office-assistant-mvp.md match the actual location of
office-assistant-kb-schema.sql so copy/paste works without guessing.
- Around line 68-70: The `office-assistant-ask` example is using `--input
question=...`, which may not match the documented runnable workflow for this
command. Update the example in the office-assistant MVP docs to use the same
invocation style as the rest of the `office-assistant-ask`/`mantle run`
workflow, and verify the CLI flags supported by `office-assistant-ask` so the
snippet is copy/pasteable without relying on unsupported `--input` syntax.
In `@packages/site/src/content/examples/office-assistant-ingest-meeting.yaml`:
- Around line 99-113: The create-action-items step is sending markdown directly
to jira/create_issue, which wraps description as plain-text ADF and will render
the checklist literally. Update the create-action-items params to convert
steps['summarize'].output.json.action_items_markdown into Jira-compatible ADF
before passing it to jira/create_issue, keeping the summarize output and
action-items flow intact.
- Around line 80-97: The store-note postgres/query step is missing both a
deadline and deduplication protection, so update the meeting note insert to use
an explicit timeout in the step context and make the write idempotent with a
dedupe key plus ON CONFLICT handling. Locate the change in the store-note block
and adjust the insert into meeting_notes and its args so retries or re-runs
won’t create duplicate rows.
---
Nitpick comments:
In `@packages/site/src/content/examples/office-assistant-kb-schema.sql`:
- Around line 13-31: The meeting_notes schema lacks an idempotency/dedup key, so
repeated inserts can create duplicate notes and pollute search results. Add a
unique natural key to the CREATE TABLE definition in
office-assistant-kb-schema.sql, such as an external_id or a hash-derived dedup
column, and enforce it with a unique constraint or index. Then update the
store-note insert path in office-assistant-ingest-meeting.yaml to use the new
key with ON CONFLICT DO NOTHING or DO UPDATE, and keep office-assistant-ask.yaml
compatible with the deduped records.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f9129535-f31e-45e3-9e58-67b41c999aa1
📒 Files selected for processing (4)
packages/site/src/content/docs/office-assistant-mvp.mdpackages/site/src/content/examples/office-assistant-ask.yamlpackages/site/src/content/examples/office-assistant-ingest-meeting.yamlpackages/site/src/content/examples/office-assistant-kb-schema.sql
| mantle run office-assistant-ask \ | ||
| --input question="Who else is working with client C?" \ | ||
| --output json |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align the ask command with the runnable workflow.
The paired office-assistant-ask example is documented as a values-file run, but this snippet switches to --input question=.... If --input is not supported here, the example won’t copy/paste cleanly.
Proposed fix
mantle run office-assistant-ask \
- --input question="Who else is working with client C?" \
+ --values q.yaml \
--output json📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| mantle run office-assistant-ask \ | |
| --input question="Who else is working with client C?" \ | |
| --output json | |
| mantle run office-assistant-ask \ | |
| --values q.yaml \ | |
| --output json |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/site/src/content/docs/office-assistant-mvp.md` around lines 68 - 70,
The `office-assistant-ask` example is using `--input question=...`, which may
not match the documented runnable workflow for this command. Update the example
in the office-assistant MVP docs to use the same invocation style as the rest of
the `office-assistant-ask`/`mantle run` workflow, and verify the CLI flags
supported by `office-assistant-ask` so the snippet is copy/pasteable without
relying on unsupported `--input` syntax.
CodeRabbit review follow-ups on the office-assistant MVP: - KB schema: add a dedupe_key (md5(transcript)) + unique index; the store-note insert now uses ON CONFLICT DO NOTHING so retries/re-runs don't create duplicate notes that would pollute search. - ingest: gate the Jira and Teams steps on rows_affected > 0 so a duplicate re-ingest is a clean no-op; add a 15s timeout to the DB write (and to the ask search). - ingest: jira/create_issue wraps description as plain-text ADF, so markdown rendered literally — the LLM now emits a plain-text action-item rendering (action_items_text) used as the Jira description. - docs: use the full repo-root path in the psql schema-load command. Kept the `ask` example's `--input question=...` — that flag is supported by `mantle run`. Both workflows still pass `mantle validate`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WnKgCRfMvFcZAkoVbr8k79
|
Thanks — addressed the review in
Both workflows still pass Generated by Claude Code |
Summary
Implements the two-workflow office-assistant MVP from #161 as runnable examples plus a guide. It turns a pasted meeting transcript into structured notes and answers questions from a company-wide knowledge base, using only stock connectors.
Changes
examples/office-assistant-ingest-meeting.yaml—ai/completion(withoutput_schema) summarizes a pasted transcript and extracts action items →postgres/querystores the note in the KB →jira/create_issueopens a checklist issue for the action items (skipped if none) →teams/send_messageposts the summary.examples/office-assistant-ask.yaml—postgres/queryfull-text search ranks the most relevant notes →ai/completionsynthesizes a grounded, cited answer (read from the CLI output).examples/office-assistant-kb-schema.sql— the knowledge-base schema: a weightedtsvectorcolumn + GIN index. Pure Postgres full-text search, no extensions.docs/office-assistant-mvp.md— setup (credentials + schema), usage for both workflows, and the caveats.Design notes
for_eachconstruct yet, so a single checklist issue is the clean one-step equivalent.Testing
mantle validate(offline schema validation).make test— n/a; this PR only touchespackages/site/**(no engine code, so Engine CI path filters don't trigger).Related Issues
Implements the MVP workflows described in #161 (which also tracks the broader vision — #153–#160). Leaving #161 open for the maintainer to decide.
Generated by Claude Code
Summary by CodeRabbit
New Features
Documentation