CoolFace
Apppublic

hauvo/hau-vo-chatbot-nodejs

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

Hau Vo - AI Chatbot ๐Ÿค–

Meet Hau Vo through this interactive AI chatbot! Built with NodeJS, TypeScript, and OpenAI SDK Agents.

About This Chatbot

This chatbot represents Hau Vo (also known as Kevin), a product builder, solution architect, and software engineer with over 14 years of experience. The bot can answer questions about:

  • โ€”๐Ÿ’ผ Professional Background: 14+ years in tech, from Vietnam
  • โ€”๐Ÿ—๏ธ Technical Expertise: Product development, solution architecture, startup scaling
  • โ€”๐Ÿš€ Specializations: MVP development, scalable systems, cross-functional leadership
  • โ€”๐Ÿ“ Experience: Helping startups turn ideas into viable products

Features

  • โ€”๐Ÿค– OpenAI SDK Agents: Uses the latest OpenAI SDK with function calling capabilities
  • โ€”๐Ÿ’ฌ Real-time Chat: WebSocket-based chat interface using Socket.io
  • โ€”๐ŸŽจ Clean UI: Modern, responsive web interface
  • โ€”๐Ÿ“ง Contact Recording: Automatically records user contact information
  • โ€”๐Ÿ“ Question Tracking: Logs unknown questions for continuous improvement
  • โ€”๐Ÿ”” Pushover Integration: Real-time notifications for new contacts and questions
  • โ€”๐Ÿณ Docker Ready: Containerized for easy deployment
  • โ€”๐Ÿค— Hugging Face Compatible: Ready to deploy on Hugging Face Spaces

Quick Start

Local Development

  1. 1.Clone and setup:
bash
   cd 1_foundations/nodejs-chatbot
   yarn install
  1. 1.Environment setup:
bash
   cp .env.example .env
   # Edit .env with your API keys
  1. 1.Run in development:
bash
   yarn dev
  1. 1.Build and run production:
bash
   yarn build
   yarn start

Visit http://localhost:3000 to start chatting!

Environment Variables

  • โ€”OPENAI_API_KEY: Your OpenAI API key (required)
  • โ€”PUSHOVER_TOKEN: Pushover application token (optional)
  • โ€”PUSHOVER_USER: Pushover user key (optional)
  • โ€”PORT: Server port (default: 3000, Hugging Face uses 7860)

Deployment

Hugging Face Spaces

  1. 1.Create a new Space on Hugging Face
  2. 2.Choose "Docker" as the SDK
  3. 3.Upload all files from this directory
  4. 4.Set your environment variables in the Space settings
  5. 5.The app will automatically deploy and be available at your Space URL

Docker

bash
docker build -t nodejs-chatbot .
docker run -p 3000:3000 --env-file .env nodejs-chatbot

Architecture

  • โ€”Backend: Express.js with TypeScript
  • โ€”Real-time Communication: Socket.io
  • โ€”AI: OpenAI GPT-4o-mini with function calling
  • โ€”Frontend: Vanilla JavaScript with modern CSS
  • โ€”Notifications: Pushover API integration

Tools Available to the AI

  1. 1.record_user_details: Records user contact information when they express interest
  2. 2.record_unknown_question: Logs questions the AI cannot answer for improvement

Project Structure

src/
โ”œโ”€โ”€ index.ts          # Main server file
โ”œโ”€โ”€ chatbot.ts        # Core chatbot logic
โ”œโ”€โ”€ toolsService.ts   # AI tools implementation
โ”œโ”€โ”€ notificationService.ts # Pushover integration
โ””โ”€โ”€ types.ts          # TypeScript interfaces

public/
โ””โ”€โ”€ index.html        # Chat interface

me/
โ”œโ”€โ”€ summary.txt       # Profile summary
โ””โ”€โ”€ linkedin.pdf      # LinkedIn profile data

License

MIT License - feel free to use this as a template for your own chatbot!