generative-ui-demo.mp4
A demo of Generative UI: a Business Intelligence chat where the AI agent doesn't just reply with text, it decides which UI components to render — KPI cards, charts and tables — based on the data it pulls from the database.
Ask something like "How did revenue go in the last 6 months?" and the agent inspects the schema, runs read-only SQL queries against a sample ecommerce database, and answers with live Vue components streamed into the conversation.
Neuron AI is the PHP agentic framework to build and orchestrate AI agents. It gives you agents, tools and toolkits, chat history, RAG, structured output, workflows, streaming and monitoring, so you can integrate AI into your existing PHP applications — Laravel, Symfony or any other framework — without leaving the PHP ecosystem.
📖 Documentation: https://docs.neuron-ai.dev
app/Neuron/BIAgent.php— the agent: Anthropic or OpenAI as the LLM, the MySQL toolkit in read-only mode, and chat history persisted with Eloquent.app/Neuron/Tools/Render*Tool.php— the render tools (render_cards,render_chart,render_table) the agent calls to pick a component and its data.resources/js/components/chat— the Vue components that draw those tool calls in the chat, connected to the agent through CopilotKit and the AG-UI protocol.
The demo has two pages:
| Page | How the agent runs |
|---|---|
/chat |
Inside the HTTP request, streaming straight to the browser. |
/chat-background |
In a queued job, streaming to the browser through Redis Pub/Sub. |
Stack: Laravel 13, Inertia v3, Vue 3, Tailwind CSS v4.
- PHP 8.3+ with the
redisextension (phpredis) - Composer
- Node.js 20+ and npm
- Docker (for MySQL and Redis), or your own MySQL 8 and Redis servers
- An Anthropic or OpenAI API key
git clone <repository-url> app-demo
cd app-demo
# Start MySQL and Redis
docker compose up -d
# Install dependencies, create .env, generate the app key, migrate and build assets
composer setupOpen .env and set the API key of the provider you want to use (Anthropic is the default):
AI_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...Load the sample ecommerce data (customers, catalog and two years of sales):
php artisan db:seedThe agent can run on Anthropic or OpenAI. Switch with AI_PROVIDER, no code changes needed:
AI_PROVIDER=openai
OPENAI_API_KEY=sk-...| Variable | Default | |
|---|---|---|
AI_PROVIDER |
anthropic |
anthropic or openai |
ANTHROPIC_MODEL |
claude-sonnet-5 |
Model used with Anthropic |
OPENAI_MODEL |
gpt-5 |
Model used with OpenAI |
The selection happens in BIAgent::provider(). Neuron AI ships many more providers (Gemini, Mistral, Ollama, ...) — see the documentation to plug in another one. If you change .env while the app is running, restart composer run dev so the queue worker picks it up.
composer run devThis starts the Laravel server, the queue worker, the log viewer and Vite. Open http://localhost:8000 and log in with:
- Email:
test@example.com - Password:
password
- Show me the headline KPIs for this month.
- Revenue trend by month over the last year.
- Top 10 products by revenue.
- Which categories are growing the fastest?