Skip to content

fidayuzida/Personal-Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

🤖 Portfolio Chatbot — RAG-based Personal AI Assistant

🔗 Live Demo: https://chatbot.zid.web.id/


📌 Overview

A context-aware AI chatbot designed to transform a traditional portfolio into an interactive conversational interface 💬

Instead of reading static CVs, users can directly ask about:

  • Experience
  • Skills
  • Projects

The system responds with relevant, data-driven answers using a lightweight RAG (Retrieval-Augmented Generation) approach.


⚙️ Architecture

User Input
   ↓
Intent Detection
   ↓
Topic Mapping
   ↓
Context Retrieval (data.txt)
   ↓
Prompt Injection
   ↓
OpenAI API
   ↓
Response (UI)

🧠 Core Features

  • 💬 Clean & Responsive UI
  • 🧠 Lightweight RAG system
  • 🎯 Keyword-based topic routing
  • 📂 Structured knowledge base (section-based)
  • 🔍 Portfolio relevance scoring
  • 🧵 Conversation history support
  • ⚡ FastAPI backend (fast & efficient)

🔬 Technical Breakdown

📥 Context Retrieval

Only relevant data is injected into the model:

context = retrieve_context(user_input)

✔ Improves accuracy ✔ Reduces token usage ✔ Minimizes hallucination


🏷️ Topic Routing

KEYWORD_TOPICTOPIC_MAPSECTIONS

Maps user queries into structured knowledge domains.


📂 Knowledge Structure

Stored in:

data.txt

Format:

==== SECTION NAME ====
content...

🔍 Portfolio Ranking

score += 1 if word in text else 0

Ensures only relevant projects are returned.


🧩 Prompt Injection

system_prompt = BASE_PROMPT + context

Constrains the model to grounded responses.


🖥️ Tech Stack

Backend

  • FastAPI
  • Python
  • OpenAI API

Frontend

  • TailwindCSS
  • Vanilla JavaScript
  • Lucide Icons

📁 Project Structure

.
├── index.html        # UI
├── main.py           # Backend
├── data.txt          # Knowledge base
├── prompt.txt        # Prompt config
├── .env              # API key

🔌 API Endpoint

POST /chat

{
  "message": "What are your skills?",
  "history": []
}

🎯 Design Decisions

  • File-based knowledge → simple & portable
  • Keyword routing → deterministic & lightweight
  • No embeddings → avoid overengineering
  • Limited history → token efficiency

🚀 Future Improvements

  • Embedding-based retrieval
  • Vector database (FAISS / Pinecone)
  • Streaming responses
  • Multi-language support
  • Docker deployment

👤 Author

Fida Yuzida


⭐ Final Thought

Turning a portfolio into a conversation creates a more engaging way to explore a candidate 🚀

About

Developed a web-based portfolio chatbot using FastAPI and OpenAI API with a lightweight RAG (Retrieval-Augmented Generation) approach to generate contextual, relevant, and data-driven responses based on experience, skills, and projects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors