diff --git a/.gitignore b/.gitignore index d6d1bdc3..d45b1300 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/.DS_Store - -.env \ No newline at end of file +.env +node_modules/ +.next/ diff --git a/kits/automation/meeting-action-agent/.env.example b/kits/automation/meeting-action-agent/.env.example new file mode 100644 index 00000000..b68318e9 --- /dev/null +++ b/kits/automation/meeting-action-agent/.env.example @@ -0,0 +1,4 @@ +MEETING_ACTION_FLOW_ID="your-flow-id-here" +LAMATIC_API_URL="https://your-org.lamatic.dev/graphql" +LAMATIC_PROJECT_ID="your-project-id-here" +LAMATIC_API_KEY="your-api-key-here" \ No newline at end of file diff --git a/kits/automation/meeting-action-agent/.gitignore b/kits/automation/meeting-action-agent/.gitignore new file mode 100644 index 00000000..b28ea810 --- /dev/null +++ b/kits/automation/meeting-action-agent/.gitignore @@ -0,0 +1,27 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules + +# next.js +/.next/ +/out/ + +# production +/build + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files +.env + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts \ No newline at end of file diff --git a/kits/automation/meeting-action-agent/README.md b/kits/automation/meeting-action-agent/README.md new file mode 100644 index 00000000..53069090 --- /dev/null +++ b/kits/automation/meeting-action-agent/README.md @@ -0,0 +1,147 @@ +# πŸ“‹ Meeting Action Items Agent + +> **Problem:** After meetings, notes live in one place while tasks, docs, and follow-up emails live in others β€” so owners, deadlines, and priorities get lost in manual cleanup. +> **This kit:** One Lamatic flow + UI turns **pasted** notes or a transcript into **structured** decisions, **prioritized** action items (owner + deadline), a **markdown** summary, and a **ready-to-send** email draft β€” so you’re not re-typing the same meeting three times. + +Built with [Lamatic AgentKit](https://github.com/Lamatic/AgentKit) Β· [Lamatic Studio](https://studio.lamatic.ai) Β· Next.js + +**v1 scope:** text in (notes / pasted transcript). Audio file upload is out of scope for this kit. + +--- + +## ✨ What It Does + +Paste any raw meeting notes, transcript, or summary and the agent will automatically extract: + +- βœ… **Key Decisions** β€” numbered list of decisions made in the meeting +- 🎯 **Action Items** β€” each with an owner, deadline, and priority (High / Medium / Low) +- πŸ“„ **Meeting Summary** β€” a clean markdown report +- πŸ“§ **Follow-up Email Draft** β€” ready to copy and send to your team + +--- + +## πŸ—οΈ Architecture + +``` +User (pastes meeting notes) + ↓ +Next.js Frontend (app/page.tsx) + ↓ +Server Action (actions/orchestrate.ts) + ↓ +Lamatic Flow (API Request β†’ LLM β†’ API Response) + ↓ +Structured JSON output rendered in the UI +``` + +--- + +## πŸš€ Quick Start + +### Prerequisites + +| Tool | Version | +|------|---------| +| Node.js | 18+ | +| npm | 9+ | +| Lamatic Account | [lamatic.ai](https://lamatic.ai) | + +### 1. Clone the repo + +```bash +git clone https://github.com/Lamatic/AgentKit.git +cd AgentKit/kits/automation/meeting-action-agent +``` + +### 2. Set up environment variables + +```bash +cp .env.example .env.local +``` + +Edit `.env.local` and fill in your values: + +```env +MEETING_ACTION_FLOW_ID="your-flow-id" +LAMATIC_API_URL="https://your-org.lamatic.dev/graphql" +LAMATIC_PROJECT_ID="your-project-id" +LAMATIC_API_KEY="your-api-key" +``` + +> **Where to find these values:** +> - `MEETING_ACTION_FLOW_ID` β†’ Flow URL in Lamatic Studio (the UUID) +> - `LAMATIC_API_URL` β†’ Settings β†’ API Docs β†’ Endpoint +> - `LAMATIC_PROJECT_ID` β†’ Settings β†’ Project β†’ Project ID +> - `LAMATIC_API_KEY` β†’ Settings β†’ API Keys + +### 3. Install & run + +```bash +npm install +npm run dev +``` + +Open [http://localhost:3000](http://localhost:3000) and paste your meeting notes! + +--- + +## 🧠 Lamatic Flow Setup + +### Trigger +- **Type:** API Request +- **Input schema:** `{ "meeting_notes": "string" }` + +### LLM Node (Generate Text) +- **Model:** GPT-4o / GPT-4o-mini / Gemini 1.5 Pro +- **System prompt:** Instructs the model to extract decisions, action items, summary, and email as JSON +- **User message:** `{{trigger.meeting_notes}}` + +### Response +- **Output schema:** `{ "result": "{{LLMNode.output.generatedResponse}}" }` + +> See the exported flow files in the `flows/` folder. + +--- + +## πŸ“‚ Project Structure + +``` +kits/automation/meeting-action-agent/ +β”œβ”€β”€ .env.example # Environment variables template +β”œβ”€β”€ .gitignore +β”œβ”€β”€ README.md +β”œβ”€β”€ config.json # Kit metadata +β”œβ”€β”€ package.json +β”œβ”€β”€ actions/ +β”‚ └── orchestrate.ts # Server action calling Lamatic +β”œβ”€β”€ app/ +β”‚ β”œβ”€β”€ globals.css +β”‚ β”œβ”€β”€ layout.tsx +β”‚ └── page.tsx # Main UI +β”œβ”€β”€ components/ # shadcn/ui components +β”œβ”€β”€ flows/ # Exported Lamatic flow files +β”œβ”€β”€ lib/ +β”‚ └── lamatic-client.ts # Lamatic SDK client +└── hooks/ +``` + +--- + +## 🌐 Deploy to Vercel + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Lamatic/AgentKit&root-directory=kits/automation/meeting-action-agent&env=MEETING_ACTION_FLOW_ID,LAMATIC_API_URL,LAMATIC_PROJECT_ID,LAMATIC_API_KEY) + +1. Click the button above +2. Set the **Root Directory** to `kits/automation/meeting-action-agent` +3. Add all 4 environment variables +4. Deploy! + +--- + +## 🀝 Contributing + +This kit is part of [Lamatic AgentKit](https://github.com/Lamatic/AgentKit). See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines. + +## πŸ“œ License + +MIT β€” see [LICENSE](../../LICENSE) diff --git a/kits/automation/meeting-action-agent/actions/orchestrate.ts b/kits/automation/meeting-action-agent/actions/orchestrate.ts new file mode 100644 index 00000000..56553254 --- /dev/null +++ b/kits/automation/meeting-action-agent/actions/orchestrate.ts @@ -0,0 +1,94 @@ +"use server" + +import { lamaticClient } from "@/lib/lamatic-client" +import { normalizePriority } from "@/lib/priority" + +type Priority = "High" | "Medium" | "Low" + +function extractParsed(resData: any): any { + // Try every possible path the Lamatic SDK might use + const candidates = [ + resData?.result?.result, // {result: {result: {...}}} + resData?.result, // {result: {...}} + resData?.data?.result, // {data: {result: {...}}} + resData?.data, // {data: {...}} + resData, // top-level + ] + for (const c of candidates) { + if (c && typeof c === "object" && (c.decisions || c.action_items || c.summary_report)) { + return c + } + } + // If none matched, try parsing the first string candidate + for (const c of candidates) { + if (typeof c === "string") { + try { + const cleaned = c.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim() + if (cleaned.startsWith("{")) { + return JSON.parse(cleaned) + } + } catch {} + } + } + return null +} + +export async function analyzeMeeting(meetingNotes: string): Promise<{ + success: boolean + data?: { + decisions: string[] + action_items: Array<{ task: string; owner: string; deadline: string; priority: Priority }> + summary_report: string + followup_email: string + } + rawResult?: string + error?: string +}> { + try { + const flowId = process.env.MEETING_ACTION_FLOW_ID + if (!flowId) throw new Error("MEETING_ACTION_FLOW_ID is not set in environment variables.") + + const resData = await lamaticClient.executeFlow(flowId, { meeting_notes: meetingNotes }) + if (process.env.NODE_ENV !== "production") { + console.debug("[meeting-agent] SDK response received") + } + + const parsed = extractParsed(resData) + if (process.env.NODE_ENV !== "production") { + console.debug("[meeting-agent] Parsed payload extracted:", Boolean(parsed)) + } + + if (!parsed) { + // Return raw so the UI can show something + return { success: true, rawResult: JSON.stringify(resData, null, 2) } + } + + return { + success: true, + data: { + decisions: Array.isArray(parsed.decisions) ? parsed.decisions : [], + action_items: Array.isArray(parsed.action_items) + ? parsed.action_items.map((item: any) => ({ + task: item.task ?? "", + owner: item.owner ?? "Unassigned", + deadline: item.deadline ?? "TBD", + priority: normalizePriority(item.priority ?? "medium"), + })) + : [], + summary_report: parsed.summary_report ?? "", + followup_email: parsed.followup_email ?? "", + }, + } + } catch (error) { + console.error("[meeting-agent] Error during flow execution") + let errorMessage = "Unknown error occurred" + if (error instanceof Error) { + errorMessage = error.message + if (error.message.includes("fetch failed")) + errorMessage = "Network error: Cannot connect to the service." + else if (error.message.includes("API key")) + errorMessage = "Authentication error: Check your LAMATIC_API_KEY." + } + return { success: false, error: errorMessage } + } +} diff --git a/kits/automation/meeting-action-agent/app/globals.css b/kits/automation/meeting-action-agent/app/globals.css new file mode 100644 index 00000000..f4a49a29 --- /dev/null +++ b/kits/automation/meeting-action-agent/app/globals.css @@ -0,0 +1,153 @@ +@import "tailwindcss"; +@import "tw-animate-css"; + +@custom-variant dark (&:is(.dark *)); + +:root { + --background: oklch(1 0 0); + --foreground: oklch(0.145 0 0); + --card: oklch(1 0 0); + --card-foreground: oklch(0.145 0 0); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.145 0 0); + --primary: oklch(0.205 0 0); + --primary-foreground: oklch(0.985 0 0); + --secondary: oklch(0.97 0 0); + --secondary-foreground: oklch(0.205 0 0); + --muted: oklch(0.97 0 0); + --muted-foreground: oklch(0.556 0 0); + --accent: oklch(0.97 0 0); + --accent-foreground: oklch(0.205 0 0); + --destructive: oklch(0.577 0.245 27.325); + --destructive-foreground: oklch(0.577 0.245 27.325); + --border: oklch(0.922 0 0); + --input: oklch(0.922 0 0); + --ring: oklch(0.708 0 0); + --chart-1: oklch(0.646 0.222 41.116); + --chart-2: oklch(0.6 0.118 184.704); + --chart-3: oklch(0.398 0.07 227.392); + --chart-4: oklch(0.828 0.189 84.429); + --chart-5: oklch(0.769 0.188 70.08); + --radius: 0.625rem; + --sidebar: oklch(0.985 0 0); + --sidebar-foreground: oklch(0.145 0 0); + --sidebar-primary: oklch(0.205 0 0); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.97 0 0); + --sidebar-accent-foreground: oklch(0.205 0 0); + --sidebar-border: oklch(0.922 0 0); + --sidebar-ring: oklch(0.708 0 0); +} + +.dark { + --background: oklch(0.145 0 0); + --foreground: oklch(0.985 0 0); + --card: oklch(0.145 0 0); + --card-foreground: oklch(0.985 0 0); + --popover: oklch(0.145 0 0); + --popover-foreground: oklch(0.985 0 0); + --primary: oklch(0.985 0 0); + --primary-foreground: oklch(0.205 0 0); + --secondary: oklch(0.269 0 0); + --secondary-foreground: oklch(0.985 0 0); + --muted: oklch(0.269 0 0); + --muted-foreground: oklch(0.708 0 0); + --accent: oklch(0.269 0 0); + --accent-foreground: oklch(0.985 0 0); + --destructive: oklch(0.396 0.141 25.723); + --destructive-foreground: oklch(0.637 0.237 25.331); + --border: oklch(0.269 0 0); + --input: oklch(0.269 0 0); + --ring: oklch(0.439 0 0); + --chart-1: oklch(0.488 0.243 264.376); + --chart-2: oklch(0.696 0.17 162.48); + --chart-3: oklch(0.769 0.188 70.08); + --chart-4: oklch(0.627 0.265 303.9); + --chart-5: oklch(0.645 0.246 16.439); + --sidebar: oklch(0.205 0 0); + --sidebar-foreground: oklch(0.985 0 0); + --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.269 0 0); + --sidebar-accent-foreground: oklch(0.985 0 0); + --sidebar-border: oklch(0.269 0 0); + --sidebar-ring: oklch(0.439 0 0); +} + +@theme inline { + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-destructive-foreground: var(--destructive-foreground); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); +} + +@layer base { + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } + + .prose-invert { + color: rgb(255, 255, 255); + } + + .prose-invert p, + .prose-invert ul, + .prose-invert ol, + .prose-invert li, + .prose-invert strong, + .prose-invert em, + .prose-invert span, + .prose-invert div { + color: rgb(229, 231, 235) !important; + } + + .prose-invert strong { + color: rgb(255, 255, 255) !important; + font-weight: 600; + } + + .prose-invert ul, + .prose-invert ol { + padding-left: 1.5rem; + margin: 0.5rem 0; + } + + .prose-invert li { + margin: 0.25rem 0; + } +} diff --git a/kits/automation/meeting-action-agent/app/layout.tsx b/kits/automation/meeting-action-agent/app/layout.tsx new file mode 100644 index 00000000..c10cf18b --- /dev/null +++ b/kits/automation/meeting-action-agent/app/layout.tsx @@ -0,0 +1,28 @@ +import type { Metadata } from 'next' +import { Geist, Geist_Mono } from 'next/font/google' +import { Analytics } from '@vercel/analytics/next' +import './globals.css' + +const _geist = Geist({ subsets: ["latin"] }); +const _geistMono = Geist_Mono({ subsets: ["latin"] }); + +export const metadata: Metadata = { + title: 'Meeting Action Items Agent | Lamatic AgentKit', + description: 'Paste raw meeting notes and instantly extract prioritized action items, key decisions, and a follow-up email draft β€” powered by Lamatic AI.', + keywords: ['meeting', 'action items', 'AI', 'productivity', 'automation', 'lamatic'], +} + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode +}>) { + return ( + + + {children} + + + + ) +} diff --git a/kits/automation/meeting-action-agent/app/page.tsx b/kits/automation/meeting-action-agent/app/page.tsx new file mode 100644 index 00000000..a7c8b98d --- /dev/null +++ b/kits/automation/meeting-action-agent/app/page.tsx @@ -0,0 +1,376 @@ +"use client" + +import type React from "react" +import { useState } from "react" +import { Button } from "@/components/ui/button" +import { Textarea } from "@/components/ui/textarea" +import { Card } from "@/components/ui/card" +import { + Loader2, + Sparkles, + ClipboardList, + Copy, + Check, + RotateCcw, + CheckCircle2, + AlertCircle, + Clock, + User, + Mail, + FileText, +} from "lucide-react" +import { analyzeMeeting } from "@/actions/orchestrate" +import { normalizePriority } from "@/lib/priority" +import ReactMarkdown from "react-markdown" +import { Header } from "@/components/header" + +type Priority = "High" | "Medium" | "Low" + +type ActionItem = { + task: string + owner: string + deadline: string + priority: Priority +} + +type MeetingResult = { + decisions: string[] + action_items: ActionItem[] + summary_report: string + followup_email: string +} + +const priorityColors: Record = { + High: "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400 border border-red-200 dark:border-red-800", + Medium: + "bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800", + Low: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 border border-green-200 dark:border-green-800", +} + +const SAMPLE_NOTES = `Team Sync - March 21, 2026 + +Attendees: Alice (PM), Bob (Backend), Carol (Design), Dave (Frontend) + +Alice: We need to launch the new onboarding flow by April 5th. Agreed? +All: Yes, that works. + +Bob: The API integration is done. Still need Carol to finish the UI mockups. +Carol: I'll have the mockups ready by March 25th. +Dave: Once I have the mockups I can build it in 3 days. + +Alice: Bob, can you also write unit tests for the new endpoints? +Bob: Sure, I'll add those by March 28th. + +Alice: Dave, please also update the README with the new setup steps. +Dave: Will do, I'll get that done by March 26th. + +Decision: We will use Stripe for payments instead of PayPal. +Decision: The beta will be invite-only for the first 2 weeks.` + +export default function MeetingAgentPage() { + const [meetingNotes, setMeetingNotes] = useState("") + const [isLoading, setIsLoading] = useState(false) + const [result, setResult] = useState(null) + const [rawResult, setRawResult] = useState(null) + const [error, setError] = useState("") + const [copiedEmail, setCopiedEmail] = useState(false) + const [copiedReport, setCopiedReport] = useState(false) + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + if (!meetingNotes.trim()) { + setError("Please paste your meeting notes first.") + return + } + setIsLoading(true) + setError("") + setResult(null) + setRawResult(null) + + try { + const response = await analyzeMeeting(meetingNotes) + + if (response.success) { + if (response.data) { + // Best case: structured data parsed correctly + setResult(response.data) + } else if (response.rawResult) { + // rawResult may be a string or an object β€” try to extract data from it + const raw = response.rawResult as any + if (typeof raw === "object" && raw !== null) { + // It's already a parsed object β€” check nested shapes + const inner = raw?.result ?? raw + if (inner?.decisions || inner?.action_items) { + setResult({ + decisions: Array.isArray(inner.decisions) ? inner.decisions : [], + action_items: Array.isArray(inner.action_items) + ? inner.action_items.map((item: any) => ({ + task: item.task ?? "", + owner: item.owner ?? "Unassigned", + deadline: item.deadline ?? "TBD", + priority: normalizePriority(item.priority), + })) + : [], + summary_report: inner.summary_report ?? "", + followup_email: inner.followup_email ?? "", + }) + } else { + setRawResult(JSON.stringify(raw, null, 2)) + } + } else { + setRawResult(String(raw)) + } + } + } else { + setError(response.error || "Analysis failed. Please try again.") + } + } catch (err) { + setError(err instanceof Error ? err.message : "An unexpected error occurred.") + } finally { + setIsLoading(false) + } + } + + const handleReset = () => { + setResult(null) + setRawResult(null) + setMeetingNotes("") + setError("") + setCopiedEmail(false) + setCopiedReport(false) + } + + const handleCopyEmail = async () => { + if (!result?.followup_email) return + await navigator.clipboard.writeText(result.followup_email) + setCopiedEmail(true) + setTimeout(() => setCopiedEmail(false), 2000) + } + + const handleCopyReport = async () => { + if (!result?.summary_report) return + await navigator.clipboard.writeText(result.summary_report) + setCopiedReport(true) + setTimeout(() => setCopiedReport(false), 2000) + } + + return ( +
+
+ +
+ {/* Input form β€” shown when no result yet */} + {!result && !rawResult && ( +
+
+
+
+
+ +
+
+

Meeting Action Agent

+

+ Paste your meeting notes and instantly get prioritized action items, decisions, and a follow-up email. +

+
+ + +
+
+ +