Digital Twin Workshop - Simplified Version
Build Your AI Agent with RAG Technology
Build a personal AI agent for job interview preparation using RAG and Claude Desktop integration
Digital Twin Workshop
Build your personal AI agent for interview preparation using modern RAG technology
Project Overview Video
Watch this comprehensive overview to understand the project and the AI-powered development approach we'll use.
This streamlined workshop guides you through creating a production-ready digital twin system. You'll learn to build an intelligent AI agent that can answer questions about your professional background, helping you prepare for interviews and showcase your expertise.
Professional Profile Setup
Structure and organize your career data for AI processing
RAG System Implementation
Build semantic search with Upstash Vector Database
MCP Server Development
Create Model Context Protocol servers for AI integration
Interview Simulation
Practice with realistic job posting scenarios
Python
RAG System, Vector Embeddings
Next.js
MCP Server, TypeScript
Upstash Vector
Vector Database, Semantic Search
VS Code + Claude
AI Development, Testing
Core Skills
- RAG system architecture and implementation
- Vector database integration with Upstash
- MCP server development with Next.js
- AI-powered interview preparation techniques
Deliverables
- Personal digital twin AI agent
- Production MCP server deployment
- Interview simulation framework
- Comprehensive professional profile system
Required:
- VS Code Insider Edition installed with GitHub Copilot Agent mode
- Python 3.8+ with pip package manager
- Basic understanding of JSON, Python, and command line
- Groq API key (free tier available)
- Upstash Vector Database account (free tier available)
- Claude Desktop application installed
Helpful Resources:
Workshop Steps
Follow these steps to build your AI digital twin
Environment Setup
Install required tools and verify your development environment is ready
📚 Understanding This Step
Setting up the right development environment is crucial for this workshop. VS Code Insider Edition includes the latest GitHub Copilot Agent features that integrate seamlessly with MCP servers. We'll verify all tools are properly configured before building your digital twin.
Tasks to Complete
Environment Setup Commands
Run these commands to verify your setup and create environment configuration
# Check Python version (should be 3.8+)
python --version
# Check pip is available
pip --version
# Verify VS Code Insider is installed
code-insiders --version
# Create project directory
mkdir digital-twin-workshop
cd digital-twin-workshop
# Create environment file with API keys
echo # Upstash Vector Database > .env
echo UPSTASH_VECTOR_REST_URL=\"<reuse from rag food>\" >> .env
echo UPSTASH_VECTOR_REST_TOKEN=\"<reuse from rag food>\" >> .env
echo. >> .env
echo # Groq API Configuration >> .env
echo GROQ_API_KEY=<reuse from rag food> >> .env
# Create basic project structure
mkdir data
touch digitaltwin.json
touch embed_digitaltwin.py
touch digital_twin_mcp_server.py
Helpful Resources
VS Code Insider Download
Latest VS Code with cutting-edge features
GitHub Copilot Agent Mode Guide
Setup guide for Copilot Agent integration
Groq API Console
Get your free Groq API key for fast LLM inference (reuse from RAG Food workshop)
Upstash Console
Create your free vector database (reuse credentials from RAG Food workshop)
Create Your Digital Twin Profile
Build a comprehensive JSON representation of your professional profile and experience
📚 Understanding This Step
Your digital twin serves as the comprehensive knowledge base for interview preparation. Think strategically about all the questions that recruiters, HR, hiring managers, technical managers, and project managers will ask you across different interview stages. The more comprehensive and specific your data, the better your AI assistant will perform.
Tasks to Complete
Complete Digital Twin JSON Template
Comprehensive professional profile structure optimized for interview scenarios. Use GitHub Copilot or Claude AI to help expand and refine this template with your specific details.
{
\"personal\": {
\"name\": \"Your Full Name\",
\"title\": \"Senior Software Engineer\",
\"location\": \"Melbourne, Australia\",
\"summary\": \"Passionate software engineer with 5+ years building scalable applications...\",
\"elevator_pitch\": \"Brief 30-second introduction highlighting your unique value proposition\",
\"contact\": {
\"email\": \"your.email@example.com\",
\"linkedin\": \"https://linkedin.com/in/yourprofile\",
\"github\": \"https://github.com/yourusername\",
\"portfolio\": \"https://yourportfolio.com\"
}
},
\"salary_location\": {
\"current_salary\": \"$85,000 - $95,000 AUD\",
\"salary_expectations\": \"$95,000 - $110,000 AUD based on role complexity\",
\"location_preferences\": [\"Melbourne CBD\", \"Remote\", \"Hybrid\"],
\"relocation_willing\": true,
\"remote_experience\": \"3+ years remote collaboration experience\",
\"travel_availability\": \"Available for interstate travel up to 25%\",
\"work_authorization\": \"Australian Citizen / Permanent Resident\"
},
\"experience\": [
{
\"company\": \"TechCorp Australia\",
\"title\": \"Senior Software Engineer\",
\"duration\": \"Jan 2021 - Present (3.5 years)\",
\"company_context\": \"200+ employee fintech startup, Series B funding\",
\"team_structure\": \"Engineering team of 25, direct reports: 3 junior developers\",
\"achievements_star\": [
{
\"situation\": \"Legacy monolith causing 3-second page load times affecting user retention\",
\"task\": \"Lead architectural redesign to improve performance\",
\"action\": \"Implemented microservices architecture using Docker, Kubernetes, and Redis caching\",
\"result\": \"Reduced load times by 40% to 1.8s, increased user retention by 15%, saved $50K annually in server costs\"
}
],
\"technical_skills_used\": [\"Python\", \"AWS (EC2, RDS, S3)\", \"Docker\", \"Kubernetes\", \"PostgreSQL\"],
\"leadership_examples\": [\"Mentored 3 junior developers\", \"Led code review processes\", \"Coordinated with product and design teams\"],
\"budget_managed\": \"$300K annual infrastructure budget\",
\"team_size_managed\": 5
}
],
\"skills\": {
\"technical\": {
\"programming_languages\": [
{\"language\": \"Python\", \"years\": 5, \"proficiency\": \"Expert\", \"frameworks\": [\"Django\", \"FastAPI\", \"Flask\"]},
{\"language\": \"JavaScript\", \"years\": 4, \"proficiency\": \"Advanced\", \"frameworks\": [\"React\", \"Node.js\", \"TypeScript\"]}
],
\"databases\": [\"PostgreSQL (5 years)\", \"MongoDB (3 years)\", \"Redis (2 years)\"],
\"cloud_platforms\": [\"AWS (4 years)\", \"Docker (3 years)\", \"Kubernetes (2 years)\"],
\"ai_ml\": [\"RAG systems\", \"Vector databases\", \"LLM integration\", \"OpenAI API\"]
},
\"soft_skills\": [\"Technical Leadership\", \"Cross-functional Collaboration\", \"Mentoring\", \"Problem-solving\", \"Agile/Scrum\"],
\"certifications\": [\"AWS Solutions Architect (expires 2025)\", \"Certified Scrum Master (2023)\"]
},
\"education\": {
\"university\": \"University of Melbourne\",
\"degree\": \"Bachelor of Computer Science\",
\"graduation_year\": 2019,
\"gpa\": \"3.7/4.0 (High Distinction)\",
\"relevant_coursework\": [\"Data Structures\", \"Algorithms\", \"Database Systems\", \"Machine Learning\"],
\"thesis_project\": \"Predictive Analytics for E-commerce Recommendations\"
},
\"projects_portfolio\": [
{
\"name\": \"AI-Powered Digital Twin Workshop Platform\",
\"description\": \"End-to-end RAG system for interview preparation\",
\"technologies\": [\"Python\", \"Upstash Vector\", \"Groq API\", \"Next.js\"],
\"impact\": \"Helped 100+ professionals improve interview performance\",
\"github_url\": \"https://github.com/username/digital-twin\",
\"live_demo\": \"https://mydigitaltwin.vercel.app\"
}
],
\"career_goals\": {
\"short_term\": \"Lead technical architect role with AI/ML focus\",
\"long_term\": \"Head of Engineering at AI-first company\",
\"learning_focus\": [\"Advanced AI/ML systems\", \"Large-scale system architecture\", \"Team leadership\"],
\"industries_interested\": [\"Fintech\", \"AI/ML\", \"Enterprise SaaS\"]
},
\"interview_prep\": {
\"common_questions\": {
\"behavioral\": [
\"Tell me about a time you had to lead a difficult technical decision\",
\"Describe a project where you had to learn a new technology quickly\",
\"How do you handle conflicting priorities and tight deadlines?\"
],
\"technical\": [
\"Walk me through your approach to system design for a high-traffic application\",
\"How would you implement a real-time notification system?\",
\"Explain your experience with microservices architecture\"
],
\"situational\": [
\"A critical production bug is affecting customers. Walk me through your response process\",
\"How would you approach mentoring a struggling team member?\",
\"Describe how you would evaluate and implement a new technology in your team\"
],
\"company_research\": {
\"research_areas\": [\"Company mission and values\", \"Recent product launches\", \"Engineering culture\", \"Technical challenges\"],
\"preparation_questions\": [\"What excites you about our product?\", \"Why do you want to work here?\", \"What questions do you have for us?\"]
}
},
\"weakness_mitigation\": [
{
\"weakness\": \"Limited experience with Kubernetes in production\",
\"mitigation\": \"Currently completing CKA certification, have experience with Docker and container orchestration concepts\"
}
]
},
\"professional_development\": {
\"recent_learning\": [\"RAG systems implementation\", \"Vector databases\", \"MCP protocol development\"],
\"conferences_attended\": [\"PyCon Australia 2024\", \"AWS re:Invent 2023\"],
\"publications\": [\"Blog post: Building Production RAG Systems with Upstash Vector\"],
\"open_source\": [\"Contributor to FastAPI documentation\", \"Maintainer of internal Python utilities library\"]
}
}
Build RAG System
Create a Python system that can semantically search your professional data
📚 Understanding This Step
RAG combines semantic search with language models to provide accurate, contextual responses about your professional background.
Tasks to Complete
Essential Imports for RAG System
Key imports needed for the digital twin RAG application
# Essential imports for Digital Twin RAG System
import os
import json
from dotenv import load_dotenv
from upstash_vector import Index
from groq import Groq
# Install command:
# pip install upstash-vector groq python-dotenv
Implement RAG Application
Create the complete Python RAG application based on Binal's implementation
📚 Understanding This Step
Build the full RAG application that combines Upstash Vector search with Groq AI inference, following the production-ready patterns from Binal's digital twin implementation.
Tasks to Complete
Complete RAG Application (digitaltwin_rag.py)
Production-ready RAG system based on Binal's implementation - use this as your main application file
\"\"\"
Digital Twin RAG Application
Based on Binal's production implementation
- Upstash Vector: Built-in embeddings and vector storage
- Groq: Ultra-fast LLM inference
\"\"\"
import os
import json
from dotenv import load_dotenv
from upstash_vector import Index
from groq import Groq
# Load environment variables
load_dotenv()
# Constants
JSON_FILE = \"digitaltwin.json\"
GROQ_API_KEY = os.getenv('GROQ_API_KEY')
DEFAULT_MODEL = \"llama-3.1-8b-instant\"
def setup_groq_client():
\"\"\"Setup Groq client\"\"\"
if not GROQ_API_KEY:
print(\"❌ GROQ_API_KEY not found in .env file\")
return None
try:
client = Groq(api_key=GROQ_API_KEY)
print(\"✅ Groq client initialized successfully!\")
return client
except Exception as e:
print(f\"❌ Error initializing Groq client: {str(e)}\")
return None
def setup_vector_database():
\"\"\"Setup Upstash Vector database with built-in embeddings\"\"\"
print(\"🔄 Setting up Upstash Vector database...\")
try:
index = Index.from_env()
print(\"✅ Connected to Upstash Vector successfully!\")
# Check current vector count
try:
info = index.info()
current_count = getattr(info, 'vector_count', 0)
print(f\"📊 Current vectors in database: {current_count}\")
except:
current_count = 0
# Load data if database is empty
if current_count == 0:
print(\"📝 Loading your professional profile...\")
try:
with open(JSON_FILE, \"r\", encoding=\"utf-8\") as f:
profile_data = json.load(f)
except FileNotFoundError:
print(f\"❌ {JSON_FILE} not found!\")
return None
# Prepare vectors from content chunks
vectors = []
content_chunks = profile_data.get('content_chunks', [])
if not content_chunks:
print(\"❌ No content chunks found in profile data\")
return None
for chunk in content_chunks:
enriched_text = f\"{chunk['title']}: {chunk['content']}\"
vectors.append((
chunk['id'],
enriched_text,
{
\"title\": chunk['title'],
\"type\": chunk['type'],
\"content\": chunk['content'],
\"category\": chunk.get('metadata', {}).get('category', ''),
\"tags\": chunk.get('metadata', {}).get('tags', [])
}
))
# Upload vectors
index.upsert(vectors=vectors)
print(f\"✅ Successfully uploaded {len(vectors)} content chunks!\")
return index
except Exception as e:
print(f\"❌ Error setting up database: {str(e)}\")
return None
def query_vectors(index, query_text, top_k=3):
\"\"\"Query Upstash Vector for similar vectors\"\"\"
try:
results = index.query(
data=query_text,
top_k=top_k,
include_metadata=True
)
return results
except Exception as e:
print(f\"❌ Error querying vectors: {str(e)}\")
return None
def generate_response_with_groq(client, prompt, model=DEFAULT_MODEL):
\"\"\"Generate response using Groq\"\"\"
try:
completion = client.chat.completions.create(
model=model,
messages=[
{
\"role\": \"system\",
\"content\": \"You are an AI digital twin. Answer questions as if you are the person, speaking in first person about your background, skills, and experience.\"
},
{
\"role\": \"user\",
\"content\": prompt
}
],
temperature=0.7,
max_tokens=500
)
return completion.choices[0].message.content.strip()
except Exception as e:
return f\"❌ Error generating response: {str(e)}\"
def rag_query(index, groq_client, question):
\"\"\"Perform RAG query using Upstash Vector + Groq\"\"\"
try:
# Step 1: Query vector database
results = query_vectors(index, question, top_k=3)
if not results or len(results) == 0:
return \"I don't have specific information about that topic.\"
# Step 2: Extract relevant content
print(\"\
🧠 Searching your professional profile...\
\")
top_docs = []
for result in results:
metadata = result.metadata or {}
title = metadata.get('title', 'Information')
content = metadata.get('content', '')
score = result.score
print(f\"🔹 Found: {title} (Relevance: {score:.3f})\")
if content:
top_docs.append(f\"{title}: {content}\")
if not top_docs:
return \"I found some information but couldn't extract details.\"
print(f\"⚡ Generating personalized response...\
\")
# Step 3: Generate response with context
context = \"\
\
\".join(top_docs)
prompt = f\"\"\"Based on the following information about yourself, answer the question.
Speak in first person as if you are describing your own background.
Your Information:
{context}
Question: {question}
Provide a helpful, professional response:\"\"\"
response = generate_response_with_groq(groq_client, prompt)
return response
except Exception as e:
return f\"❌ Error during query: {str(e)}\"
def main():
\"\"\"Main application loop\"\"\"
print(\"🤖 Your Digital Twin - AI Profile Assistant\")
print(\"=\" * 50)
print(\"🔗 Vector Storage: Upstash (built-in embeddings)\")
print(f\"⚡ AI Inference: Groq ({DEFAULT_MODEL})\")
print(\"📋 Data Source: Your Professional Profile\
\")
# Setup clients
groq_client = setup_groq_client()
if not groq_client:
return
index = setup_vector_database()
if not index:
return
print(\"✅ Your Digital Twin is ready!\
\")
# Interactive chat loop
print(\"🤖 Chat with your AI Digital Twin!\")
print(\"Ask questions about your experience, skills, projects, or career goals.\")
print(\"Type 'exit' to quit.\
\")
print(\"💭 Try asking:\")
print(\" - 'Tell me about your work experience'\")
print(\" - 'What are your technical skills?'\")
print(\" - 'Describe your career goals'\")
print()
while True:
question = input(\"You: \")
if question.lower() in [\"exit\", \"quit\"]:
print(\"👋 Thanks for chatting with your Digital Twin!\")
break
if question.strip():
answer = rag_query(index, groq_client, question)
print(f\"🤖 Digital Twin: {answer}\
\")
if __name__ == \"__main__\":
main()"
Build MCP Server: Setup Next.js Project
Create a Next.js application that will serve as your MCP server foundation
📚 Understanding This Step
Set up a production-ready Next.js application with TypeScript, Tailwind CSS, and the proper project structure for building your MCP server.
Tasks to Complete
Create Next.js MCP Project
Run this command and follow the prompts
npx create-next-app@latest
Build MCP Server: Create Agent Instructions
Set up agents.md file with comprehensive instructions for GitHub Copilot to build your MCP server
📚 Understanding This Step
The agents.md file serves as a comprehensive instruction set for GitHub Copilot, providing context about your project goals, technical requirements, and implementation patterns. This enables Copilot to generate more accurate and contextual code suggestions throughout your MCP server development.
Tasks to Complete
agents.md - Complete Instructions for GitHub Copilot
Copy this entire content to your agents.md file in project root
# Digital Twin MCP Server Project Instructions
## Project Overview
Build an MCP server using the roll dice pattern to create a digital twin assistant that can answer questions about a person's professional profile using RAG (Retrieval-Augmented Generation).
## Reference Repositories
- **Pattern Reference**: https://github.com/gocallum/rolldice-mcpserver.git
- Roll dice MCP server - use same technology and pattern for our MCP server
- **Logic Reference**: https://github.com/gocallum/binal_digital-twin_py.git
- Python code using Upstash Vector for RAG search with Groq and LLaMA for generations
## Core Functionality
- MCP server accepts user questions about the person's professional background
- Create server actions that search Upstash Vector database and return RAG results
- Search logic must match the Python version exactly
## Environment Variables (.env.local)
```
UPSTASH_VECTOR_REST_URL=
UPSTASH_VECTOR_REST_TOKEN=
GROQ_API_KEY=
```
## Technical Requirements
- **Framework**: Next.js 15.5.3+ (use latest available)
- **Package Manager**: Always use pnpm (never npm or yarn)
- **Commands**: Always use Windows PowerShell commands
- **Type Safety**: Enforce strong TypeScript type safety throughout
- **Architecture**: Always use server actions where possible
- **Styling**: Use globals.css instead of inline styling
- **UI Framework**: ShadCN with dark mode theme
- **Focus**: Prioritize MCP functionality over UI - UI is primarily for MCP server configuration
## Setup Commands
```bash
pnpm dlx shadcn@latest init
```
Reference: https://ui.shadcn.com/docs/installation/next
## Upstash Vector Integration
### Key Documentation
- Getting Started: https://upstash.com/docs/vector/overall/getstarted
- Embedding Models: https://upstash.com/docs/vector/features/embeddingmodels
- TypeScript SDK: https://upstash.com/docs/vector/sdks/ts/getting-started
### Example Implementation
```typescript
import { Index } from "@upstash/vector"
const index = new Index({
url: process.env.UPSTASH_VECTOR_REST_URL!,
token: process.env.UPSTASH_VECTOR_REST_TOKEN!,
})
// RAG search example
await index.query({
data: "What is Upstash?",
topK: 3,
includeMetadata: true,
})
```
## Additional Useful Resources
- Add any other relevant documentation links as needed
- Include specific API references for integrations
- Reference MCP protocol specifications
- Add deployment and testing guidelines
---
**Note**: This file provides context for GitHub Copilot to generate accurate, project-specific code suggestions. Keep it updated as requirements evolve.
Build MCP Server: AI-Assisted Code Generation
Use GitHub Copilot with your agents.md instructions to generate the complete MCP server implementation
📚 Understanding This Step
Leverage AI-powered code generation to build your MCP server efficiently. GitHub Copilot will use your agents.md file as context to generate accurate, project-specific code that follows your technical requirements and architectural patterns.
Tasks to Complete
Code & Instructions
Prerequisites Verification
Ensure your development environment is properly configured before starting AI-assisted code generation
Before beginning AI-assisted development, verify these requirements:
✅ GitHub MCP server running in VS Code Insiders
✅ Claude Sonnet 4.0+ model selected in GitHub Copilot
✅ agents.md file created and customized for your project
These components work together to provide context-aware code generation.
Step 1: Customize Your Project Context
Review and personalize your agents.md file to ensure GitHub Copilot understands your specific project requirements
Open your agents.md file and make these customizations:
1. Update GitHub repository links to point to YOUR specific RAG solution
2. Add any additional project-specific requirements
3. Verify environment variables match your .env.local file
4. Add any custom business logic or constraints
5. Include specific API endpoints or database schemas you're using
This context helps Copilot generate more accurate, project-specific code.
Step 2: Generate Code
Use this prompt to create the foundational server actions for your MCP server's RAG functionality
@workspace Use the instructions in agents.md to help me build the MCP server. Ask me any clarifying questions first. Then, create server actions that implement the RAG functionality using Upstash Vector and Groq as described in the instructions. Start by installing the necessary libraries and then build out the MCP server
Step 3: Common Development Issues
Expected errors you may encounter during development and their solutions
**TypeScript Type Errors**
Error: Property 'metadata' does not exist on type 'QueryResult'
Solution: Install proper @upstash/vector types or use type assertions
**Environment Variable Issues**
Error: UPSTASH_VECTOR_REST_URL is undefined
Solution: Verify .env.local file exists and variables are properly set
**MCP Protocol Errors**
Error: Invalid MCP response format
Solution: Ensure response follows MCP specification from roll dice pattern
**Server Action Errors**
Error: Server actions must be async functions
Solution: Add 'use server' directive and ensure proper async/await usage
**Dependency Issues**
Error: Module '@upstash/vector' not found
Solution: Run 'pnpm add @upstash/vector groq' to install dependencies
Step 4: Start the Dev Server
Commands to start your MCP server locally
# Start development server
pnpm dev
Step 5: Check for quality of your Generated Code
Commands to check the quality of generate code
# Start development server
pnpm lint
Step 6: AI-Powered Code Improvements
Use these follow-up prompts to refine and optimize your generated code
Ask GitHub Copilot to help you:
• Fix any TypeScript errors that appear
• Add comprehensive error handling
• Optimize performance for faster responses
• Add logging and debugging capabilities
• Improve code documentation and comments
Example prompt: '@workspace Review the generated code and add proper error handling for the Upstash Vector queries'
Test MCP Server: Test your MCP in GitHub Copilot using Claude Sonnet
Configure and test your MCP server within VS Code Insiders with GitHub Copilot, enabling AI-powered access to your digital twin data
📚 Understanding This Step
This step focuses on integrating your MCP server with VS Code Insiders and GitHub Copilot. The Model Context Protocol (MCP) allows GitHub Copilot to access your digital twin data directly within the development environment. You'll configure the MCP client, start your server, and test the integration to ensure Copilot can query your professional profile data through the RAG system.
Tasks to Complete
Code & Instructions
Step 1: Create MCP Configuration File
Create the .vscode/mcp.json file to configure VS Code's MCP client to connect to your digital twin server
{
"servers": {
"digital-twin-mcp": {
"type": "http",
"url": "http://localhost:3000/api/mcp",
"timeout": 30000,
"description": "Digital Twin RAG MCP Server for interview preparation"
}
}
}
Step 2: Start the Dev Server
Start the development server with this command
# Start development server
pnpm dev
Step 3: Start MCP Server with Monitoring
Start your MCP server using VS Code's integrated MCP controls and monitor the output logs
# Start via VS Code MCP Integration
# 1. Open your .vscode/mcp.json file in VS Code Insiders
# 2. You should see a "Start" button/link next to your server configuration
# 3. Click on the "Start" button to launch your MCP server
# 4. VS Code will automatically open the "Output" tab in the Terminal panel
# 5. Monitor the server logs in the Output tab for successful startup
Step 4: Server Log Monitoring Checklist
Key server logs to watch for during MCP server startup and operation
**Successful Startup Logs:**
✅ "Ready in [X]ms" - Next.js server started
✅ "Local: http://localhost:3000" - Server accessible locally
✅ "Compiled successfully" - No TypeScript/build errors
**MCP Endpoint Logs:**
✅ "GET /api/mcp 200" - MCP endpoint responding
✅ "Connected to Upstash Vector successfully!" - Database connection
✅ "Groq client initialized successfully!" - AI client ready
**Error Logs to Watch For:**
❌ "UPSTASH_VECTOR_REST_URL is undefined" - Missing environment variables
❌ "Module not found" - Missing dependencies (run pnpm install)
❌ "Type error" - TypeScript compilation issues
❌ "Connection refused" - Database connection problems
**Testing Your Server:**
• Server responds at http://localhost:3000/api/mcp
• Returns valid JSON-RPC 2.0 response
• No error messages in terminal
• Environment variables loaded correctly
Step 5: Configure GitHub Copilot MCP Integration
Steps to enable MCP server integration within VS Code Insiders with GitHub Copilot
**In VS Code Insiders:**
1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
2. Search for "GitHub Copilot: Enable MCP Servers"
3. Select your project's .vscode/mcp.json configuration
4. Restart VS Code Insiders to apply MCP settings
**Verify MCP Integration:**
• Check VS Code status bar for MCP connection indicator
• Look for "MCP: Connected" or similar status
• Ensure no error notifications about MCP connection
**Alternative Method:**
• Open VS Code Settings (Ctrl+,)
• Search for "copilot mcp"
• Enable "GitHub Copilot: Use MCP Servers"
• Point to your .vscode/mcp.json file path
Step 6: Test MCP Integration with GitHub Copilot
Sample prompts to test your MCP server integration with GitHub Copilot
@workspace Can you tell me about my work experience using the digital twin MCP server?
Step 7: Advanced MCP Testing Prompts
Additional test prompts to verify your digital twin MCP server is working correctly
@workspace Using my digital twin data, what are my key technical skills?
Step 8: Final MCP Verification Prompt
Comprehensive test to validate full MCP RAG functionality
@workspace Query my digital twin MCP server to help me prepare for a technical interview. What projects should I highlight?
Step 9: Troubleshooting MCP Connection Issues
Common MCP integration problems and their solutions
**MCP Server Not Responding:**
• Verify server is running on http://localhost:3000
• Check .vscode/mcp.json file exists and is valid JSON
• Restart VS Code Insiders after creating MCP config
• Ensure no firewall blocking localhost:3000
**GitHub Copilot Not Using MCP:**
• Confirm GitHub Copilot has MCP features enabled
• Check VS Code Insiders version (needs latest version)
• Verify @workspace prefix in prompts
• Try restarting GitHub Copilot extension
**No Digital Twin Responses:**
• Check server logs for Upstash/Groq connection errors
• Verify environment variables in .env.local
• Test /api/mcp endpoint directly in browser
• Ensure digitaltwin.json data was loaded into vector database
**Debugging Commands:**
```bash
# Test MCP endpoint directly
curl -X POST http://localhost:3000/api/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"ping","id":1}'
# Check server logs for errors
pnpm dev --verbose
```
Real Interview Simulation with Job Postings
Practice realistic interview scenarios using actual job postings from Seek.com.au with your MCP-powered digital twin in VS Code Insiders
📚 Understanding This Step
This step transforms your digital twin into a practical interview preparation tool by testing it against real job postings. You'll source actual job descriptions from Seek.com.au, create structured job files, and use GitHub Copilot with your MCP server to conduct realistic recruiter screenings. This simulation helps identify gaps in your profile and provides critical feedback on your interview readiness.
Tasks to Complete
Code & Instructions
Step 1: Find Your Target Job
Instructions for sourcing a relevant job posting from Seek.com.au
**Job Search Process:**
1. Go to https://www.seek.com.au/ and search for a job that matches your skills
2. Select a role that challenges you but is realistic for your background
3. Choose a posting with detailed requirements and selection criteria
4. Copy the entire job posting content (company name, job description, requirements, etc.)
**Job Selection Tips:**
• Position matches your technical skills (70-80% overlap)
• Has clear key selection criteria listed
• Includes specific technical requirements
• Realistic for your experience level
Step 2: Create Job Posting Folder and File
Simple commands to create the job posting structure
# Create job-postings folder and file
mkdir job-postings
new-item job-postings\job1.md
# Open the file in VS Code
code job-postings\job1.md
Step 3: Copy Job Posting Content
Simply paste the job posting content into your job1.md file
**Instructions:**
1. Open the job1.md file you just created
2. Copy and paste the entire job posting from Seek.com.au
3. Include everything: company name, job title, description, requirements, salary, location
4. Save the file
**What to Include:**
• Complete job description
• All requirements (essential and desirable)
• Company information
• Salary range and location
• Any additional details from the posting
Step 4: Complete Interview Simulation Prompt
Copy this complete prompt into GitHub Copilot Chat to run the full interview simulation
@workspace You are a senior recruiter conducting a comprehensive interview simulation using the job posting in job-postings/job1.md and my digital twin MCP server data.
**INTERVIEW PROCESS:**
**Phase 1 - Initial Screening (5 minutes)**
You are HIGHLY CRITICAL and expect SHORT, SHARP answers. Check these critical factors:
- Location compatibility and willingness to work from specified location
- Salary expectations alignment with the offered range
- ALL mandatory/key selection criteria are met
- Technical skills match the specific requirements
- Experience level appropriate for the role
Ask 3-4 probing screening questions.
**Phase 2 - Technical Assessment (10 minutes)**
Conduct focused technical evaluation:
- Specific programming languages/frameworks mentioned in the job
- Years of experience with required technologies
- Project complexity and scale they've handled
- Problem-solving approach for job scenarios
- Technical leadership experience if required
Provide a technical competency matrix with 1-5 ratings for each required skill.
**Phase 3 - Cultural Fit (5 minutes)**
Analyze behavioral fit:
- Working style compatibility
- Leadership experience vs expectations
- Team collaboration skills
- Communication style
- Career motivation alignment
**Phase 4 - Final Assessment Report**
Provide comprehensive report:
**EXECUTIVE SUMMARY:**
- HIRE/DO NOT HIRE recommendation
- Overall suitability score (1-10)
- Key reasons for recommendation
**DETAILED BREAKDOWN:**
- Technical competency scores
- Experience relevance analysis
- Cultural fit evaluation
- Salary/location alignment
- Risk factors identified
**IMPROVEMENT AREAS:**
- Skills gaps to address
- Missing profile information
- Areas for better interview responses
- Recommended next steps
Be ruthless in your assessment - only recommend candidates who are genuinely suitable for this specific role.
Step 5: Review Interview Results
Analyze the recruiter feedback to improve your digital twin profile
**After completing the interview simulation, review:**
**Performance Analysis:**
• Which questions were answered well vs poorly?
• What skills gaps were identified?
• Were there missing details in your digital twin profile?
• How was your overall suitability score?
**Profile Improvement Actions:**
• Update digitaltwin.json with missing information
• Add specific project examples for weak areas
• Include quantified achievements that were missing
• Strengthen technical knowledge gaps
• Improve storytelling around key experiences
**Next Steps:**
• Try the simulation with different job postings
• Focus on improving your lowest-scored areas
• Update your profile based on feedback
• Practice with more challenging roles
Step 6: Refine your digital twin profile (json) based on feedback
Comprehensive guide to updating your digital twin profile with enhanced salary/location data, STAR-format project experiences, and structured professional information
**Critical Profile Enhancement Areas:**
**1. Salary & Location Information**
• Current salary range and expectations
• Location preferences and relocation willingness
• Remote work capabilities and experience
• Travel availability for work assignments
• Visa/work authorization status
**2. Detailed Project Experiences (STAR Format)**
Structure each major project using STAR methodology:
• **Situation**: Project context and business challenge
• **Task**: Your specific role and responsibilities
• **Action**: Detailed steps you took and technologies used
• **Result**: Quantified outcomes and business impact
**3. Enhanced Professional Data Structure**
**Example Enhanced JSON Structure:**
```json
{
"salary_location": {
"current_salary_range": "$85,000 - $95,000 AUD",
"salary_expectations": "$95,000 - $110,000 AUD",
"location_preferences": ["Melbourne", "Sydney", "Remote"],
"relocation_willing": true,
"remote_experience": "3 years full remote work experience",
"travel_availability": "Up to 25% interstate travel"
},
"projects_star_format": [
{
"project_name": "E-commerce Platform Migration",
"situation": "Legacy system causing 40% performance issues during peak sales",
"task": "Lead technical migration to microservices architecture as Senior Developer",
"action": "Designed new architecture using Node.js, implemented CI/CD pipeline, managed team of 4 developers over 6 months",
"result": "Improved performance by 60%, reduced deployment time from 4 hours to 15 minutes, increased customer satisfaction by 35%",
"technologies": ["Node.js", "AWS", "Docker", "MongoDB"],
"team_size": 4,
"duration": "6 months",
"budget_managed": "$450,000"
}
],
"leadership_examples_star": [
{
"situation": "Critical production bug affecting 10,000+ users",
"task": "Coordinate emergency response as technical lead",
"action": "Assembled cross-functional team, implemented hotfix within 2 hours, conducted post-mortem analysis",
"result": "Restored service with minimal downtime, prevented $50K revenue loss, improved incident response procedures"
}
]
}
```
**4. Common Missing Information to Add**
• Specific programming language versions and years of experience
• Industry certifications and their expiry dates
• Management experience: team sizes, budget responsibility, hiring experience
• Cross-functional collaboration examples
• Mentoring and training experience
• Open source contributions
• Conference speaking or technical writing
• Agile/Scrum experience with specific roles
**5. Quantification Examples**
• "Reduced server response time from 3s to 0.5s (83% improvement)"
• "Managed annual technology budget of $2.3M across 3 teams"
• "Hired and onboarded 12 developers over 18 months"
• "Increased test coverage from 45% to 92%"
• "Led migration affecting 100,000+ daily active users"
**6. Profile Update Process**
1. Review interview feedback for specific gaps identified
2. Add missing salary/location information using the structure above
3. Convert major achievements into STAR format stories
4. Quantify all achievements with specific metrics
5. Include industry-specific keywords from job postings
6. Add soft skills examples with concrete situations
7. Update technical skills with proficiency levels (1-5 scale)
8. Save updated JSON and re-run your Python embedding script
This comprehensive approach ensures your digital twin can handle detailed recruiter questions about compensation, relocation, and specific project experiences with concrete examples and measurable outcomes.
Step 7: Re-embed your updated digital twin profile
Run the Python script to re-embed your enhanced digital twin profile into the Upstash Vector database
# Run the embedding script to update vector database
python embed_digitaltwin.py
Step 8: Re-test your MCP server with updated profile
Use GitHub Copilot to re-run the interview simulation with your enhanced digital twin profile
@workspace Using my updated digital twin MCP server data, can you conduct another comprehensive interview simulation based on the job posting in job-postings/job1.md? Please provide detailed feedback on improvements.
Step 9: Test Different Interviewer Personas
Practice with various interviewer personas to prepare for different stages of the hiring process
**Testing Different Interviewer Personas:**
**IMPORTANT TIP:** Create a new GitHub Copilot chat session for each interviewer persona to avoid bias from previous answers. This ensures each interview simulation is independent and realistic.
**1. HR/Recruiter Initial Screen (15 minutes)**
*Focus: Cultural fit, basic qualifications, salary expectations*
Prompt:
```
@workspace You are an experienced HR recruiter conducting an initial phone screen. You focus on cultural fit, basic qualifications, and compensation alignment. Use the job posting in job-postings/job1.md and my digital twin MCP server data.
Key areas to assess:
- Cultural alignment with company values
- Basic qualification verification
- Salary expectations vs budget
- Availability and start date
- Motivation for role change
- Communication skills
Conduct a 15-minute screening call with 5-6 questions. Provide pass/fail recommendation with reasoning.
```
**2. Technical Interview (45 minutes)**
*Focus: Technical competency, problem-solving, architecture*
Prompt:
```
@workspace You are a senior software engineer conducting a technical interview. Focus on deep technical assessment using the job posting requirements in job-postings/job1.md and my digital twin MCP server data.
Assessment areas:
- Programming language expertise and best practices
- System design and architecture decisions
- Problem-solving methodology
- Code quality and testing approaches
- Technology stack experience depth
- Technical leadership examples
Ask 4-5 detailed technical questions. Include a system design challenge. Rate technical competency (1-10) for each required skill.
```
**3. Hiring Manager Interview (30 minutes)**
*Focus: Role fit, team dynamics, project experience*
Prompt:
```
@workspace You are the hiring manager for this role. You need someone who can deliver results, work well with your existing team, and grow with the company. Use job-postings/job1.md and my digital twin MCP server data.
Evaluation focus:
- Direct role responsibilities alignment
- Team collaboration and leadership style
- Project management and delivery experience
- Growth potential and career aspirations
- Specific examples of past successes
- How they handle challenges and setbacks
Conduct a focused 30-minute interview. Assess role fit (1-10) and provide hiring recommendation.
```
**4. Project Manager Interview (25 minutes)**
*Focus: Collaboration, communication, project delivery*
Prompt:
```
@workspace You are a project manager who will work closely with this hire. Focus on collaboration, communication, and project delivery capabilities. Reference job-postings/job1.md and my digital twin MCP server data.
Key evaluation areas:
- Cross-functional collaboration experience
- Communication style and clarity
- Meeting deadlines and managing scope
- Stakeholder management skills
- Agile/project methodology experience
- Conflict resolution and problem escalation
Ask 5 scenario-based questions about project situations. Rate collaboration skills (1-10).
```
**5. Head of People & Culture Interview (20 minutes)**
*Focus: Values alignment, team culture, long-term fit*
Prompt:
```
@workspace You are the Head of People & Culture. Your focus is on values alignment, cultural contribution, and long-term employee success. Use job-postings/job1.md and my digital twin MCP server data.
Assessment priorities:
- Company values alignment and demonstration
- Diversity, equity, and inclusion mindset
- Team culture contribution potential
- Long-term career goals alignment
- Learning and development approach
- Work-life balance and well-being
Conduct a values-based interview with 4-5 questions. Assess cultural fit (1-10) and growth potential.
```
**6. Executive/Leadership Interview (25 minutes)**
*Focus: Strategic thinking, leadership potential, business impact*
Prompt:
```
@workspace You are a senior executive (VP/Director level) conducting a final interview. Focus on strategic thinking, leadership potential, and business impact. Reference job-postings/job1.md and my digital twin MCP server data.
Evaluation criteria:
- Strategic thinking and business acumen
- Leadership philosophy and examples
- Innovation and improvement mindset
- Ability to influence without authority
- Long-term vision and goal setting
- Executive presence and communication
Ask 3-4 high-level strategic questions. Assess leadership potential (1-10).
```
**Testing Strategy:**
1. **New Chat Session**: Start fresh GitHub Copilot chat for each persona
2. **Different Days**: Space out interviews over several days for varied responses
3. **Note Patterns**: Track which personas identify similar strengths/weaknesses
4. **Iterate Profile**: Update digital twin based on consistent feedback across personas
5. **Score Tracking**: Maintain spreadsheet of scores across different interview types
**Success Metrics:**
- Technical Interview: 7+ rating on core skills
- Hiring Manager: 8+ role fit score
- HR Screen: Pass recommendation
- Project Manager: 7+ collaboration score
- People & Culture: 8+ cultural fit
- Executive: 6+ leadership potential
This comprehensive approach prepares you for the complete interview process from initial screening to executive approval.
Test MCP Server in Claude Desktop
Now that your MCP server is fully tested and optimized in VS Code, integrate it with Claude Desktop for seamless interview preparation conversations
📚 Understanding This Step
After comprehensive testing and refinement in VS Code, your digital twin MCP server is ready for integration with Claude Desktop. This provides a natural conversation interface for interview preparation, allowing you to practice with Claude while accessing your personalized professional data through the MCP server.
Tasks to Complete
Code & Instructions
Step 1: Verify MCP Server Status
Ensure your digital twin MCP server is running before connecting Claude Desktop
# Verify your MCP server is running
# Navigate to your Next.js MCP project directory
cd your-digital-twin-mcp-project
# Start the development server if not already running
pnpm dev
# Verify server is accessible
# Server should be running at: http://localhost:3000
# MCP endpoint should respond at: http://localhost:3000/api/mcp
Step 2: Connect Claude Desktop using MCP Remote
Use npx mcp-remote to create a bridge between Claude Desktop and your local MCP server
# Open a new terminal/PowerShell window
# Run mcp-remote to bridge your local server to Claude Desktop
npx -y mcp-remote http://localhost:3000/api/mcp
# This command will:
# 1. Install mcp-remote if not already installed
# 2. Create a tunnel to your local MCP server
# 3. Provide a URL that Claude Desktop can connect to
# 4. Keep the bridge running (don't close this terminal)
Step 3: Configure Claude Desktop MCP Connection
Add your MCP server to Claude Desktop configuration using the mcp-remote URL
// In Claude Desktop Settings > Developer > MCP Servers:
{
"mcpServers": {
"digital-twin-remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/api/mcp"],
"env": {
"NODE_ENV": "production"
}
}
}
}
// Alternative: Use the tunnel URL provided by mcp-remote
// Replace <tunnel-url> with the actual URL from Step 2
{
"mcpServers": {
"digital-twin": {
"command": "node",
"args": ["-e", "console.log('MCP server connected')"],
"env": {
"MCP_SERVER_URL": "<tunnel-url>"
}
}
}
}
Step 4: Test Digital Twin in Claude Desktop
Initial test queries to verify your digital twin MCP server is working in Claude Desktop
**Test these queries in Claude Desktop:**
1. "Can you tell me about my work experience?"
2. "What are my key technical skills and expertise areas?"
3. "Describe a challenging project I worked on"
4. "What salary range should I expect for my experience level?"
5. "Help me prepare for a technical interview"
**Expected Results:**
• Claude should access your digital twin data via the MCP server
• Responses should be personalized to your professional profile
• Information should match what was tested in VS Code
• Claude should speak in first person about your experience
Step 5: Practice Interview Scenarios in Claude Desktop
Use Claude Desktop's natural conversation interface for interview preparation
**Interview Practice Examples:**
**Scenario 1: Behavioral Interview**
"Claude, I have an interview tomorrow. Can you ask me behavioral questions based on my background and help me structure my answers using the STAR method?"
**Scenario 2: Technical Deep Dive**
"Based on my technical experience, what are the most likely technical questions I'll face for a senior developer role? Help me prepare detailed answers."
**Scenario 3: Salary Negotiation**
"Given my experience and location preferences, help me prepare for salary negotiations. What's a reasonable range to request?"
**Scenario 4: Company Research Integration**
"I'm interviewing at [Company Name] for [Role]. Based on my profile, how should I position myself for this specific opportunity?"
**Advantages of Claude Desktop:**
• More natural, conversational interview practice
• Longer context for complex discussions
• Better follow-up questions and coaching
• Seamless integration with your digital twin data
Step 6: Troubleshooting Claude Desktop Connection
Common issues and solutions for MCP server integration with Claude Desktop
**Common Issues:**
**MCP Server Not Found:**
• Verify mcp-remote is still running (don't close the terminal)
• Ensure your Next.js dev server is running on localhost:3000
• Check Claude Desktop MCP configuration syntax
• Restart Claude Desktop after configuration changes
**No Digital Twin Responses:**
• Verify MCP endpoint responds: http://localhost:3000/api/mcp
• Check server logs for Upstash/Groq connection errors
• Ensure digitaltwin.json was properly embedded
• Test with VS Code first to isolate issues
**Slow or Timeout Responses:**
• Check internet connection for Upstash/Groq API calls
• Verify API keys in .env.local file
• Increase timeout in Claude Desktop configuration
• Monitor server performance in terminal logs
**Debugging Steps:**
1. Test MCP server directly in VS Code first
2. Verify mcp-remote tunnel is active
3. Check Claude Desktop logs/error messages
4. Restart all components in sequence:
- Next.js dev server
- mcp-remote bridge
- Claude Desktop application
Step 7: Compare VS Code vs Claude Desktop Experience
Evaluate the differences between the two interfaces for optimal interview preparation
**VS Code GitHub Copilot Advantages:**
• Integrated with development workflow
• Excellent for technical deep-dives
• Code-focused interview preparation
• Structured prompt-based interactions
• Better for specific technical assessments
**Claude Desktop Advantages:**
• More natural conversation flow
• Better for behavioral and cultural fit practice
• Longer context retention for complex scenarios
• Superior follow-up questions and coaching
• More human-like interview simulation experience
**Recommended Usage:**
• **Technical Preparation**: Use VS Code for programming questions, system design, and technical competency assessment
• **Interview Practice**: Use Claude Desktop for behavioral questions, salary negotiation, and full interview simulations
• **Profile Refinement**: Use VS Code for analyzing and updating your digital twin JSON structure
• **Conversation Practice**: Use Claude Desktop for natural interview flow and communication skills
**Best Practice:**
Use both interfaces complementary - technical preparation in VS Code, conversation practice in Claude Desktop. This provides comprehensive interview readiness across all dimensions.
Deploy MCP Server to Vercel
Deploy your fully tested MCP server to Vercel for reliable, 24/7 access from anywhere
📚 Understanding This Step
Once your MCP server is fully tested locally and working with both VS Code and Claude Desktop, deploying to Vercel ensures it's always available for interview practice. Vercel provides seamless Next.js deployment with automatic HTTPS, global CDN, and zero-downtime deployments. This step walks you through the complete deployment process using the Vercel web interface.
Tasks to Complete
Code & Instructions
Step 1: Pre-Deployment Build Test
Verify your MCP server builds successfully before deployment to avoid deployment issues
# Navigate to your MCP server project directory
cd your-digital-twin-mcp-project
# Install dependencies if needed
pnpm install
# Run the build command to check for errors
pnpm build
# Expected output:
# ✓ Compiled successfully
# ✓ Linting and checking validity of types
# ✓ Creating an optimized production build
# If build succeeds, you're ready for deployment
# If there are errors, fix them before proceeding
Step 2: Create GitHub Repository
Set up a GitHub repository for your MCP server project
# Initialize git repository if not already done
git init
# Add all files to git
git add .
# Commit your changes
git commit -m "Initial commit: Digital Twin MCP Server"
# Create repository on GitHub (go to github.com/new)
# Repository name: your-digital-twin-mcp
# Description: Digital Twin MCP Server for Interview Preparation
# Set as Public or Private (your choice)
# Add GitHub repository as remote (replace YOUR_USERNAME)
git remote add origin https://github.com/YOUR_USERNAME/your-digital-twin-mcp.git
# Push to GitHub
git branch -M main
git push -u origin main
Step 3: Access Vercel Dashboard
Navigate to Vercel and set up your account for deployment
**Vercel Account Setup:**
1. Go to https://vercel.com in your web browser
2. Click "Sign Up" if you don't have an account
3. Choose "Continue with GitHub" for seamless integration
4. Authorize Vercel to access your GitHub repositories
5. Complete your profile setup
**Vercel Dashboard Overview:**
• Projects: Where your deployed applications are listed
• Teams: Collaboration features (use Personal for this project)
• Settings: Account and billing configuration
• Import Git Repository: Main deployment option we'll use
Step 4: Import GitHub Repository to Vercel
Import your MCP server repository from GitHub to Vercel for deployment
**Import Process:**
1. In Vercel Dashboard, click "Add New..." → "Project"
2. Select "Import Git Repository"
3. Choose "GitHub" as your Git provider
4. Find your "your-digital-twin-mcp" repository
5. Click "Import" next to your repository
**Project Configuration:**
• **Framework Preset**: Next.js (should auto-detect)
• **Root Directory**: ./ (keep default)
• **Build Command**: `pnpm build` (should auto-detect)
• **Output Directory**: .next (should auto-detect)
• **Install Command**: `pnpm install` (should auto-detect)
**Don't deploy yet!** Click "Configure Project" to set environment variables first.
Step 5: Configure Environment Variables
Add your API keys and database credentials to Vercel's secure environment variables
**Environment Variables Setup:**
In the Vercel project configuration, scroll down to "Environment Variables" section:
**Add these variables one by one:**
1. **UPSTASH_VECTOR_REST_URL**
- Value: [Your Upstash Vector URL from .env.local]
- Environment: Production, Preview, Development
2. **UPSTASH_VECTOR_REST_TOKEN**
- Value: [Your Upstash Vector token from .env.local]
- Environment: Production, Preview, Development
**Important Security Notes:**
• Never commit API keys to your GitHub repository
• Use Vercel's environment variables for secure credential storage
• Each environment variable should be added to all environments (Production, Preview, Development)
Step 6: Deploy to Vercel
Complete the deployment process and get your live MCP server URL
**Deployment Process:**
1. After configuring environment variables, click "Deploy"
2. Vercel will:
- Clone your GitHub repository
- Install dependencies with `pnpm install`
- Build your project with `pnpm build`
- Deploy to their global CDN
**Deployment Timeline:**
• Building: 2-3 minutes
• Deploying: 30-60 seconds
• DNS propagation: Immediate
**Success Indicators:**
✅ "Deployment completed successfully"
✅ Green checkmark next to your project
✅ Live URL provided (e.g., your-digital-twin-mcp.vercel.app)
**Your MCP server will be available at:**
`https://your-project-name.vercel.app/api/mcp`
Step 7: Test Live MCP Server
Verify your deployed MCP server is working correctly in production
# Test your live MCP endpoint (replace with your actual Vercel URL)
curl -X POST https://your-digital-twin-mcp.vercel.app/api/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"ping","id":1}'
# Expected response should be valid JSON-RPC format
# If you get errors, check:
# 1. Environment variables are set correctly in Vercel
# 2. Build completed without errors
# 3. All dependencies are properly installed
# Test in browser by visiting:
# https://your-digital-twin-mcp.vercel.app
# Should show your Next.js application homepage
Step 8: Update Claude Desktop Configuration
Configure Claude Desktop to use your production MCP server instead of localhost
// Update Claude Desktop Settings > Developer > MCP Servers:
// Replace localhost URL with your Vercel deployment URL
{
"mcpServers": {
"digital-twin-production": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://your-digital-twin-mcp.vercel.app/api/mcp"],
"env": {
"NODE_ENV": "production"
}
}
}
}
// Benefits of production deployment:
// ✅ No need to run local development server
// ✅ Accessible from any device/location
// ✅ Reliable uptime and performance
// ✅ Automatic HTTPS security
Step 9: Update VS Code MCP Configuration
Update your VS Code MCP configuration to use the production server
// Update .vscode/mcp.json to use production URL:
{
"servers": {
"digital-twin-production": {
"type": "http",
"url": "https://your-digital-twin-mcp.vercel.app/api/mcp",
"timeout": 30000,
"description": "Production Digital Twin RAG MCP Server"
}
}
}
// Test in VS Code GitHub Copilot:
// @workspace Can you tell me about my work experience using the production digital twin MCP server?
// Verify the response includes your personalized professional data
Step 10: Deployment Verification Checklist
Complete checklist to ensure your MCP server deployment is fully functional
**Production Readiness Checklist:**
**✅ Deployment Status:**
• Vercel shows "Deployment completed successfully"
• Live URL is accessible in browser
• No build or runtime errors in Vercel logs
**✅ MCP Endpoint Testing:**
• `/api/mcp` endpoint responds to POST requests
• Returns valid JSON-RPC 2.0 format responses
• No authentication or CORS errors
**✅ Environment Variables:**
• All three API keys configured in Vercel
• Environment variables applied to Production environment
• No sensitive data exposed in client-side code
**✅ Client Integration:**
• Claude Desktop connects successfully to production URL
• VS Code GitHub Copilot can access MCP server
• Digital twin responses are personalized and accurate
**✅ Performance & Reliability:**
• Response times under 5 seconds
• Upstash Vector database connections working
• Groq API calls completing successfully
**🎉 Success!** Your digital twin MCP server is now deployed and accessible 24/7 for interview preparation from anywhere!
Step 11: Continuous Deployment Setup
Configure automatic deployments when you update your GitHub repository
**Automatic Deployment Benefits:**
Vercel automatically redeploys your MCP server when you push changes to GitHub.
**How It Works:**
• Push code changes to your GitHub repository
• Vercel detects the changes automatically
• Triggers new build and deployment process
• Updates live server with zero downtime
**Making Updates:**
```bash
# Make changes to your MCP server code
# Test locally first
pnpm dev
# Commit and push changes
git add .
git commit -m "Updated digital twin profile data"
git push origin main
# Vercel will automatically deploy the changes
```
**Monitoring Deployments:**
• View deployment status in Vercel dashboard
• Check build logs for any errors
• Test updated functionality after deployment
**Best Practices:**
• Always test changes locally before pushing
• Use descriptive commit messages
• Monitor Vercel deployment logs for issues
• Keep environment variables synchronized between local and production
Advanced RAG Optimization (Optional)
Enhance your MCP server with LLM-powered query improvement and response refinement for more intelligent interview preparation
📚 Understanding This Step
This optional advanced step transforms your basic RAG system into an intelligent, context-aware interview assistant. By integrating Large Language Models (LLMs) at two key points - query preprocessing and response post-processing - you create a more sophisticated system that better understands user intent and provides more nuanced, interview-focused responses. This approach mirrors production RAG systems used by major companies and significantly improves the quality of your digital twin interactions.
Tasks to Complete
Code & Instructions
Understanding LLM-Enhanced RAG Benefits
Learn why adding LLMs to your RAG pipeline creates dramatically better interview preparation experiences
**Why Enhance RAG with LLMs?**
**1. Query Preprocessing Benefits:**
• **Intent Understanding**: LLM interprets "What should I highlight?" as "technical achievements, leadership examples, quantified results"
• **Context Expansion**: "Tell me about projects" becomes "technical projects, leadership roles, challenging problems solved, measurable outcomes"
• **Domain Adaptation**: Converts generic questions into interview-specific searches
• **Synonym Enhancement**: Expands "skills" to include "expertise, competencies, technologies, frameworks"
**2. Response Post-Processing Benefits:**
• **Interview Focus**: Transforms technical details into compelling interview stories
• **STAR Format**: Automatically structures responses using Situation-Task-Action-Result methodology
• **Confidence Building**: Adds interview coaching and presentation tips
• **Personalization**: Tailors responses to specific job requirements and company culture
**3. Real-World Impact Examples:**
**Before LLM Enhancement:**
User: "What should I say about my React experience?"
Basic RAG: "You worked with React for 2 years on e-commerce platform"
**After LLM Enhancement:**
User: "What should I say about my React experience?"
Enhanced RAG: "Highlight your React expertise by saying: 'I have 2 years of production React experience building scalable e-commerce platforms. Specifically, I led the migration from class components to hooks, improving code maintainability by 40% and reducing bundle size by 25%. I'm particularly proud of implementing a custom state management solution that handled 10,000+ concurrent users during peak sales periods.'"
**4. Technical Benefits:**
• **Better Search Accuracy**: 60-80% improvement in relevant document retrieval
• **Contextual Responses**: Answers consider job requirements and interview context
• **Reduced Hallucination**: LLM grounds responses in your actual experience data
• **Dynamic Adaptation**: Responses adjust based on interviewer type (technical vs HR vs executive)
Step 1: Reference Your Existing Python Implementation
Your Python RAG application already includes LLM integration - review this pattern for your TypeScript MCP implementation
# From your existing Python implementation (binal_rag_app.py)
# This shows the pattern you'll replicate in TypeScript
# Query Preprocessing Example:
def enhance_query(user_question):
enhanced_prompt = f"""
You are an interview preparation assistant.
Improve this question to better search professional profile data:
Original: {user_question}
Enhanced query should:
- Include relevant synonyms
- Focus on interview-relevant aspects
- Expand context for better matching
Return only the enhanced query:
"""
response = groq_client.chat.completions.create(
messages=[{"role": "user", "content": enhanced_prompt}],
model="llama-3.1-8b-instant"
)
return response.choices[0].message.content
# Response Post-processing Example:
def format_for_interview(rag_results, original_question):
context = "
".join([result['text'] for result in rag_results])
interview_prompt = f"""
You are an expert interview coach. Use this professional data to create
a compelling interview response:
Question: {original_question}
Professional Data: {context}
Create a response that:
- Uses STAR format when appropriate
- Includes specific metrics and achievements
- Sounds confident and natural
- Addresses the question directly
Response:
"""
# This pattern shows how to integrate LLM processing
# You'll adapt this for your TypeScript MCP server
Step 2: Enhanced MCP Server Architecture Pattern
Design pattern for integrating LLMs into your existing MCP server workflow
// Enhanced MCP Server Architecture
// This shows the integration points for LLM enhancement
// 1. QUERY PREPROCESSING FLOW:
// User Question → LLM Enhancement → Vector Search → Raw Results
// 2. RESPONSE POSTPROCESSING FLOW:
// Raw Results → LLM Formatting → Interview-Ready Response → User
// Example TypeScript pattern to implement:
export async function enhancedRAGQuery(userQuestion: string) {
// Step 1: Enhance the query with LLM
const enhancedQuery = await preprocessQuery(userQuestion);
// Step 2: Perform vector search with enhanced query
const vectorResults = await searchVectorDatabase(enhancedQuery);
// Step 3: Post-process results with LLM for interview context
const interviewResponse = await postprocessForInterview(
vectorResults,
userQuestion
);
return interviewResponse;
}
async function preprocessQuery(originalQuery: string): Promise<string> {
// Call Groq/Vercel AI to enhance the query
// Implementation details in next steps
}
async function postprocessForInterview(
results: VectorResult[],
originalQuestion: string
): Promise<string> {
// Call LLM to format results for interview context
// Implementation details in next steps
}
Step 3: Configure Groq Cloud Integration
Set up Groq Cloud for high-performance LLM inference in your MCP server
# Install Groq SDK for your Next.js MCP project
cd your-digital-twin-mcp-project
pnpm add groq
# Add environment variable to your .env.local
# GROQ_API_KEY=your_groq_api_key_here
# Update your Vercel deployment environment variables:
# Add GROQ_API_KEY to your Vercel project settings
# Groq offers several high-performance models:
# - llama-3.1-8b-instant (fast, good for query enhancement)
# - llama-3.1-70b-versatile (powerful, good for response formatting)
# - mixtral-8x7b-32768 (balanced performance and context)
Step 4: Implement Query Preprocessing
Add LLM-powered query enhancement to improve vector search accuracy
// lib/llm-enhanced-rag.ts
import Groq from 'groq-sdk';
const groq = new Groq({
apiKey: process.env.GROQ_API_KEY!,
});
export async function enhanceQuery(originalQuery: string): Promise<string> {
const enhancementPrompt = `
You are an interview preparation assistant that improves search queries.
Original question: "${originalQuery}"
Enhance this query to better search professional profile data by:
- Adding relevant synonyms and related terms
- Expanding context for interview scenarios
- Including technical and soft skill variations
- Focusing on achievements and quantifiable results
Return only the enhanced search query (no explanation):
`;
try {
const completion = await groq.chat.completions.create({
messages: [{ role: 'user', content: enhancementPrompt }],
model: 'llama-3.1-8b-instant',
temperature: 0.3, // Lower temperature for consistent query enhancement
max_tokens: 150,
});
return completion.choices[0]?.message?.content?.trim() || originalQuery;
} catch (error) {
console.error('Query enhancement failed:', error);
return originalQuery; // Fallback to original query
}
}
// Example transformations:
// "Tell me about my projects" →
// "software development projects, technical achievements, leadership roles, problem-solving examples, measurable outcomes, project management, team collaboration, technical challenges overcome"
Step 5: Implement Response Post-Processing
Add LLM-powered response formatting for interview-ready answers
// Continue in lib/llm-enhanced-rag.ts
export async function formatForInterview(
ragResults: any[],
originalQuestion: string
): Promise<string> {
const context = ragResults
.map(result => result.data || result.text)
.join('
');
const formattingPrompt = `
You are an expert interview coach. Create a compelling interview response using this professional data.
Question: "${originalQuestion}"
Professional Background Data:
${context}
Create a response that:
- Directly addresses the interview question
- Uses specific examples and quantifiable achievements
- Applies STAR format (Situation-Task-Action-Result) when telling stories
- Sounds confident and natural for an interview setting
- Highlights unique value and differentiators
- Includes relevant technical details without being overwhelming
Interview Response:
`;
try {
const completion = await groq.chat.completions.create({
messages: [{ role: 'user', content: formattingPrompt }],
model: 'llama-3.1-70b-versatile', // More powerful model for response crafting
temperature: 0.7, // Higher creativity for natural responses
max_tokens: 500,
});
return completion.choices[0]?.message?.content?.trim() || 'Unable to generate response';
} catch (error) {
console.error('Response formatting failed:', error);
return context; // Fallback to raw RAG results
}
}
// Example transformation:
// Raw RAG: "React experience: 2 years, e-commerce platform, performance optimization"
// Interview Response: "I have 2 years of production React experience where I was the lead developer on our e-commerce platform. One of my key achievements was optimizing our component architecture, which reduced page load times by 40% and improved our conversion rate by 15%. I'm particularly proud of implementing a custom caching strategy that handled our Black Friday traffic surge of 50,000 concurrent users without any downtime."
Step 6: Update MCP Server Actions
Integrate LLM enhancements into your existing MCP server endpoints
// Update your existing MCP server action
// app/actions/digital-twin-actions.ts
import { enhanceQuery, formatForInterview } from '@/lib/llm-enhanced-rag';
export async function enhancedDigitalTwinQuery(question: string) {
'use server';
try {
// Step 1: Enhance the user's question for better search
console.log('Original question:', question);
const enhancedQuery = await enhanceQuery(question);
console.log('Enhanced query:', enhancedQuery);
// Step 2: Perform vector search with enhanced query
const vectorResults = await index.query({
data: enhancedQuery, // Use enhanced query instead of original
topK: 5,
includeMetadata: true,
});
// Step 3: Format results for interview context
const interviewResponse = await formatForInterview(
vectorResults,
question // Use original question for response context
);
return {
success: true,
response: interviewResponse,
metadata: {
originalQuery: question,
enhancedQuery: enhancedQuery,
resultsFound: vectorResults.length
}
};
} catch (error) {
console.error('Enhanced RAG query failed:', error);
// Fallback to basic RAG if LLM enhancement fails
return await basicDigitalTwinQuery(question);
}
}
// Keep your existing basic function as fallback
export async function basicDigitalTwinQuery(question: string) {
// Your existing implementation without LLM enhancement
}
Step 7: A/B Testing Your Enhanced System
Compare basic RAG vs LLM-enhanced RAG to measure improvements
// Create a comparison endpoint in your MCP server
// This helps you evaluate the improvements
export async function compareRAGApproaches(question: string) {
'use server';
const startTime = Date.now();
// Test both approaches
const [basicResult, enhancedResult] = await Promise.all([
basicDigitalTwinQuery(question),
enhancedDigitalTwinQuery(question)
]);
const endTime = Date.now();
return {
question,
results: {
basic: {
response: basicResult.response,
processingTime: basicResult.processingTime || 'N/A'
},
enhanced: {
response: enhancedResult.response,
processingTime: enhancedResult.processingTime || 'N/A',
enhancedQuery: enhancedResult.metadata?.enhancedQuery
}
},
totalComparisonTime: endTime - startTime
};
}
// Test prompts for comparison:
// "What are my key strengths?"
// "Tell me about a challenging project"
// "Why should we hire you?"
// "Describe your leadership experience"
// Evaluation criteria:
// - Response specificity and detail
// - Interview relevance and presentation
// - Use of concrete examples and metrics
// - Natural flow and confidence building
// - Processing time and reliability
Step 8: Advanced Configuration Options
Fine-tune your LLM-enhanced RAG system for optimal interview preparation
// lib/rag-config.ts
// Advanced configuration for different interview scenarios
export const RAG_CONFIGS = {
technical_interview: {
queryModel: 'llama-3.1-8b-instant',
responseModel: 'llama-3.1-70b-versatile',
temperature: 0.3,
focusAreas: ['technical skills', 'problem solving', 'architecture', 'code quality'],
responseStyle: 'detailed technical examples with metrics'
},
behavioral_interview: {
queryModel: 'llama-3.1-8b-instant',
responseModel: 'llama-3.1-70b-versatile',
temperature: 0.7,
focusAreas: ['leadership', 'teamwork', 'communication', 'conflict resolution'],
responseStyle: 'STAR format stories with emotional intelligence'
},
executive_interview: {
queryModel: 'llama-3.1-70b-versatile',
responseModel: 'llama-3.1-70b-versatile',
temperature: 0.5,
focusAreas: ['strategic thinking', 'business impact', 'vision', 'leadership'],
responseStyle: 'high-level strategic responses with business metrics'
}
};
// Usage example:
export async function contextAwareRAG(
question: string,
interviewType: keyof typeof RAG_CONFIGS
) {
const config = RAG_CONFIGS[interviewType];
// Customize prompts based on interview context
const contextualPrompt = `
This is a ${interviewType.replace('_', ' ')} question.
Focus on: ${config.focusAreas.join(', ')}
Response style: ${config.responseStyle}
Question: ${question}
`;
// Apply configuration to your RAG pipeline
return await enhancedDigitalTwinQuery(contextualPrompt);
}
Step 9: Performance Monitoring and Optimization
Monitor your enhanced RAG system and optimize for production use
// lib/rag-monitoring.ts
// Production monitoring for your enhanced RAG system
export interface RAGMetrics {
queryEnhancementTime: number;
vectorSearchTime: number;
responseFormattingTime: number;
totalTime: number;
tokensUsed: number;
cacheHitRate: number;
}
export async function monitoredRAGQuery(
question: string
): Promise<{ response: string; metrics: RAGMetrics }> {
const metrics: Partial<RAGMetrics> = {};
const startTime = Date.now();
// Monitor query enhancement
const enhanceStart = Date.now();
const enhancedQuery = await enhanceQuery(question);
metrics.queryEnhancementTime = Date.now() - enhanceStart;
// Monitor vector search
const searchStart = Date.now();
const vectorResults = await searchVectorDatabase(enhancedQuery);
metrics.vectorSearchTime = Date.now() - searchStart;
// Monitor response formatting
const formatStart = Date.now();
const formattedResponse = await formatForInterview(vectorResults, question);
metrics.responseFormattingTime = Date.now() - formatStart;
metrics.totalTime = Date.now() - startTime;
// Log performance metrics
console.log('RAG Performance Metrics:', metrics);
return {
response: formattedResponse,
metrics: metrics as RAGMetrics
};
}
// Performance optimization tips:
// 1. Cache enhanced queries for common questions
// 2. Use faster models (8B) for query enhancement
// 3. Implement response caching for repeated questions
// 4. Monitor token usage to control costs
// 5. Set timeouts and fallbacks for reliability
Step 10: Testing Your Enhanced System
Comprehensive testing scenarios to validate your LLM-enhanced RAG improvements
**Testing Your Enhanced RAG System**
**Test in VS Code GitHub Copilot:**
```
@workspace Test my enhanced digital twin RAG system with this complex question: "I have an interview for a Senior Full Stack Developer role that requires React, Node.js, and team leadership. The company values innovation and scalability. How should I position my background to show I'm the ideal candidate?"
```
**Test in Claude Desktop:**
"Claude, using my enhanced digital twin system, help me prepare for a technical interview. Ask me follow-up questions and provide coaching on how to improve my responses based on my actual experience."
**Comparison Testing:**
```
@workspace Run both basic and enhanced RAG for this question: "What's my biggest professional achievement?" Compare the responses and analyze the differences in detail and interview readiness.
```
**Success Indicators:**
✅ Enhanced responses include specific metrics and examples
✅ Responses follow interview best practices (STAR format)
✅ Language is confident and interview-appropriate
✅ Technical details are balanced and accessible
✅ Responses directly address the specific question context
✅ Processing time remains under 10 seconds
✅ System gracefully falls back to basic RAG if LLM fails
**Expected Improvements:**
• 60-80% more specific and actionable responses
• Natural interview language and confidence
• Better alignment with job requirements
• Structured storytelling with clear outcomes
• Reduced need for follow-up clarification questions
Step 11: Further Learning and Advanced Patterns
Resources and next steps for mastering production RAG systems
**Additional Learning Resources:**
**1. Web RAG Deployment Guide (/web-rag-deployment):**
• Production RAG architecture patterns
• LLM integration best practices
• Scalability and performance optimization
• Real-world deployment scenarios
• Advanced RAG techniques and patterns
**2. Advanced RAG Patterns to Explore:**
• **Agentic RAG**: LLM decides when and how to search
• **Multi-hop RAG**: Chain multiple searches for complex questions
• **Contextual RAG**: Maintain conversation history for follow-ups
• **Hybrid Search**: Combine vector and keyword search
• **RAG with Tool Use**: LLM can access external tools and APIs
**3. Production Considerations:**
• **Cost Optimization**: Balance model size vs performance
• **Latency Management**: Parallel processing and caching strategies
• **Quality Assurance**: Automated testing and response evaluation
• **User Personalization**: Adapt responses to user preferences
• **Continuous Learning**: Update embeddings with new experiences
**4. Integration Opportunities:**
• **Calendar Integration**: Prepare for specific upcoming interviews
• **Job Board APIs**: Automatically tailor responses to job postings
• **Company Research**: Incorporate company-specific information
• **Mock Interview Scoring**: AI-powered practice session evaluation
• **Resume Optimization**: Sync improvements between RAG and resume
**🎯 Key Takeaway:**
This enhanced RAG system transforms your digital twin from a simple Q&A tool into an intelligent interview coach that understands context, provides strategic advice, and helps you present your best professional self. The LLM integration creates exponentially more value by bridging the gap between your raw experience data and compelling interview narratives.
Learning Outcomes
Skills and knowledge you'll gain from this workshop
Your Digital Twin is Ready! 🤖
You've built a personal AI agent that can represent you professionally and answer interview questions using advanced RAG technology.