Skip to content

bepoooe/BioSphere

Repository files navigation

BioSphere

An AI-powered multi-platform bio generator built with Next.js and Groq's Llama 3 models. This project features intelligent bio generation for Twitter/X, Instagram, and LinkedIn with platform-specific optimization, customizable settings, and real-time AI processing. Enhanced with RAG (Retrieval-Augmented Generation) for superior bio quality using curated knowledge base of bio writing best practices.

Key Features

AI-Powered Generation - Leverages Groq's Llama 3 models (8B & 70B) for intelligent bio creation
Platform-Specific Optimization - Tailored content for Twitter/X, Instagram, and LinkedIn
RAG-Enhanced AI - Uses curated knowledge base for superior bio quality (always enabled)
Customizable Tone & Style - Professional, casual, funny, passionate, and more
Responsive Design - Beautiful, modern interface that works on all devices
Real-Time Generation - Fast bio creation with instant results
One-Click Copy - Easy clipboard integration for immediate use
Multiple Variations - Generate 4+ unique bio options per request

Tech Stack

Core

  • Next.js 14 - React framework with App Router for server-side rendering and API routes
  • React 18 - Component-based UI library with hooks and context
  • TypeScript - Type-safe JavaScript for better development experience
  • Vercel AI SDK - AI integration toolkit for LLM interactions
  • Groq API - High-performance AI inference platform

AI & RAG Enhancement

  • Llama 3 8B - Fast, efficient model for quick bio generation
  • Llama 3 70B - Advanced model for sophisticated content creation
  • RAG System - Enhanced generation using curated bio writing knowledge base
  • OpenAI Embeddings - Advanced semantic search for knowledge retrieval
  • Automatic Enhancement - RAG is always enabled for superior bio quality
  • Zod - Schema validation for type-safe AI responses
  • Endent - Template literal formatting for AI prompts

Styling & UI

  • Tailwind CSS - Utility-first CSS framework for styling
  • Shadcn/ui - High-quality React component library
  • Radix UI - Low-level UI primitives for accessibility
  • Tailwind Animate - Animation utilities for Tailwind CSS
  • Class Variance Authority - Component variant management

Form & State Management

  • React Hook Form - Performant forms with easy validation
  • React Context API - State management for bio generation
  • Hookform Resolvers - Zod integration for form validation

Icons & Fonts

  • Lucide React - Modern icon library
  • Geist Font - Vercel's design system font family
  • Custom SVG Icons - Platform-specific social media icons

Development Tools

  • ESLint - Code linting and formatting
  • PostCSS - CSS processing and optimization
  • Clsx & Tailwind Merge - Conditional class name utilities

Features

AI-Powered Generation

  • Multi-Model Support - Choose between Llama 3 8B (fast) and 70B (sophisticated) models
  • Platform Optimization - Tailored content for Twitter/X, Instagram, and LinkedIn
  • Intelligent Prompting - Context-aware AI prompts for better results
  • Schema Validation - Type-safe AI responses with structured output
  • RAG Enhancement - Retrieval-Augmented Generation with curated knowledge base
  • Fallback System - Graceful fallback to standard generation if RAG fails

Enhanced RAG (Retrieval-Augmented Generation)

  • Always Active - RAG enhancement is automatically enabled for all bio generation
  • Curated Knowledge Base - Pre-loaded with 17+ expert bio writing guidelines
  • Platform-Specific Guidelines - Specialized knowledge for Twitter, Instagram, and LinkedIn
  • Semantic Search - Intelligent retrieval of relevant context using OpenAI embeddings
  • Text Fallback - Graceful fallback to text-based similarity when embeddings unavailable
  • Best Practices Integration - Automatically incorporates proven bio writing techniques
  • Tone-Specific Guidance - Contextual advice for professional, casual, funny, and other tones

Customization Options

  • Tone Control - Professional, casual, humorous, passionate, thoughtful, and sarcastic
  • Bio Types - Personal or brand/business focused content
  • Creativity Levels - Adjustable creativity scale (0-2) for AI generation
  • Emoji Integration - Optional emoji inclusion for enhanced engagement
  • Platform Optimization - Automatic character limit and style optimization
  • Flexible Input - No minimum word requirements for user input

User Experience

  • Streamlined Interface - Clean, intuitive design with simplified controls
  • Real-Time Generation - Fast bio creation with instant results
  • Multiple Variations - Generate 4+ unique bio options per request
  • One-Click Copy - Easy clipboard integration for immediate use
  • Responsive Design - Seamless experience across all devices
  • Interactive UI - Modern interface with hover effects and animations
  • Smart Validation - Real-time validation with helpful error messages
  • Auto-Enhanced Quality - RAG system automatically improves all generated bios

Platform-Specific Features

  • Twitter/X - 120-160 character limit, concise and punchy language
  • Instagram - 100-150 character limit, visual and lifestyle-focused content
  • LinkedIn - 160-220 character limit, professional tone with industry keywords

Environment Variables

Create a .env.local file in the root directory with the following variables:

# Required - Groq API key for AI model access
GROQ_API_KEY=your_groq_api_key_here

# Optional - OpenAI API key for RAG embeddings (improves RAG performance)
OPENAI_API_KEY=your_openai_api_key_here

Getting API Keys:

  1. Groq API Key (Required):

    • Visit Groq Cloud
    • Create an account and generate an API key
    • Used for Llama 3 model access
  2. OpenAI API Key (Optional):

    • Visit OpenAI Platform
    • Create an account and generate an API key
    • Used for vector embeddings in RAG system
    • If not provided, RAG will use text-based similarity matching

RAG Knowledge System

The application includes a comprehensive RAG (Retrieval-Augmented Generation) system that automatically enhances all bio generation:

Automatic Enhancement:

  • Always Active: RAG enhancement is automatically enabled for all bio generation
  • Curated Knowledge Base: Pre-loaded with 17+ expert bio writing guidelines
  • Platform-Specific Guidelines: Specialized knowledge for Twitter, Instagram, and LinkedIn
  • Semantic Search: Intelligent retrieval of relevant context using OpenAI embeddings
  • Text Fallback: Works without embeddings using text-based similarity matching
  • Best Practices Integration: Automatically incorporates proven bio writing techniques

Knowledge Base Content:

  • Social media bio best practices
  • Platform-specific optimization guidelines
  • Tone and voice style guides
  • High-converting bio templates
  • Character limit optimization strategies
  • Engagement psychology principles

Project Structure

BioSphere/
β”œβ”€β”€ public/                     # Static assets
β”‚   β”œβ”€β”€ next.svg               # Next.js logo
β”‚   └── vercel.svg             # Vercel logo
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                   # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ actions.ts         # Server actions for AI integration
β”‚   β”‚   β”œβ”€β”€ layout.tsx         # Root layout with metadata and fonts
β”‚   β”‚   β”œβ”€β”€ page.tsx           # Main application page
β”‚   β”‚   β”œβ”€β”€ globals.css        # Global styles and CSS variables
β”‚   β”‚   β”œβ”€β”€ favicon.ico        # Website favicon
β”‚   β”‚   β”œβ”€β”€ icon.png          # App icon
β”‚   β”‚   β”œβ”€β”€ apple-icon.png    # Apple touch icon
β”‚   β”‚   β”œβ”€β”€ api/              # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ generate-bio-rag/  # RAG-enhanced bio generation
β”‚   β”‚   β”‚   β”œβ”€β”€ rag-knowledge/     # RAG knowledge management
β”‚   β”‚   β”‚   β”œβ”€β”€ seed-knowledge/    # Knowledge base seeding
β”‚   β”‚   β”‚   └── test-rag/         # RAG testing endpoint
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ home/             # Home page components
β”‚   β”‚   β”‚   β”œβ”€β”€ CopyLabel.tsx      # Copy to clipboard functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ Output.tsx         # Bio generation results display
β”‚   β”‚   β”‚   └── UserInput.tsx      # Input form with all controls
β”‚   β”‚   β”œβ”€β”€ rag/              # RAG-specific components
β”‚   β”‚   β”‚   └── RAGKnowledgeManager.tsx  # RAG management interface (internal)
β”‚   β”‚   β”œβ”€β”€ icons/            # Custom SVG icon components
β”‚   β”‚   β”‚   β”œβ”€β”€ Instagram.tsx      # Instagram brand icon
β”‚   β”‚   β”‚   β”œβ”€β”€ LinkedIn.tsx       # LinkedIn brand icon
β”‚   β”‚   β”‚   β”œβ”€β”€ Meta.tsx          # Meta/Facebook brand icon
β”‚   β”‚   β”‚   β”œβ”€β”€ Mistral.tsx       # Mistral AI icon
β”‚   β”‚   β”‚   └── Twitter.tsx       # Twitter/X brand icon
β”‚   β”‚   β”œβ”€β”€ magicui/          # Enhanced UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ animated-gradient-text.tsx  # Gradient text animation
β”‚   β”‚   β”‚   β”œβ”€β”€ border-beam.tsx            # Animated border effects
β”‚   β”‚   β”‚   └── grid-pattern.tsx           # Background grid pattern
β”‚   β”‚   └── ui/               # Shadcn/ui base components
β”‚   β”‚       β”œβ”€β”€ alert-dialog.tsx   # Modal dialogs
β”‚   β”‚       β”œβ”€β”€ badge.tsx         # Status badges
β”‚   β”‚       β”œβ”€β”€ button.tsx        # Button component with variants
β”‚   β”‚       β”œβ”€β”€ form.tsx          # Form components and context
β”‚   β”‚       β”œβ”€β”€ hover-card.tsx    # Hover card tooltips
β”‚   β”‚       β”œβ”€β”€ input.tsx         # Text input fields
β”‚   β”‚       β”œβ”€β”€ label.tsx         # Form labels
β”‚   β”‚       β”œβ”€β”€ select.tsx        # Dropdown selections
β”‚   β”‚       β”œβ”€β”€ skeleton.tsx      # Loading skeletons
β”‚   β”‚       β”œβ”€β”€ slider.tsx        # Range sliders
β”‚   β”‚       β”œβ”€β”€ switch.tsx        # Toggle switches
β”‚   β”‚       β”œβ”€β”€ textarea.tsx      # Multi-line text input
β”‚   β”‚       └── tooltip.tsx       # Tooltips and help text
β”‚   β”œβ”€β”€ context/              # React Context providers
β”‚   β”‚   └── BioContext.tsx    # Bio generation state management
β”‚   └── lib/                  # Utility functions
β”‚       β”œβ”€β”€ utils.ts          # Tailwind class merging utilities
β”‚       └── rag/              # RAG system components
β”‚           β”œβ”€β”€ SimpleRAGStore.ts     # Vector store implementation
β”‚           β”œβ”€β”€ RAGEnhancedAI.ts      # RAG-enhanced AI generation
β”‚           └── seedKnowledgeBase.ts  # Initial knowledge base data
β”œβ”€β”€ data/                     # Data storage
β”‚   └── chunks.json          # RAG knowledge chunks (auto-generated)
β”œβ”€β”€ components.json           # Shadcn/ui configuration
β”œβ”€β”€ next.config.mjs          # Next.js configuration
β”œβ”€β”€ package.json             # Dependencies and scripts
β”œβ”€β”€ postcss.config.mjs       # PostCSS configuration
β”œβ”€β”€ tailwind.config.ts       # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json            # TypeScript configuration
└── README.md                # Project documentation

Development

Prerequisites

  • Node.js (v18 or later)
  • npm or yarn or pnpm
  • Groq API key (free at console.groq.com)

Installation

# Clone the repository
git clone https://github.com/bepooee/BioSphere.git

# Navigate to the project directory
cd BioSphere

# Install dependencies
npm install
# or
yarn install
# or
pnpm install

Environment Setup

  1. Create environment file

    cp .env.example .env.local
  2. Add your Groq API key to .env.local:

    GROQ_API_KEY="your_groq_api_key_here"
  3. Get your free Groq API key:

    • Visit console.groq.com
    • Sign up for a free account
    • Generate an API key
    • Copy the key to your environment file

Running the Development Server

# Start the development server
npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 in your browser to see BioSphere in action.

Building for Production

# Build the application
npm run build
# or
yarn build
# or
pnpm build

# Start the production server
npm run start
# or
yarn start
# or
pnpm start

Available Scripts

  • npm run dev - Start development server with hot reload
  • npm run build - Build optimized production bundle
  • npm run start - Start production server
  • npm run lint - Run ESLint for code quality

API Integration

Groq AI Integration

BioSphere uses Groq's API with Llama 3 models for bio generation. The AI system features:

Model Selection:

  • Llama 3 8B - Optimized for speed and efficiency
  • Llama 3 70B - Enhanced capability for complex bio generation

Intelligent Prompting:

  • Platform-specific prompt engineering
  • Context-aware content generation
  • Tone and style adaptation
  • Character limit optimization

Response Processing:

  • Structured JSON output using Zod schemas
  • Error handling and fallback responses
  • Rate limiting and request optimization

Server Actions

The actions.ts file implements Next.js Server Actions for:

  • Secure API key handling
  • AI model communication
  • Response validation and formatting
  • Error management
// Example AI generation flow
const result = await generateObject({
  model: groq(selectedModel),
  schema: bioSchema,
  prompt: constructedPrompt,
  system: systemPrompt
});

Platform Specifications

Twitter/X Optimization

  • Character Limit: 120-160 characters
  • Style: Concise, punchy, engagement-focused
  • Format: Single line, no hashtags
  • Best Practices: Action-oriented language, clear value proposition

Instagram Optimization

  • Character Limit: 100-150 characters
  • Style: Visual, lifestyle-focused, creative
  • Format: Multi-line friendly, emoji-enhanced
  • Best Practices: Personality-driven, authentic voice

LinkedIn Optimization

  • Character Limit: 160-220 characters
  • Style: Professional, achievement-focused
  • Format: Industry keywords, value-oriented
  • Best Practices: Expertise highlighting, network-building focus

Build Optimizations

The project uses several optimizations for optimal performance:

Next.js Optimizations:

  • App Router for improved performance
  • Server-side rendering for faster initial loads
  • Automatic code splitting
  • Image optimization

Bundle Optimizations:

  • Tree shaking for smaller bundle sizes
  • Dynamic imports for code splitting
  • Optimized dependency bundling

Runtime Optimizations:

  • React 18 concurrent features
  • Efficient re-rendering with proper memoization
  • Optimized form handling with React Hook Form

Latest Version

Current Version: 2.0.0 (July 2025)

Recent Updates (v2.0.0)

  • Simplified User Experience: Removed RAG management UI for streamlined interface
  • Automatic RAG Enhancement: RAG is now always enabled for superior bio quality
  • Flexible Input Requirements: Removed minimum word count requirement for user input
  • Enhanced Knowledge Base: Pre-loaded with 17+ expert bio writing guidelines
  • Improved Performance: Optimized RAG system for faster generation
  • Better Error Handling: Enhanced fallback systems for reliable operation

Previous Updates (v1.0.0)

  • Implemented Groq AI integration with Llama 3 models
  • Added platform-specific bio optimization
  • Enhanced UI with Shadcn/ui components
  • Optimized form handling with React Hook Form
  • Added responsive design for all screen sizes
  • Implemented one-click copy functionality
  • Added emoji integration toggle
  • Enhanced error handling and validation

Resources & Credits

Development Resources

Documentation & Learning

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Contributing Guidelines

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'Add some amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Setup for Contributors

  1. Follow the installation steps above
  2. Create a new branch for your feature
  3. Make your changes with proper TypeScript types
  4. Test your changes thoroughly
  5. Ensure ESLint passes: npm run lint
  6. Submit a pull request with a clear description

Deployment

Vercel (Recommended)

The easiest way to deploy BioSphere is using Vercel:

  1. Connect your GitHub repository to Vercel
  2. Add environment variables in Vercel dashboard:
    • GROQ_API_KEY - Your Groq API key
  3. Deploy automatically on git push

Deploy with Vercel

Other Platforms

BioSphere can be deployed on any platform that supports Next.js:

  • Netlify
  • Railway
  • AWS Amplify
  • Google Cloud Platform
  • Heroku

Make sure to set the GROQ_API_KEY environment variable on your chosen platform.

License

This project is created by bepooee and is available for educational and personal use.

Contact & Support

Creator: bepoooe
Email: adrishbasak003@gmail.com
GitHub: https://github.com/bepoooe
Project Repository: https://github.com/bepoooe/BioSphere


If you found BioSphere helpful, please consider giving it a star on GitHub!

BioSphere v2.0 - AI-Powered Bio Generation with RAG Enhancement
Made with love by bepoooe

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published