A React + Python personal homepage AI assistant project where users can learn about your background, skills, project experience, and more through a chat interface.
- π€ Intelligent AI assistant powered by OpenAI GPT-4
- π¨ Modern UI design with dark theme support
- π± Responsive design for mobile devices
- π Frontend-backend separation architecture
- π Configurable personal data
- π GitHub Pages deployment support
- π§ True RAG (Retrieval-Augmented Generation) system
βββ src/ # Frontend React application
β βββ components/ # React components
β βββ pages/ # Page components
β βββ utils/ # Utility functions
β βββ ...
βββ backend/ # Backend Python API
β βββ app.py # Flask application
β βββ rag_system.py # RAG system module
β βββ personal_data.json # Personal data
β βββ requirements.txt # Python dependencies
β βββ ...
βββ .github/workflows/ # GitHub Actions
βββ README.md
git clone <your-repo-url>
cd ai-profile-assistantEdit the backend/personal_data.json file with your personal information:
{
"basic": {
"name": "Your Name",
"title": "Your Professional Title",
"email": "your.email@example.com",
"location": "Your Location",
"summary": "Your professional summary"
},
"skills": {
"programmingLanguages": ["Python", "JavaScript"],
"mlFrameworks": ["TensorFlow", "PyTorch"],
// ... more information
}
// ... other information
}- Navigate to the backend directory:
cd backend- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp env.example .env
# Edit .env and add your OpenAI API key- Run the backend server:
python app.pyThe server will start at http://localhost:5001
- Copy
env.exampleto.env:
cp env.example .env- Set the backend API address:
VITE_API_BASE_URL=http://localhost:5001# Install frontend dependencies
npm install
# Start frontend development server
npm run dev-
Add secrets to your GitHub repository:
VITE_API_BASE_URL: Your backend API address
-
Push code to the main branch - GitHub Actions will automatically deploy
-
Enable GitHub Pages in repository settings, select the gh-pages branch
OPENAI_API_KEY: OpenAI API key (required for backend)VITE_API_BASE_URL: Backend API address (required for frontend)
The backend/personal_data.json file contains the following sections:
basic: Basic information (name, title, email, etc.)skills: Skills listexperience: Work experienceprojects: Project experienceeducation: Education backgroundcertifications: Certificationsinterests: Interests and hobbiescareerGoals: Career objectives
Send a message to the AI assistant
Health check endpoint
Rebuild the vector database (use after updating personal data)
This project implements a true RAG (Retrieval-Augmented Generation) system:
- Document Processing: Converts personal data to structured documents
- Text Chunking: Splits documents into manageable chunks
- Vectorization: Uses OpenAI embeddings to convert text to vectors
- Storage: Stores vectors in ChromaDB
- Retrieval: Searches for most relevant document chunks based on user queries
- Generation: Passes retrieved context to AI for response generation
- Precise Retrieval: Only retrieves information relevant to the question
- Reduced Hallucination: Based on retrieved real information
- Scalability: Supports large documents and complex queries
- Efficiency: Avoids sending all information to AI
- Cost Optimization: Reduces token usage
- React 18
- TypeScript
- Vite
- Tailwind CSS
- shadcn/ui
- React Router
- Python 3.8+
- Flask
- OpenAI API
- ChromaDB (vector database)
- LangChain
- CORS support
Issues and Pull Requests are welcome!
MIT License