I'll help you build an AI agent using the AIPE.NOW platform shown in your screenshot. Let's create a complete implementation that allows users to configure and interact with an AI agent.
I've created a Next.js application that replicates the AIPE.NOW interface for creating AI agents. Here's what the implementation includes:
Main Layout:
Identity Section:
Personality Configuration:
API & Features:
State Management:
The interface closely matches the screenshot you provided, with the same dark color scheme, purple accents, and layout structure.
This implementation provides a complete UI for configuring an AI agent. To make it fully functional, you would need to connect it to a backend service that can process the agent configuration and create the actual AI agent.
Here's a step-by-step guide to add the AIPE.NOW agent creation interface to your existing Next.js project:
First, make sure you have the necessary dependencies installed:
npm install lucide-react
If you don't already have shadcn/ui components installed, you'll need to set those up:
npx shadcn@latest init
Then install the specific components we're using:
npx shadcn@latest add button input textarea switch card label checkbox
If your existing project uses a different color scheme, you might want to update your tailwind.config.js
to include the dark purple colors used in the AIPE interface:
// Add these colors to your tailwind.config.js
theme: {
extend: {
colors: {
// Your existing colors...
aipe: {
dark: '#0e0e1a',
card: '#1e1e2d',
input: '#13131f',
purple: '#9333ea',
},
},
},
},
To make the agent creator functional, you'll need to connect it to your AI backend. Here's how to handle the form submission:
// In your page component
import { AgentCreator } from "@/components/aipe/agent-creator"
export default function YourPage() {
const handleCreateAgent = async (agentData) => {
try {
// Send the agent data to your backend
const response = await fetch('/api/agents', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(agentData),
})
if (!response.ok) {
throw new Error('Failed to create agent')
}
const data = await response.json()
console.log('Agent created:', data)
// Handle success (redirect, show message, etc.)
} catch (error) {
console.error('Error creating agent:', error)
// Handle error
}
}
return (
<div className="your-container">
<h1>Create an AI Agent</h1>
<AgentCreator onSubmit={handleCreateAgent} />
</div>
)
}
// app/api/agents/route.ts
import { NextResponse } from 'next/server'
export async function POST(request: Request) {
try {
const agentData = await request.json()
// Process the agent data
// This is where you would connect to your AI service
// For example, using the AI SDK to create an agent
// Example with AI SDK (pseudocode)
// import { createAgent } from 'your-ai-service'
// const agent = await createAgent({
// name: agentData.identity.name,
// description: agentData.personality.description,
// // other properties
// })
// For now, just return the data
return NextResponse.json({
success: true,
message: 'Agent created successfully',
agent: agentData
})
} catch (error) {
console.error('Error creating agent:', error)
return NextResponse.json(
{ success: false, message: 'Failed to create agent' },
{ status: 500 }
)
}
}
To handle the agent image upload:
// Add this to your agent-creator.tsx component
import { useState } from "react"
// Inside your component
const [agentImage, setAgentImage] = useState(null)
const [previewUrl, setPreviewUrl] = useState("")
const handleImageUpload = (e) => {
const file = e.target.files[0]
if (file) {
setAgentImage(file)
setPreviewUrl(URL.createObjectURL(file))
}
}
// Replace the upload div with:
<div className="border border-dashed border-gray-600 rounded-md p-4 text-center">
<input
type="file"
id="agent-image"
accept="image/png,image/jpeg,image/gif,image/svg+xml"
className="hidden"
onChange={handleImageUpload}
/>
<label htmlFor="agent-image" className="cursor-pointer">
{previewUrl ? (
<img src={previewUrl || "/placeholder.svg"} alt="Agent preview" className="mx-auto h-32 object-contain" />
) : (
<>
<Upload className="mx-auto h-6 w-6 text-gray-400 mb-2" />
<p className="text-sm text-gray-400">
Click to upload or drag and drop SVG, PNG, JPG or GIF (max 800x400px)
</p>
</>
)}
</label>
</div>
If you want to use the AI SDK to power your agent, you can integrate it like this:
// app/api/agents/chat/route.ts
import { NextResponse } from 'next/server'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
export async function POST(request: Request) {
try {
const { message, agentData } = await request.json()
// Create a system prompt based on the agent's personality
const systemPrompt = `
You are ${agentData.identity.name}, a ${agentData.identity.age} year old AI agent.
Description: ${agentData.personality.description}
Personality: ${agentData.personality.personality}
Style: ${agentData.personality.style}
Knowledge: ${agentData.personality.knowledge}
Always stay in character and respond as ${agentData.identity.name} would.
`
// Generate a response using the AI SDK
const { text } = await generateText({
model: openai('gpt-4o'),
system: systemPrompt,
prompt: message,
})
return NextResponse.json({
response: text,
agent: agentData.identity.name
})
} catch (error) {
console.error('Error generating response:', error)
return NextResponse.json(
{ error: 'Failed to generate response' },
{ status: 500 }
)
}
}
After implementing these components, you can test your integration by:
By following these steps, you'll have successfully integrated the AIPE.NOW agent creation interface into your existing project, allowing your users to create and interact with customized AI agents.