Skip to content

feat: Meeting Intelligence Agent — Transform messy notes into action items#149

Open
AnuragDubey007 wants to merge 22 commits intoLamatic:old-mainfrom
AnuragDubey007:main
Open

feat: Meeting Intelligence Agent — Transform messy notes into action items#149
AnuragDubey007 wants to merge 22 commits intoLamatic:old-mainfrom
AnuragDubey007:main

Conversation

@AnuragDubey007
Copy link
Copy Markdown

@AnuragDubey007 AnuragDubey007 commented Apr 21, 2026

What This Kit Does

Transforms raw, messy meeting notes into structured action items, decisions, and follow-up questions — and automatically emails the report to your team.

Providers & Prerequisites

  • Groq API key (free) for Llama 3.3 70B
  • Gmail/SMTP credentials configured in Lamatic Connections
  • Lamatic.ai account (free)

How to Run Locally

  1. cd kits/automation/meeting-intelligence
  2. npm install
  3. cp .env.example .env.local and fill in values
  4. npm run dev

Live Preview

https://meeting-intelligence-tau.vercel.app/

Lamatic Flow

Flow ID: meeting-notes-extractor

Flow Architecture

API Request → Generate Text (Llama 3.3 70B via Groq) → Code Node (JSON parser + HTML builder) → SMTP Node (email delivery) → API Response

PR Checklist

  • Kit runs locally with npm run dev
  • .env.example has no secrets, only placeholders
  • README.md documents setup and usage
  • Folder structure follows kits/automation/meeting-intelligence/
  • config.json is present and valid
  • Vercel deployment works
  • Live preview URL works end-to-end

Files Added

Configuration & Setup:

  • .gitignore - Excludes node_modules/, .env, .env.local, and .next/
  • package.json - Project metadata and dependencies (Next.js, React, React-DOM, Tailwind, PostCSS, ESLint, TypeScript)
  • tsconfig.json - TypeScript configuration with strict mode, ES2017 target, and Next.js plugin support
  • next.config.ts - Next.js configuration placeholder
  • postcss.config.mjs - PostCSS configuration with Tailwind plugin
  • config.json - Kit configuration defining "Meeting Intelligence Agent" with Groq and SMTP integrations

Frontend & UI:

  • app/layout.tsx - Next.js root layout with Geist fonts and metadata
  • app/page.tsx - React UI component for meeting analysis with form inputs, result display (summary, action items, decisions, follow-ups), and clipboard copy functionality
  • app/globals.css - Tailwind CSS integration with light/dark theme variables

Backend & API:

  • app/api/analyze/route.ts - Next.js POST API route that validates input and calls Lamatic workflow
  • actions/orchestrate.ts - Server-side action exporting analyzeMeeting() function for GraphQL workflow execution
  • lib/lamatic-client.ts - Lamatic API client with lamaticConfig and executeFlow() for managing workflow interactions

Flow Definition:

  • flows/meeting-notes-extractor/config.json - Main flow configuration
  • flows/meeting-notes-extractor/inputs.json - Input parameter definitions for LLM and SMTP nodes
  • flows/meeting-notes-extractor/meta.json - Flow metadata (name, description placeholders)
  • flows/meeting-notes-extractor/README.md - Flow documentation and contribution guidelines

Documentation:

  • README.md - Kit documentation with setup instructions, prerequisites, environment variables, local run steps, and Vercel deployment guidance

Meeting Notes Extractor Flow Architecture

Node Types & Workflow:

  1. API Request Node - Entry point accepting meetingNotes and recipientEmail payload
  2. Generate Text Node - LLM processor (Groq with Llama 3.3 70B) that transforms meeting notes into structured JSON containing: summary, action items (with task/owner/deadline/priority), decisions, and follow-up questions
  3. Code Node - JSON parser that processes LLM output, constructs HTML email body, and handles parsing errors with fallback summary
  4. SMTP Node - Email delivery that sends formatted HTML email to recipient with meeting intelligence report
  5. API Response Node - Returns the raw LLM-generated response as result to the API caller

End-to-End Flow: API Request → Groq LLM (Llama 3.3 70B) → JSON Parsing & HTML Email Building → SMTP Email Delivery → API Response, enabling automated transformation of unstructured meeting notes into actionable intelligence and team notification.

@github-actions
Copy link
Copy Markdown

PR Validation Results

New Contributions Detected

  • Kit: kits/automation/meeting-intelligence

Check Results

Check Status
No edits to existing projects ✅ Pass
Required root files present ✅ Pass
Flow folder structure valid ✅ Pass
No changes outside contribution dirs ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • agentkit-challenge

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: de39aa7b-6df2-405d-a6f2-19269f9176a8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This mission introduces the Meeting Intelligence Agent kit—a complete Next.js application integrated with Lamatic workflows. The system extracts action items, decisions, and summaries from meeting notes via LLM processing, formats results into HTML emails, and delivers them via SMTP. Core infrastructure, API handlers, UI components, and Lamatic flow configurations are all established.

Changes

Cohort / File(s) Summary
Project Foundation
.gitignore, package.json, tsconfig.json, next.config.ts, postcss.config.mjs
Added npm project metadata, TypeScript strict-mode configuration with Next.js plugin support, empty Next.js config, PostCSS/Tailwind setup, and .gitignore excluding node_modules/, .env files, and .next/ build output.
Documentation
README.md, flows/meeting-notes-extractor/README.md
Added root README outlining kit purpose, workflow, Lamatic architecture, setup instructions, and example output; added flow README describing 5-node structure and contribution guidelines.
Configuration & Metadata
config.json, flows/meeting-notes-extractor/config.json, flows/meeting-notes-extractor/inputs.json, flows/meeting-notes-extractor/meta.json
Added kit-level config declaring integration requirements and enabled features; added flow config defining multi-node workflow (API Request → LLM → Code Node → SMTP → Response) with JSON parsing and HTML email generation; added input parameter definitions for LLM model and SMTP credentials; added flow metadata manifest.
Styling & Layout
app/globals.css, app/layout.tsx
Added Tailwind CSS integration with root theme variables for light/dark modes and body styling; added Next.js root layout exporting metadata and applying Geist font families.
API & Server Integration
actions/orchestrate.ts, lib/lamatic-client.ts, app/api/analyze/route.ts
Added server-side async action calling Lamatic GraphQL workflow API with meeting notes and email; added reusable Lamatic client library managing API configuration and executeFlow GraphQL mutations; added POST route handler accepting meeting notes and recipient email, forwarding to Lamatic, and returning parsed results.
UI & Client Components
app/page.tsx
Added client-side Next.js page with form for meeting notes and recipient email, async analysis via /api/analyze, conditional result rendering (summary, action items with owner/deadline/priority, decisions, follow-up questions), and "Copy All" clipboard functionality.

Suggested reviewers

  • amanintech
  • d-pamneja

This message will self-destruct in 5 seconds. Your assignment: review this Meeting Intelligence Agent kit implementation for correctness of Lamatic API integration, Next.js configuration, flow logic, and UI completeness. Good luck.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: introducing a Meeting Intelligence Agent kit that transforms meeting notes into action items.
Description check ✅ Passed The description covers most required sections: contribution type (kit), general requirements (no secrets, folder structure), file structure validation, and a completed PR checklist matching the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AnuragDubey007
Copy link
Copy Markdown
Author

@coderabbitai review
Label: mission-possible

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

@AnuragDubey007 — Agent, your mission has been acknowledged. 🎯

This message will self-destruct in five seconds... just kidding. Initiating a full review of PR #149 — the Meeting Intelligence Agent kit. I'll be scanning the drop point (kits/automation/meeting-intelligence/) for any vulnerabilities, structural deviations, or exposed credentials before this operation goes live.

⚠️ Standing directive from prior intelligence: All Lamatic credentials (LAMATIC_PROJECT_ENDPOINT, LAMATIC_PROJECT_ID, LAMATIC_PROJECT_API_KEY, LAMATIC_FLOW_ID) and any JWT secrets must be server-only env vars — no NEXT_PUBLIC_ prefix. API routes require server-side JWT authentication using the jose library (HS256, 2-minute TTL). I'll be verifying compliance during the sweep.

Good luck. The Agency is watching. 🕵️


🧠 Learnings used
Learnt from: amanintech
Repo: Lamatic/AgentKit PR: 80
File: kits/automation/support-triage/app/utils.ts:0-0
Timestamp: 2026-03-27T19:13:32.229Z
Learning: In `kits/automation/support-triage`, the maintainer (amanintech) requires server-side JWT authentication for API routes. Use the `jose` library with an `HS256` short-lived JWT (2-minute TTL) issued by `/api/token` and verified in `/api/triage`. The JWT_SECRET must be a non-NEXT_PUBLIC_ env var. All Lamatic credentials (LAMATIC_PROJECT_ENDPOINT, LAMATIC_PROJECT_ID, LAMATIC_PROJECT_API_KEY, LAMATIC_FLOW_ID) must also be non-NEXT_PUBLIC_ and server-only.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot requested review from amanintech and d-pamneja April 21, 2026 17:45
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@kits/automation/meeting-intelligence/actions/orchestrate.ts`:
- Around line 3-36: analyzeMeeting contains duplicated raw GraphQL logic and
should be removed or refactored to use the shared SDK: delete the orphaned
server action file if there are no call sites; otherwise replace the body of
analyzeMeeting to import executeFlow from lib/lamatic-client.ts, call
executeFlow({ workflowId: process.env.LAMATIC_FLOW_ID, payload: { meetingNotes,
recipientEmail } }) and return its result, and ensure environment flow IDs are
read from process.env as in the existing SDK abstraction.

In `@kits/automation/meeting-intelligence/app/api/analyze/route.ts`:
- Around line 6-40: Replace the in-file GraphQL fetch in analyze/route.ts with a
call to the shared Lamatic client: locate the duplicated logic that builds the
query, headers, variables (using workflowId, meetingNotes, recipientEmail) and
the response extraction, and instead call the exported executeFlow (or
executeWorkflow/executeFlowAsync) function from lib/lamatic-client.ts passing
meetingNotes and recipientEmail (and letting it supply auth/project/workflowId);
return the executeFlow result (or map its response to the same shape the route
expects) and remove the local fetch/query/response.json/result extraction so all
Lamatic request behavior is centralized in executeFlow.
- Around line 3-40: Protect the POST handler in route.ts by verifying an HS256
JWT from the Authorization: Bearer <token> header using the jose library and the
JWT_SECRET env var before executing the Lamatic call: in POST(req: NextRequest)
extract the bearer token, run jwtVerify(token, new
TextEncoder().encode(process.env.JWT_SECRET)) and return 401/403 for
missing/invalid tokens; only proceed to build and call Lamatic when verification
succeeds. Also add a new /api/token endpoint (e.g., a new POST handler) that
authenticates the client (validate a simple client credential or shared secret
from an env var like CLIENT_AUTH_SECRET) and issues a short-lived HS256 token
signed with process.env.JWT_SECRET and exp = 2 minutes (use jose SignJWT).
Ensure all token-related errors return appropriate 401 responses and do not
change the existing Lamatic call logic in POST except gating it behind the
verified token check.

In `@kits/automation/meeting-intelligence/app/globals.css`:
- Around line 22-26: The body selector in globals.css currently hard-codes
"font-family: Arial, Helvetica, sans-serif", which overrides the theme token
exposed as --font-sans in layout.tsx; either remove the body font-family
declaration or change it to use the theme token (font-family: var(--font-sans))
so the Geist font (--font-geist-sans) can take effect; update the body rule in
globals.css to reference --font-sans (or delete the rule) and verify layout.tsx
continues to set --font-sans correctly.

In `@kits/automation/meeting-intelligence/app/layout.tsx`:
- Around line 15-18: The exported metadata object (export const metadata:
Metadata) still contains the scaffold defaults ("Create Next App" / "Generated
by create next app"); update the metadata constant in layout.tsx to use
kit-appropriate values (e.g., title: "Meeting Intelligence" and a descriptive
description such as "AI-powered meeting summaries and insights from the Meeting
Intelligence kit") so the browser tab, social previews, and SEO reflect the app
identity.

In `@kits/automation/meeting-intelligence/app/page.tsx`:
- Around line 56-72: The copyToClipboard function currently calls
navigator.clipboard.writeText without awaiting it and immediately shows an
alert; make copyToClipboard async, await navigator.clipboard.writeText(text),
handle errors with a try/catch, call setError(...) on failure (and avoid showing
the success alert when writeText rejects), and only show the "Copied to
clipboard!" alert when the awaited writeText completes successfully; reference
the copyToClipboard function, result, navigator.clipboard.writeText, and
setError state in your changes.
- Around line 138-140: Replace inline SVG spinner and emoji/inline icons in the
component with lucide-react components: swap the spinner SVG (the animate-spin
circle/path) for Loader2, and replace emojis with ClipboardList, CheckCircle2,
User, Calendar, Hammer, and CircleHelp respectively; update any decorative
checkmark/question elements to use the appropriate icon variants from
lucide-react. Also fix the clipboard copy handler that calls
navigator.clipboard.writeText() by awaiting the Promise and only showing the
success alert after the await resolves, and add a catch to handle and surface
copy failures. Locate these changes around the spinner SVG, the emoji icon
usages (previously at lines referenced in the review), and the clipboard call to
navigator.clipboard.writeText() to apply the fixes.

In `@kits/automation/meeting-intelligence/config.json`:
- Around line 1-27: The config.json contains an empty documentationUrl which
will render as a dead link; update the "documentationUrl" field in config.json
to either a valid documentation URL (e.g., the kit README or demo docs) or
remove the "documentationUrl" key entirely so the catalog won't render an empty
anchor—ensure you modify the "documentationUrl" property in the existing JSON
rather than adding a duplicate key.

In
`@kits/automation/meeting-intelligence/flows/meeting-notes-extractor/config.json`:
- Around line 53-62: The config.json export includes account-specific credential
bindings (fields credentialId and credential_name inside the generativeModelName
entry for configA) and a personal SMTP credential; remove these sensitive
identifiers by clearing credentialId and credential_name (or setting them
null/empty) and ensure the node in the Lamatic Studio editor is unbound so users
must supply credentials via inputs.json; re-open the flow in the Studio node
editor, unbind/clear any credential selections for the generativeModelName node
(configName "configA") and the SMTP node, save and re-export the config.json so
the exported flow contains no account-specific credential bindings.

In
`@kits/automation/meeting-intelligence/flows/meeting-notes-extractor/meta.json`:
- Around line 3-8: The meta.json manifest for the Meeting Notes Extractor flow
is missing metadata fields; populate the "description", "tags", "testInput",
"githubUrl", "documentationUrl", and "deployUrl" keys with meaningful values (or
remove unused keys) so the kit catalog can render the card correctly; update the
"description" to a concise summary of the flow, add one or more comma-separated
"tags" for discovery, provide a representative "testInput" transcript snippet,
and fill "githubUrl", "documentationUrl", and "deployUrl" with the appropriate
repo/docs/deployment links (or omit keys if not applicable).

In
`@kits/automation/meeting-intelligence/flows/meeting-notes-extractor/README.md`:
- Around line 20-24: The package manifest currently omits README.md so exported
flows miss a required file; update the flow export manifest/packaging
configuration (the files array or export list for the flow export) to include
"README.md" alongside "config.json", "inputs.json", and "meta.json" so all four
required files in the flows/ directory are bundled; locate the export
configuration or function responsible for building the flow package (e.g., the
manifest/files array or export list used by the flow exporter) and add
"README.md" to that list, then run the flow export to verify README.md is
included.

In `@kits/automation/meeting-intelligence/lib/lamatic-client.ts`:
- Around line 8-39: The executeFlow function silently swallows failures and can
hang; update executeFlow to (1) tighten the payload type to { meetingNotes:
string; recipientEmail: string } so callers can't pass unexpected keys, (2)
attach an AbortController with a configurable timeout to the fetch call using
lamaticConfig or a default, (3) check response.ok and, if false, parse and
include HTTP status and body text in a structured error, (4) defensively parse
JSON (handle non-JSON body) and surface GraphQL-level errors by returning or
throwing a detailed object that includes response.status, statusText, any parsed
errors array, and the raw body, and (5) avoid returning a generic { error: "No
result" } so callers (e.g., actions/orchestrate.ts and app/api/analyze/route.ts)
can distinguish auth/validation/server/parse/timeout failures; locate and modify
executeFlow, lamaticConfig usage, and the fetch/response handling to implement
these changes.
- Around line 1-6: Replace the custom fetch+GraphQL implementation in
lib/lamatic-client.ts (and the exported lamaticConfig object) with the standard
SDK pattern used elsewhere: validate presence of process.env.LAMATIC_API_URL,
process.env.LAMATIC_PROJECT_ID and process.env.LAMATIC_API_KEY early and throw a
clear Error if missing, then instantiate and export a single lamaticClient = new
Lamatic({ endpoint: process.env.LAMATIC_API_URL, projectId:
process.env.LAMATIC_PROJECT_ID, apiKey: process.env.LAMATIC_API_KEY }); remove
the brittle hardcoded GraphQL query logic that only handles
meetingNotes/recipientEmail so payload keys aren’t dropped and rely on the SDK’s
typing/retries/schema validation instead.

In `@kits/automation/meeting-intelligence/package.json`:
- Around line 16-25: Update package.json devDependencies to use exact pinned
versions instead of caret ranges: replace "@tailwindcss/postcss", "@types/node",
"@types/react", "@types/react-dom", "eslint", "eslint-config-next",
"tailwindcss", and "typescript" entries in the devDependencies object with
concrete version strings you have tested (no ^ or ~), ensuring each value is a
single exact version; keep the same keys and only change the version strings so
builds are reproducible.
- Line 9: The package.json "lint" script currently is just "eslint" with no
target; update the "lint" npm script entry (the "lint" key in package.json) to
invoke ESLint against the current directory (e.g., include "./" or "." as the
target) so it runs deterministically after the Next.js upgrade—modify the "lint"
script value to include the directory target.

In `@kits/automation/meeting-intelligence/README.md`:
- Around line 118-125: The README currently instructs users to recreate the five
Lamatic nodes manually; instead update it to tell users to import the shipped
flow export at flows/meeting-notes-extractor/ into Lamatic Studio, deploy that
imported flow, and set its private inputs (SMTP and project credentials) via the
flow's inputs (e.g., inputs.json) or Lamatic Connections; ensure you reference
the included export files (config.json, inputs.json, meta.json, README.md) and
instruct users to copy the Flow ID and any required project credentials into
.env.local after import.
- Around line 93-99: Replace the standalone repo clone instructions with steps
that instruct users to clone the main AgentKit repository and then change into
this kit's directory; specifically update the README.md's setup section to run
git clone for the AgentKit repo and then cd into
kits/automation/meeting-intelligence so users land in this kit (edit the section
that currently contains the standalone repo URL and thegit clone/cd commands).
- Around line 193-194: Update the broken relative link to the repository
CONTRIBUTING.md in the README: locate the link text "CONTRIBUTING.md" in
kits/automation/meeting-intelligence/README.md (the lines containing "See
[CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.") and change the path
from ../../CONTRIBUTING.md to ../../../CONTRIBUTING.md so it correctly points to
the repository root CONTRIBUTING.md.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: 95945cc0-5cd3-4bff-957b-b02e0fda8aa4

📥 Commits

Reviewing files that changed from the base of the PR and between 113298a and 543d9cb.

⛔ Files ignored due to path filters (6)
  • kits/automation/meeting-intelligence/app/favicon.ico is excluded by !**/*.ico
  • kits/automation/meeting-intelligence/public/file.svg is excluded by !**/*.svg
  • kits/automation/meeting-intelligence/public/globe.svg is excluded by !**/*.svg
  • kits/automation/meeting-intelligence/public/next.svg is excluded by !**/*.svg
  • kits/automation/meeting-intelligence/public/vercel.svg is excluded by !**/*.svg
  • kits/automation/meeting-intelligence/public/window.svg is excluded by !**/*.svg
📒 Files selected for processing (18)
  • kits/automation/meeting-intelligence/.env.example
  • kits/automation/meeting-intelligence/.gitignore
  • kits/automation/meeting-intelligence/README.md
  • kits/automation/meeting-intelligence/actions/orchestrate.ts
  • kits/automation/meeting-intelligence/app/api/analyze/route.ts
  • kits/automation/meeting-intelligence/app/globals.css
  • kits/automation/meeting-intelligence/app/layout.tsx
  • kits/automation/meeting-intelligence/app/page.tsx
  • kits/automation/meeting-intelligence/config.json
  • kits/automation/meeting-intelligence/flows/meeting-notes-extractor/README.md
  • kits/automation/meeting-intelligence/flows/meeting-notes-extractor/config.json
  • kits/automation/meeting-intelligence/flows/meeting-notes-extractor/inputs.json
  • kits/automation/meeting-intelligence/flows/meeting-notes-extractor/meta.json
  • kits/automation/meeting-intelligence/lib/lamatic-client.ts
  • kits/automation/meeting-intelligence/next.config.ts
  • kits/automation/meeting-intelligence/package.json
  • kits/automation/meeting-intelligence/postcss.config.mjs
  • kits/automation/meeting-intelligence/tsconfig.json

Comment on lines +3 to +36
export async function analyzeMeeting(meetingNotes: string, recipientEmail: string) {
const query = `
query ExecuteWorkflow($workflowId: String!, $meetingNotes: String, $recipientEmail: String) {
executeWorkflow(
workflowId: $workflowId
payload: { meetingNotes: $meetingNotes, recipientEmail: $recipientEmail }
) {
status
result
}
}
`;

const response = await fetch(process.env.LAMATIC_API_URL!, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
"x-project-id": process.env.LAMATIC_PROJECT_ID!,
},
body: JSON.stringify({
query,
variables: {
workflowId: process.env.LAMATIC_FLOW_ID,
meetingNotes,
recipientEmail,
},
}),
});

const data = await response.json();
const result = data?.data?.executeWorkflow?.result?.result;
return result ?? { error: "No result" };
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Expect: either no call sites for analyzeMeeting (safe to remove) or SDK-backed flow invocation.
rg -nP -C3 '\banalyzeMeeting\s*\(' kits/automation/meeting-intelligence
rg -nP -C3 '(`@lamatic`|Lamatic|executeWorkflow|executeFlow)' kits/automation/meeting-intelligence
fd -i '^package\.json$' kits/automation/meeting-intelligence -x sh -c 'printf "\n== %s ==\n" "$1"; sed -n "1,220p" "$1"' sh {}

Repository: Lamatic/AgentKit

Length of output: 16240


Mission critical: eliminate the orphaned server action and route flow execution through the shared abstraction.

analyzeMeeting() violates the kit guideline by using raw GraphQL fetch instead of the SDK-backed executeFlow() abstraction already present in lib/lamatic-client.ts. The function has no call sites in the codebase and duplicates logic that exists elsewhere. Remove this server action entirely; if flow invocation from a server action is needed, refactor to import and use executeFlow() from lamatic-client.ts.

Per coding guidelines, kit server action files must call Lamatic flows via the SDK and read flow IDs from environment variables. This file currently bypasses the shared abstraction and maintains dead code.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/automation/meeting-intelligence/actions/orchestrate.ts` around lines 3 -
36, analyzeMeeting contains duplicated raw GraphQL logic and should be removed
or refactored to use the shared SDK: delete the orphaned server action file if
there are no call sites; otherwise replace the body of analyzeMeeting to import
executeFlow from lib/lamatic-client.ts, call executeFlow({ workflowId:
process.env.LAMATIC_FLOW_ID, payload: { meetingNotes, recipientEmail } }) and
return its result, and ensure environment flow IDs are read from process.env as
in the existing SDK abstraction.

Comment thread kits/automation/meeting-intelligence/app/api/analyze/route.ts
Comment on lines +6 to +40
const query = `
query ExecuteWorkflow($workflowId: String!, $meetingNotes: String, $recipientEmail: String) {
executeWorkflow(
workflowId: $workflowId
payload: { meetingNotes: $meetingNotes, recipientEmail: $recipientEmail }
) {
status
result
}
}
`;

const response = await fetch(process.env.LAMATIC_API_URL!, {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
"x-project-id": process.env.LAMATIC_PROJECT_ID!,
},
body: JSON.stringify({
query,
variables: {
workflowId: process.env.LAMATIC_FLOW_ID,
meetingNotes,
recipientEmail,
},
}),
});

const data = await response.json();


const result = data?.data?.executeWorkflow?.result?.result;

return NextResponse.json(result ?? { error: "No result" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Mission cleanup: reuse the shared Lamatic flow client.

This route duplicates the GraphQL query, headers, variables, and result extraction already present in lib/lamatic-client.ts. After adding auth, call executeFlow() here to keep Lamatic request behavior in one place.

♻️ Proposed refactor
 import { NextRequest, NextResponse } from "next/server";
+import { executeFlow } from "@/lib/lamatic-client";

 export async function POST(req: NextRequest) {
   const { meetingNotes, recipientEmail } = await req.json();
-
-  const query = `
-    query ExecuteWorkflow($workflowId: String!, $meetingNotes: String, $recipientEmail: String) {
-      executeWorkflow(
-        workflowId: $workflowId
-        payload: { meetingNotes: $meetingNotes, recipientEmail: $recipientEmail }
-      ) {
-        status
-        result
-      }
-    }
-  `;
-
-  const response = await fetch(process.env.LAMATIC_API_URL!, {
-    method: "POST",
-    headers: {
-      "Content-Type": "application/json",
-      "Authorization": `Bearer ${process.env.LAMATIC_API_KEY}`,
-      "x-project-id": process.env.LAMATIC_PROJECT_ID!,
-    },
-    body: JSON.stringify({
-      query,
-      variables: {
-        workflowId: process.env.LAMATIC_FLOW_ID,
-        meetingNotes,
-        recipientEmail,
-      },
-    }),
-  });
-
-  const data = await response.json();
-  
-  
-  const result = data?.data?.executeWorkflow?.result?.result;
-
-  return NextResponse.json(result ?? { error: "No result" });
+  const result = await executeFlow({ meetingNotes, recipientEmail });
+  return NextResponse.json(result);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@kits/automation/meeting-intelligence/app/api/analyze/route.ts` around lines 6
- 40, Replace the in-file GraphQL fetch in analyze/route.ts with a call to the
shared Lamatic client: locate the duplicated logic that builds the query,
headers, variables (using workflowId, meetingNotes, recipientEmail) and the
response extraction, and instead call the exported executeFlow (or
executeWorkflow/executeFlowAsync) function from lib/lamatic-client.ts passing
meetingNotes and recipientEmail (and letting it supply auth/project/workflowId);
return the executeFlow result (or map its response to the same shape the route
expects) and remove the local fetch/query/response.json/result extraction so all
Lamatic request behavior is centralized in executeFlow.

Comment thread kits/automation/meeting-intelligence/app/globals.css
Comment thread kits/automation/meeting-intelligence/app/layout.tsx
Comment thread kits/automation/meeting-intelligence/package.json Outdated
Comment thread kits/automation/meeting-intelligence/package.json
Comment thread kits/automation/meeting-intelligence/README.md Outdated
Comment thread kits/automation/meeting-intelligence/README.md
Comment thread kits/automation/meeting-intelligence/README.md Outdated
AnuragDubey007 and others added 7 commits April 22, 2026 01:13
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Replaced raw fetch call with executeFlow function for executing workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant