You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: backend/app.py
+67-25Lines changed: 67 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -57,49 +57,91 @@ def chat():
57
57
'success': False
58
58
}), 500
59
59
60
-
# Use RAG system to search for relevant context
60
+
# Get personal information for use in prompts
61
+
personal_info=rag_system.get_personal_info()
62
+
63
+
# --- Step 1: Get Profile Summary for Initial Context ---
64
+
profile_summary=rag_system.get_summary_document()
65
+
66
+
# --- Step 2: Create a Refined Search Query using the LLM ---
67
+
query_refiner_prompt=f"""
68
+
You are a world-class AI research assistant. Your task is to refine a user's question into a highly effective search query for a vector database.
69
+
The user is asking about a person named {personal_info['name']}.
70
+
Here is a high-level summary of their profile:
71
+
---
72
+
{profile_summary}
73
+
---
74
+
Based on this summary and the user's original question, generate a concise and focused search query.
75
+
The query should be a statement or a question that is likely to find the most relevant and specific details in the knowledge base.
76
+
For example, if the user asks "tell me about your projects", a good refined query might be "Detailed descriptions of projects like AI and Education, Boston Police Department Budget Analysis, and Machine-Vision Based Assistance System".
77
+
Do not answer the user's question, only generate the search query.
print(f"⚠️ RAG search failed with refined query: {e}")
102
+
relevant_context="Unable to retrieve relevant information from the knowledge base."
70
103
71
-
# Build system prompt
72
-
system_prompt=f"""You are {personal_info['name']}'s AI assistant. Answer questions about {personal_info['name']} based on the following relevant information retrieved from the knowledge base:
104
+
# --- Step 4: Generate the Final Answer ---
105
+
final_answer_prompt=f"""You are {personal_info['name']}'s helpful and professional AI assistant.
106
+
Your goal is to provide a comprehensive and accurate answer based on the provided information.
107
+
108
+
First, here is a high-level summary of {personal_info['name']}'s profile for your general understanding:
109
+
<SUMMARY>
110
+
{profile_summary}
111
+
</SUMMARY>
112
+
113
+
Now, here is the user's question and the specific, detailed information retrieved from the knowledge base to help you answer it:
114
+
<USER_QUESTION>
115
+
{message}
116
+
</USER_QUESTION>
73
117
74
-
RELEVANT CONTEXT:
118
+
<DETAILED_CONTEXT>
75
119
{relevant_context}
120
+
</DETAILED_CONTEXT>
76
121
77
122
INSTRUCTIONS:
78
-
- Answer questions based on the relevant context above
79
-
- If the context doesn't contain enough information, acknowledge the limitation
80
-
- Keep responses conversational, helpful, and professional
81
-
- Provide specific details from the context when relevant
82
-
- If asked about something not covered in the context, offer related information you do have
83
-
- Always respond in the same language as the user's question
123
+
- Synthesize the information from both the SUMMARY and the DETAILED_CONTEXT to formulate your final answer.
124
+
- Answer the user's question directly and accurately based *only* on the information provided.
125
+
- If the detailed context does not contain the answer, you can rely on the summary. If neither contains the answer, state that you don't have enough information.
126
+
- Always respond in the same language as the user's question.
"summary": "I am a passionate professional with experience in developing innovative solutions. I specialize in modern technologies and have a strong background in software development and cloud platforms."
3
+
"name": "Spectual",
4
+
"title": "AI Engineer / ML Engineer",
5
+
"email": "ukubird@gmail.com",
6
+
"location": "Boston, MA",
7
+
"summary": "A Master's student in Computer Science at Boston University with a background in AI. Experienced in developing end-to-end AI pipelines, computer vision, and machine learning algorithms. Proven ability to lead research teams and deliver full-featured software solutions. Honored with multiple scholarships and holder of a patent in flood disaster prediction."
"description": "It's an AI Engineer / Machine Learning Engineer internship position at The Department of Digital Infrastructure and Emerging Technology (DIET) of Harvard University. The role is responsible for developing AI-based solutions and deploying reliable machine learning models for the Harvard Arts Museum.",
21
20
"responsibilities": [
22
-
"Lead development initiatives for core products, improving user engagement by 25%",
23
-
"Built and deployed scalable applications using modern frameworks and cloud services",
24
-
"Mentored junior engineers and established best practices for development",
25
-
"Collaborated with cross-functional teams to deliver high-quality products"
21
+
"Developing an end-to-end AI pipeline to assist in the identification of stolen ancient coins using image segmentation, embedding-based retrieval, and auction data integration.",
22
+
"Designing and testing a scalable prototype bot combining computer vision (OpenCV, PyTorch) and data processing (pandas, NumPy) to match museum records with external auction listings.",
23
+
"Implementing automated scripts to ingest, clean, and align multimodal datasets from internal archives and public databases, enabling model training and evaluation."
26
24
],
27
-
"achievements": [
28
-
"Reduced application response time by 40% through optimization",
29
-
"Implemented CI/CD pipeline for automated testing and deployment",
30
-
"Led migration to cloud-based infrastructure"
31
-
]
25
+
"achievements": []
32
26
},
33
27
{
34
-
"title": "Software Engineer",
35
-
"company": "Innovation Solutions",
36
-
"duration": "2020 - 2022",
28
+
"title": "Machine Learning Engineer Intern",
29
+
"company": "Institute of Artificial Intelligence, Nanjing Normal University",
30
+
"duration": "Aug 2023 - Jun 2024",
31
+
"description": "It's a Machine Learning Engineer internship position at the Institute of Artificial Intelligence of Nanjing Normal University. The role is responsible for developing machine learning models or computer vision models and deploying industrial models for real-world applications.",
37
32
"responsibilities": [
38
-
"Developed web applications and APIs for various business needs",
39
-
"Worked with large datasets and optimized application performance",
40
-
"Implemented data pipelines for real-time processing",
41
-
"Conducted research on latest technologies and best practices"
33
+
"Independently developed a diffraction-pattern recognition algorithm using computer vision and deep learning-based target segmentation techniques to automate RHEED image analysis.",
34
+
"Designed and implemented a full-featured software, and led a research team to investigate technical solutions and optimize performance.",
35
+
"Led end-to-end algorithm design and implemented a image processing pipeline for automated analysis."
42
36
],
43
-
"achievements": [
44
-
"Achieved 95% test coverage on critical applications",
45
-
"Reduced data processing time by 60% through pipeline optimization",
46
-
"Published 2 technical articles on software development"
47
-
]
48
-
},
49
-
{
50
-
"title": "Junior Developer",
51
-
"company": "Startup Inc",
52
-
"duration": "2019 - 2020",
53
-
"responsibilities": [
54
-
"Analyzed business requirements and built software solutions",
55
-
"Created user interfaces and backend services",
56
-
"Performed code reviews and participated in agile development",
57
-
"Collaborated with product teams to understand requirements"
58
-
],
59
-
"achievements": [
60
-
"Improved application performance by 30%",
61
-
"Identified and fixed critical bugs leading to 15% user satisfaction increase",
62
-
"Automated testing processes saving 20 hours per week"
63
-
]
37
+
"achievements": []
64
38
}
65
39
],
66
40
"projects": [
67
41
{
68
-
"name": "AI-Powered Chatbot Platform",
69
-
"description": "Built an intelligent chatbot using NLP and transformer models that handles customer inquiries with 90% accuracy. The system can understand context, maintain conversation history, and provide personalized responses.",
"description": "Led the team to design modular AI solutions for educational applications, focusing on model architecture and content generation pipelines. Published a paper at the International Conference on Machine Learning and Automation.",
46
+
"technologies": ["AI Model Architecture", "Product Design", "Content Generation"],
47
+
"impact": "Published paper 'A Comprehensive Investigation for ChatGPT's Applications in Education' at the International Conference on Machine Learning and Automation, October 18, 2023, Oxford, UK.",
48
+
"duration": "",
49
+
"role_description": "Led the team to design modular AI solutions for educational applications, focusing on model architecture and content generation pipelines."
74
50
},
75
51
{
76
-
"name": "Cloud-Native Application",
77
-
"description": "Developed a scalable web application using microservices architecture, reducing deployment time by 60%. The system uses containerization and orchestration for high availability.",
"impact": "Improved system reliability and reduced infrastructure costs by 40%",
80
-
"duration": "8 months",
81
-
"role": "Technical Lead"
52
+
"name": "Boston Police Department Budget Analysis",
53
+
"role": "Data Scientist/Analyst",
54
+
"duration": "Feb 2025-April 2025",
55
+
"description": "Performed data cleaning, exploratory data analysis and visualization on BPD budget and payroll records to uncover trends in overtime spending and departmental allocations. Built and evaluated machine learning models to predict future overtime expenditures.",
"impact": "Uncovered trends in overtime spending and departmental allocations; built predictive models for future expenditures.",
58
+
"role_description": "Led a collaborative team using GitHub for version control and task delegation; managed workflow and ensured smooth coordination across project components."
82
59
},
83
60
{
84
-
"name": "Data Analytics Dashboard",
85
-
"description": "Created a comprehensive analytics dashboard for business intelligence, increasing data visibility by 20%. The system uses modern data visualization and real-time processing.",
"relevantCourses": ["Database System", "Data Mining", "Natural Language Processing", "Computer Vision"]
83
+
}
84
+
],
85
+
"publications": [
86
+
{
87
+
"title": "A comprehensive investigation for ChatGPT's applications in education",
88
+
"journal": "Applied and Computational Engineering, 35, pp.116-122, 2024",
89
+
"doi": "10.54254/2755-2721/35/20230377"
90
+
}
91
+
],
92
+
"patents": [
93
+
{
94
+
"id": "ZL202411718876.X",
95
+
"title": "A Method and System for Calculating the Distribution Probability of a Compound Flood Disaster",
96
+
"issuer": "CNIPA Patent",
97
+
"date": "May 16, 2025"
108
98
}
109
99
],
110
100
"certifications": [
111
-
"AWS Certified Solutions Architect",
112
-
"Google Cloud Professional Developer",
113
-
"Microsoft Azure Developer Associate"
101
+
"Certificate of Achievement Fundamentals of Agents, Huggingface – May 2025",
102
+
"Prompt Engineer Certification, Datawhale and iFLYTEK - Jan 2023"
114
103
],
115
-
"interests": [
116
-
"Open source contributions to software libraries",
117
-
"Mentoring junior developers and students",
118
-
"Reading latest research papers in AI/ML",
119
-
"Hiking and outdoor photography"
104
+
"honors": [
105
+
"Merit Student Scholarship - Dec 2021",
106
+
"Scholarship for Outstanding Students of Nanjing Normal University - May 2021",
107
+
"AI Mathematical Olympiad-Progress Prize 2 Top 20% - April 2025"
120
108
],
121
-
"careerGoals": "I'm passionate about building innovative software solutions that can make a positive impact on society. I'm looking for opportunities to lead cutting-edge projects, mentor talented developers, and contribute to the advancement of technology."
109
+
"careerGoals": "Seeking opportunities to apply my expertise in AI and machine learning to solve challenging problems, contribute to innovative projects, and grow as a technology leader."
0 commit comments