Skip to content

byte5digital/meetup-wedding-planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’ Meetup Wedding Planner β€” Hackathon Edition

A Laravel + Livewire wedding-planning app. Couples can manage their wedding, browse a vendor directory, send inquiries to vendors, and chat with an AI assistant that helps them brainstorm.

Your job at the hackathon: build that AI assistant.

Everything around the agent is already wired up β€” the chat UI, the message storage, the vendor directory with embeddings β€” but the agent itself has been removed. You'll write it from scratch using laravel/ai.


What's already done

  • πŸ” Auth (Laravel Fortify), wedding management, guests, etc.
  • πŸͺ Vendor directory with services, prices, categories.
  • 🧠 Vendor service embeddings β€” every VendorService has an embedding column populated automatically via App\Observers\VendorServiceObserver so you can do semantic search out of the box.
  • πŸ’¬ AI chat UI (Livewire) β€” sidebar, message bubbles, conversation history. See app/Livewire/Weddings/AiChats.php and resources/views/livewire/weddings/ai-chats.blade.php.
  • πŸ—ƒοΈ Persistent conversations β€” AgentConversation + AgentConversationMessage models are managed by laravel/ai's RemembersConversations trait. You don't need to write any persistence code.
  • 🎨 A "suggested inquiry" card already renders in the chat when the agent emits a tool call named suggest_inquiry. See app/Models/AgentConversationMessage::inquirySuggestions() and resources/views/components/ai-chat/message-bubble.blade.php.

What you need to build

Two files, both deleted on purpose:

1. app/Ai/Agents/WeddingPlannerAgent.php

A conversational agent that helps the couple plan their wedding. It should:

  • Implement Laravel\Ai\Contracts\Agent, Conversational, and HasTools.
  • Use the Promptable and RemembersConversations traits.
  • Accept the Wedding in its constructor so it can personalize replies (title, event date, etc.).
  • Expose two tools:
    • SimilaritySearch (built into laravel/ai) over App\Models\VendorService on the embedding column. This lets the LLM search the vendor directory by natural language ("warm cinematic photographer", "wild foraged florist Berlin", …).
    • A custom suggest_inquiry tool (see below) that drafts a vendor inquiry the couple can review.

2. app/Ai/Tools/SuggestInquiryTool.php

A custom tool that drafts an inquiry to a vendor. It should:

  • Implement Laravel\Ai\Contracts\Tool.
  • Be named exactly suggest_inquiry β€” the UI already looks for that name and will render a styled "Suggested inquiry" card when the agent calls it.
  • Accept arguments roughly like: service_category (string, required), subject (string, required), body (string, required), budget (number, optional).
  • Return a short confirmation string from handle().

3. Wire it up

Open app/Actions/Wedding/AiChat/SendChatMessage.php β€” there's a throw in there marking the spot. Replace it with something like:

(new WeddingPlannerAgent($chat->wedding))
    ->continue($chat->conversation_id, as: $user)
    ->prompt($body);

Then open a wedding and switch to the AI chats tab (/weddings/{wedding}?tab=ai-chats), start a chat, and try it.


Stretch goals

Pick whichever sounds fun:

  • 🎯 Actually create the inquiry. Right now suggest_inquiry only drafts a card. Add a button on the card that POSTs to a new action and creates a real Inquiry record for a chosen vendor.
  • πŸ› οΈ More tools. A budget-summary tool, a guest-count tool, a timeline tool, a "set the wedding date" tool, …
  • πŸ” Streaming responses. laravel/ai agents support streaming β€” wire it to Livewire so tokens appear as they're generated.
  • 🌍 Locale-aware replies. The agent should answer in the user's locale.
  • πŸ§ͺ Tests. Pest 4 is set up β€” write feature tests for the agent's behavior (laravel/ai has a fake driver, see the docs).
  • 🎨 Better cards. Show matching vendors inline when SimilaritySearch returns results, not just the inquiry suggestion.

Getting started

Prerequisites

  • PHP 8.4+ (the project targets PHP 8.5 features where possible)
  • Composer 2
  • Node 20+ and npm
  • PostgreSQL 15+ running on 127.0.0.1:5432 β€” Laravel Herd Pro bundles it; otherwise install via brew install postgresql@17 or your package manager. Defaults in .env.example assume user root with no password (Herd's default).
  • An API key for at least one LLM provider β€” OpenAI is the default for chat and embeddings, so it's the easiest starting point.

No PHP installed? Skip to the Sail section below β€” you only need Docker.

Install & run

composer install
npm install
cp .env.example .env
php artisan key:generate
createdb -h 127.0.0.1 -U root meetup_wedding_planner   # one-time
# Add your OPENAI_API_KEY to .env first β€” the seeder generates real
# embeddings for each vendor service (a few cents of API cost).
php artisan migrate --seed
composer run dev   # serves the app + queue + vite + live logs via pail

Log in

The seeder creates a demo user:

  • Email: test@example.com
  • Password: password

A sample wedding, vendors, and inquiries are seeded too β€” log in and you'll see a wedding ready to chat about.

LLM provider

Put your key in .env:

OPENAI_API_KEY=sk-...

config/ai.php defaults to OpenAI for chat, Gemini for embeddings, and Gemini for images. For the hackathon we recommend a cheap fast model β€” set it on the agent or via config, e.g. gpt-4o-mini or gpt-5-mini. You don't need a frontier model to demo this.

Want a different provider? Edit config/ai.php β€” laravel/ai supports Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, Cohere, and more. If you swap embeddings to a provider whose dimensions differ from the current one, you'll need to re-seed the vendor services so embeddings match.

Using Gemini (free tier)

Gemini's free tier is sufficient to run both embeddings (VendorServiceObserver) and chat (WeddingPlannerAgent) without an OpenAI key.

1. Generate an API key at https://aistudio.google.com/app/apikey.

2. Set it in .env:

GEMINI_API_KEY=AIza...

3. Embeddings. config/ai.php already sets default_for_embeddings to gemini, using gemini-embedding-001 at 768 dimensions. Override via env if needed:

GEMINI_EMBEDDINGS_MODEL=gemini-embedding-001
GEMINI_EMBEDDINGS_DIMENSIONS=768

If the vendor_services.embedding column was previously populated with a different dimension (e.g. OpenAI's 1536), re-seed:

php artisan db:seed --class=VendorSeeder

4. Chat model. Point the agent at gemini-2.5-flash (supports tool calls and is on the free tier):

class WeddingPlannerAgent implements Agent, Conversational, HasTools
{
    use Promptable, RemembersConversations;

    public function provider(): string
    {
        return 'gemini';
    }

    public function model(): string
    {
        return 'gemini-2.5-flash';
    }

    // ...
}

Alternatively, set 'default' => 'gemini' in config/ai.php to route all chat calls through Gemini globally.

Herd

The app is served by Laravel Herd at http://meetup-wedding-planner.test if you have Herd installed. Otherwise php artisan serve (run for you by composer run dev) works on :8000.

No PHP installed? Use Sail

If you don't have PHP / Composer / Postgres locally, you can run everything in Docker via Laravel Sail. You only need Docker installed.

1. Bootstrap vendor/ without local PHP (skip if you already ran composer install):

docker run --rm -u "$(id -u):$(id -g)" \
  -v "$(pwd):/var/www/html" -w /var/www/html \
  laravelsail/php85-composer:latest \
  composer install --ignore-platform-reqs

2. Copy and tweak .env β€” Sail provides its own Postgres + Mailpit in compose.yaml, and the laravel container overrides DB_HOST, DB_USERNAME, DB_PASSWORD, MAIL_MAILER, MAIL_HOST, MAIL_PORT automatically, so the only things you need to set yourself are:

APP_URL=http://localhost
DB_CONNECTION=pgsql
DB_DATABASE=meetup_wedding_planner
OPENAI_API_KEY=sk-...

Sail's Postgres is forwarded to host port 5433 (not 5432) to avoid clashing with a Herd/host Postgres. Inside the container the app still uses the pgsql service hostname on 5432.

3. Bring it up:

./vendor/bin/sail up -d
./vendor/bin/sail artisan key:generate
./vendor/bin/sail artisan migrate --seed
./vendor/bin/sail npm install
./vendor/bin/sail npm run dev

The app is at http://localhost. Mailpit dashboard is at http://localhost:8025. Add alias sail='./vendor/bin/sail' to save typing.

Re-generating vendor embeddings

The seeder creates vendor services and App\Observers\VendorServiceObserver fills in embeddings automatically on save. If you change embedding logic or switch providers, re-seed:

php artisan db:seed --class=VendorSeeder

Debugging

  • Live logs: composer run dev already runs php artisan pail β€” watch the terminal pane for LLM errors, validation failures, queued job output.
  • Browser console: Livewire surfaces errors in the browser dev tools.
  • Tinker: php artisan tinker to poke at Wedding, VendorService, AgentConversation, etc.
  • Stuck? The previous working implementation is in git history β€” see git log -- app/Ai (specifically commit aab75d5) for a reference. Try not to peek too early though, that's where the fun is. πŸ˜„

Documentation

Everything you'll need:

Laravel AI (laravel/ai v0)

You can also use the Laravel Boost MCP search-docs tool from inside your editor β€” it returns version-pinned docs for the exact packages installed.

Other packages

LLM providers (pick one)


Project structure cheat-sheet

app/
β”œβ”€β”€ Actions/Wedding/AiChat/
β”‚   β”œβ”€β”€ CreateAiChat.php          # creates a new chat + conversation
β”‚   └── SendChatMessage.php       # πŸ† wire your agent in here
β”œβ”€β”€ Ai/                           # πŸ† you create this folder
β”‚   β”œβ”€β”€ Agents/
β”‚   β”‚   └── WeddingPlannerAgent.php
β”‚   └── Tools/
β”‚       └── SuggestInquiryTool.php
β”œβ”€β”€ Livewire/Weddings/
β”‚   └── AiChats.php               # the chat Livewire component
β”œβ”€β”€ Models/
β”‚   β”œβ”€β”€ AgentConversation.php     # managed by laravel/ai (RemembersConversations)
β”‚   β”œβ”€β”€ AgentConversationMessage.php
β”‚   β”œβ”€β”€ WeddingAiChat.php         # thin join: Wedding ↔ AgentConversation
β”‚   β”œβ”€β”€ Wedding.php
β”‚   β”œβ”€β”€ Vendor.php
β”‚   β”œβ”€β”€ VendorService.php         # has `embedding` column
β”‚   └── Inquiry.php
└── Observers/
    └── VendorServiceObserver.php # auto-embeds services on save

resources/views/
β”œβ”€β”€ components/ai-chat/
β”‚   └── message-bubble.blade.php  # renders messages + suggested-inquiry cards
└── livewire/weddings/
    └── ai-chats.blade.php

Happy hacking! πŸ’’βœ¨

About

Skeleton application for Meetup in May 2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors