Skip to content

2 Agent Examples (Quickstart & Guardrails)#222

Merged
PaulAsjes merged 9 commits intomainfrom
agents
Mar 26, 2026
Merged

2 Agent Examples (Quickstart & Guardrails)#222
PaulAsjes merged 9 commits intomainfrom
agents

Conversation

@tadaspetra
Copy link
Copy Markdown
Collaborator

@tadaspetra tadaspetra commented Mar 25, 2026

Two more examples in the examples repo. Main review should be the 2 PROMPT.md files.

Nextjs Quickstart for Agents

  • create an agent
  • load an agent
  • talk to an agent

Nextjs Guardrails for Agents

  • create an agent with guardrails
  • load an agent
  • talk to an agent
  • stop conversation and show custom UI on guardrail trigger

Note

Low Risk
Adds new, self-contained Next.js example projects and setup scripts; changes are isolated to demo code but touch server-side API key usage and agent creation calls.

Overview
Adds two new Next.js agent demos under agents/nextjs: a Quickstart example for creating an ElevenLabs voice agent and starting WebRTC sessions, and a Guardrails example that configures platform guardrails (prompt-injection + custom investment-advice blocking) and surfaces the guardrail_triggered event in the UI.

Both examples include server routes (/api/agent, /api/conversation-token) that keep ELEVENLABS_API_KEY on the server, plus setup scripts (setup.sh), env templates, and minimal UI/transcript handling (including a shared LiveWaveform component and Tailwind/shadcn scaffolding).

Written by Cursor Bugbot for commit ab816c5. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Autofix Details

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Setup script creates wrong API route directory
    • Updated the quickstart setup script to create app/api/agent and app/api/conversation-token instead of the unrelated scribe-token directory.
  • ✅ Fixed: Tentative agent lines never replaced by final text
    • Changed onMessage to replace the last tentative transcript line with the finalized agent text before falling back to deduplication or append behavior.
  • ✅ Fixed: Unused @elevenlabs/client dependency in quickstart package
    • Removed @elevenlabs/client from the quickstart package and from the setup script so regenerated examples no longer inherit the unused dependency.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Guardrail status never resets between sessions
    • Starting a new session now resets guardrailFired before clearing the transcript so the banner only reflects the current session.

@tadaspetra tadaspetra requested a review from PaulAsjes March 25, 2026 19:13
@PaulAsjes PaulAsjes merged commit 496713b into main Mar 26, 2026
2 checks passed
@PaulAsjes PaulAsjes deleted the agents branch March 26, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants