Back to .md Directory

Persona AI Demo Guide

Guides users through launching, chatting with, and customising AI personas in a demo application with multiple LLM providers.

May 2, 2026
0 downloads
1 views
ai llm rag openai gemini
View source

What this file does

Guides users through launching, chatting with, and customising AI personas in a demo application with multiple LLM providers.

When to use it

  • Onboarding new team members to a persona-based AI chat app
  • Writing a quickstart guide for a demo or prototype
  • Documenting persona creation and LLM provider configuration
  • Providing sample conversations for testing or presentations

Assumes this stack

Next.jsReactTailwind CSSOpenAI APIGoogle Gemini APITypeScript

Persona AI Demo Guide

🎯 Quick Start Demo

1. Launch the Application

npm run dev
# Open http://localhost:3000

2. Explore Pre-built Personas

  • Hitesh Choudhary: Tech educator and iNeuron founder
  • Piyush Garg: Full-stack developer and tech content creator

3. Start a Chat

  1. Click on any persona card
  2. Type your message in the chat input
  3. Press Enter or click Send
  4. Watch the AI respond in the persona's unique style!

💬 Sample Conversations

Demo 1: Learning with Hitesh

You: "I'm new to programming. Where should I start?"
Hitesh: "Welcome to the amazing world of programming! 🚀 

Let me tell you, everyone starts exactly where you are right now. Here's my proven path:

1. **HTML & CSS** - Learn the basics of web structure
2. **JavaScript** - The language that makes websites interactive
3. **React** - Build modern, dynamic applications
4. **Node.js** - Create your own backend

Start with HTML - it's like learning the alphabet before writing stories!

What interests you most: web development, mobile apps, or something else?"

Demo 2: Technical Deep-dive with Piyush

You: "How do I implement authentication in Next.js?"
Piyush: "Excellent question! Authentication in Next.js has several approaches. Let me break down the most effective ones:

**NextAuth.js (Recommended):**
```typescript
import NextAuth from 'next-auth'
import GithubProvider from 'next-auth/providers/github'

export default NextAuth({
  providers: [
    GithubProvider({
      clientId: process.env.GITHUB_ID,
      clientSecret: process.env.GITHUB_SECRET,
    }),
  ],
})

Key Benefits:

  • Built-in session management
  • Multiple provider support
  • Secure by default
  • Easy integration with Next.js

Would you like me to show you how to implement protected routes?"


## 🛠️ Create Your Own Persona

### Step-by-Step Creation
1. Click "Create Custom Persona" button
2. Fill in the form:
   - **Name**: "Dr. Sarah Chen"
   - **Description**: "AI Research Scientist specializing in machine learning"
   - **Personality**: "Curious, analytical, and passionate about explaining complex AI concepts in simple terms"
   - **Expertise**: ["Machine Learning", "Deep Learning", "Computer Vision", "AI Ethics"]
   - **Tone**: "Educational, encouraging, and uses analogies to explain complex topics"

3. Click "Create Persona"
4. Start chatting with your new AI persona!

## 🔧 Configure LLM Providers

### Setting Up OpenAI
1. Open Settings (gear icon)
2. Click "Add Provider"
3. Enter details:
   - Name: "OpenAI GPT-4"
   - Model: "gpt-4"
   - API Key: Your OpenAI API key
4. Click "Add Provider"
5. Set as Active

### Setting Up Google Gemini
1. Follow same steps as OpenAI
2. Use "Google Gemini Pro" as name
3. Use "gemini-pro" as model
4. Add your Google API key

## 📱 Mobile Experience

The application is fully responsive and works great on mobile devices:
- Touch-friendly interface
- Optimized chat layout
- Easy persona switching
- Smooth animations

## 🎨 Customization Examples

### Custom Styling
You can easily customize the appearance by modifying:
- `tailwind.config.js` for color schemes
- `app/globals.css` for custom styles
- Component files for layout changes

### Adding New Persona Fields
Extend the Persona interface in `types/index.ts`:
```typescript
interface Persona {
  // ... existing fields
  favoriteColor?: string;
  hobbies?: string[];
  speakingStyle?: 'formal' | 'casual' | 'technical';
}

🚀 Advanced Features

Rate Limiting

  • Monitor API usage in real-time
  • Automatic hourly reset
  • Configurable limits per provider

Session Management

  • Persistent chat history
  • Multiple conversation threads
  • Automatic session creation

Error Handling

  • Graceful API failures
  • User-friendly error messages
  • Retry mechanisms

🔍 Troubleshooting

Common Issues

  1. API Key Errors: Check your API key format and validity
  2. Rate Limiting: Monitor usage in settings
  3. Chat Not Working: Ensure an LLM provider is active
  4. Styling Issues: Clear browser cache and restart dev server

Debug Mode

Enable console logging by adding to your browser console:

localStorage.setItem('debug', 'true')

📊 Performance Tips

  1. Optimize Images: Use compressed avatar images
  2. Limit Chat History: Keep conversations focused
  3. Monitor API Usage: Stay within rate limits
  4. Use Efficient Models: Choose appropriate model sizes

🌟 Pro Tips

  1. Persona Consistency: Be specific about personality traits
  2. Expertise Balance: Don't make personas too broad or too narrow
  3. Tone Matching: Ensure tone matches the intended use case
  4. Regular Updates: Refresh personas based on feedback

Ready to start chatting? 🚀

The Persona AI application is designed to be intuitive and powerful. Experiment with different personas, create your own, and discover the amazing possibilities of AI-powered conversations!

What's inside

10 sections covering quick start, sample conversations, persona creation, LLM setup, mobile experience, customization, advanced features, troubleshooting, performance tips, and pro tips

Change this for your project

  • Replace urmilbhatt/persona-ai with your own repository name
  • Replace Hitesh Choudhary and Piyush Garg with your own demo personas
  • Replace gpt-4 and gemini-pro with your actual model IDs
  • Replace types/index.ts with your own type definition file path

Where it goes

Use as the system prompt for your model call, or as the base instructions in your agent framework.

Worth borrowing

  • Sample conversations that show the persona's voice and technical depth
  • Step-by-step persona creation form with example values for each field
  • Troubleshooting section with common issues and debug mode toggle

Related Documents