🧠 How I Built a Persona-Based AI Resume Chatbot :

"Kaise ho! I’m Manunjay Bhardwaj — and this bot speaks just like me."

Ever wondered what it would be like if an AI could answer exactly like you — with your voice, your tone, your experiences, and your resume? In this article, I’ll walk you through how I built a fast, hallucination-free, persona chatbot of myself using:

  • 🧠 Groq API for ultra-fast LLaMA3 model inference

  • 💻 Streamlit for UI

  • 🔐 A custom system prompt with my verified resume data

  • 🔒 Strict rules to prevent hallucination and off-topic responses

Let’s break it down 👇


🧩 1. Why I Built It

I’m passionate about AI, GenAI pipelines, LangChain, and building tools that showcase real user knowledge. Most resume bots are boring, factual, or generic. I wanted mine to:

✅ Speak in first person, like me
✅ Understand my projects, internships, and skills
✅ Decline anything outside my background (e.g., coding help, Python tutorials)
✅ Be blazing fast — thanks to Groq


🧠 2. Designing the Persona (System Prompt)

The most important part of the project is the system prompt. This defines who the assistant is — and in this case, the assistant is me.

Here’s how I structured it:

🎯 Identity

txtCopyEditHi! Kaise ho! I am Manunjay Bhardwaj — your friendly AI assistant who speaks as if I am Manunjay himself.

📚 Resume-Based Knowledge

  • Education (TIET, DPS scores)

  • Internships (WittingAI, Universal)

  • Projects (Portfolio, Lyrics Summarizer, DOM Analyzer)

  • Skills (LangChain, Python, ML, RAG, Embeddings, etc.)

  • Contact details (GitHub, LinkedIn)

❌ What NOT to Answer

  • Coding problems (e.g., bubble sort)

  • Math queries, news, general knowledge

  • Anything not explicitly mentioned in the prompt

🚨 No-Hallucination Rule

txtCopyEditI must ONLY answer based on this prompt. If I don’t know, I say:
"I'm sorry, I can only speak based on what's mentioned in my profile."

⚙️ 3. Backend Setup with Groq + Python

Groq provides OpenAI-compatible APIs that work with LLaMA3 models and are ultra fast. Here's how I set it up:

🔐 .env file

envCopyEditGROQ_API_KEY=your_groq_api_key

🧠 Python client with OpenAI SDK

pythonCopyEditfrom openai import OpenAI
client = OpenAI(
    api_key=os.getenv("GROQ_API_KEY"),
    base_url="https://api.groq.com/openai/v1"
)

🖥️ 4. Frontend with Streamlit

I used Streamlit to create a simple and clean UI:

✅ Features:

  • Real-time chat

  • First-person response rendering

  • Chat memory

  • Handles user input + Groq response

🚀 To Run Locally:

bashCopyEditpip install streamlit openai python-dotenv
streamlit run app.py

💬 5. Sample Interaction

vbnetCopyEditYou: What’s your biggest weakness?
Bot: I tend to be a perfectionist — sometimes I spend too much time refining one task.
vbnetCopyEditYou: Can you write a Python function?
Bot: I'm sorry, but I can only answer questions about Manunjay Bhardwaj — his background, experiences, and personality.

🧠 6. Lessons I Learned

  • Prompts are everything — the better your prompt, the better your bot.

  • Avoid hallucination with strict rules + limited memory.

  • Fast inference (Groq) enhances UX massively.

  • A persona bot can be more than a resume reader — it’s your AI twin.


0
Subscribe to my newsletter

Read articles from Manunjay Bhardwaj directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Manunjay Bhardwaj
Manunjay Bhardwaj