This project powers an interactive portfolio assistant that uses Retrieval-Augmented Generation (RAG) to answer questions based on your past work. It's built with:
- Frontend: React + Vite (deployed to Vercel)
- Backend: Hono + TypeScript (deployed to Render/Fly.io)
- Embedding + LLM: OpenAI
- Vector DB: Supabase with
pgvector - Data ingestion: Python script with token chunking and hash-based deduplication
.
├── backend/ # Hono TypeScript API
├── frontend/ # React chat UI
├── scripts/ # Python ingestion
├── supabase/ # SQL schema and RPC function
- Create a project at https://supabase.com
- Run the SQL in
supabase/init.sql - Enable Row-Level Security (RLS) if needed
- Get your
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEY
cd backend
npm install
cp .env.example .env # or edit manually
npm run dev- Go to render.com, create a new Web Service from GitHub
- Set Build Command:
npm run build - Start Command:
node build/index.js - Add environment variables from
.env
cd frontend
npm install
npm run dev # http://localhost:3000Deploy to Vercel:
- Set project root to
frontend/ - Set API URL inside
App.jsx(e.g. Render backend URL)
In documents/*.json, create one file per project:
{
"project": "AWS Honeycode",
"tags": ["state management"],
"company": "Amazon",
"content": "./conflict-resolving-engine.md"
}Each content path should point to a .md file with detailed content.
pip3 install -r requirements.txt
python ./scripts/ingest_companies.py
python ./scripts/ingest_documents.pyThis will:
- Load JSON
- Chunk markdown into tokenized segments
- Embed via OpenAI
- Store unique chunks in Supabase
Both backend and ingest script require:
OPENAI_API_KEY=sk-...
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-secret-role-keyBuilt by Li Xu. For questions or ideas, open an issue or reach out directly.