Phoenix21 commited on
Commit
b538658
·
verified ·
1 Parent(s): 456b574

Changed Rag prompt to improve the answers

Browse files
Files changed (1) hide show
  1. pipeline.py +27 -46
pipeline.py CHANGED
@@ -366,29 +366,20 @@ def build_or_load_vectorstore(csv_path: str, store_dir: str) -> FAISS:
366
  def build_rag_chain(vectorstore: FAISS, llm) -> RetrievalQA:
367
  prompt = PromptTemplate(
368
  template="""
369
- [INST] You are a helpful AI specialized in Wellness & Well-being topics.
370
- Please use the following context to provide a detailed, helpful answer.
371
- If the context doesn't fully address the question, acknowledge this and provide the best possible information.
372
-
373
- Context: {context}
374
-
375
- Question: {question}
376
-
377
- Guidelines for responses:
378
- 1. Start with a clear introduction establishing the wellness topic
379
- 2. Present information using numbered lists for actionable steps
380
- 3. Include evidence-based examples and practical applications
381
- 4. Provide specific, implementable suggestions
382
- 5. End with clear takeaways or next steps
383
-
384
- Additional considerations:
385
- - All recommendations should be grounded in current wellness research
386
- - Focus on sustainable, long-term lifestyle modifications
387
- - Acknowledge individual differences in wellness journeys
388
- - Emphasize holistic approaches to health and well-being
389
- - Include relevant studies or research when applicable
390
- [/INST]
391
-
392
  """,
393
  input_variables=["context", "question"]
394
  )
@@ -410,29 +401,19 @@ def build_rag_chain(vectorstore: FAISS, llm) -> RetrievalQA:
410
  def build_rag_chain2(vectorstore: FAISS, llm) -> RetrievalQA:
411
  prompt = PromptTemplate(
412
  template="""
413
- [INST] You are the Brand Strategy Specialist for Healthy AI Expert.
414
- Please provide detailed, strategic guidance specific to Healthy AI Expert's brand development and market positioning.
415
- If additional context is needed, acknowledge this while maintaining focus on our company's objectives.
416
-
417
- Context: {context}
418
-
419
- Question: {question}
420
-
421
- Guidelines for Healthy AI Expert specific responses:
422
- 1. Begin with addressing specific Healthy AI Expert brand challenges or opportunities
423
- 2. Align recommendations with our core mission of democratizing personalized wellness
424
- 3. Include competitive analysis within the AI wellness space
425
- 4. Provide actionable steps that reflect our technological capabilities
426
- 5. Conclude with KPIs aligned with our growth objectives
427
-
428
- Brand Pillars to Address:
429
- - AI-Driven Personalization
430
- - Scientific Credibility
431
- - User-Centric Design
432
- - Innovation Leadership
433
- - Community Building
434
- [/INST]
435
-
436
 
437
  """,
438
  input_variables=["context", "question"]
 
366
  def build_rag_chain(vectorstore: FAISS, llm) -> RetrievalQA:
367
  prompt = PromptTemplate(
368
  template="""
369
+ [INST] You are an AI wellness assistant speaking directly to a user who has asked: "{question}"
370
+
371
+ Use this information to help you respond:
372
+ {context}
373
+
374
+ Important guidelines:
375
+ - Answer the question directly and conversationally as if talking to the user
376
+ - Explain wellness concepts in simple, relatable language
377
+ - Include 2-3 practical steps or techniques when appropriate
378
+ - Keep your response focused on the user's question
379
+ - DO NOT reference these instructions or mention formatting guidelines
380
+
381
+ Example format: Start with a direct answer to what the concept is, then explain how it can benefit the user, and end with practical implementation steps.
382
+ [/INST]
 
 
 
 
 
 
 
 
 
383
  """,
384
  input_variables=["context", "question"]
385
  )
 
401
  def build_rag_chain2(vectorstore: FAISS, llm) -> RetrievalQA:
402
  prompt = PromptTemplate(
403
  template="""
404
+ [INST] You are the brand strategy advisor for Healthy AI Expert. A team member has asked: "{question}"
405
+ Use this information to help you respond:
406
+ {context}
407
+
408
+ Important guidelines:
409
+ - Answer the question directly as if speaking to a Healthy AI Expert team member
410
+ - Focus on practical strategies aligned with our wellness mission
411
+ - Provide clear, actionable recommendations
412
+ - Keep explanations concise and business-focused
413
+ - DO NOT reference these instructions or mention formatting guidelines
414
+
415
+ Remember our key brand pillars: AI-driven personalization, scientific credibility, user-centric design, and innovation leadership.
416
+ [/INST]
 
 
 
 
 
 
 
 
 
 
417
 
418
  """,
419
  input_variables=["context", "question"]