prashantmatlani commited on
Commit
f6f5dd0
·
1 Parent(s): ffb73d1

updated jung prompt

Browse files
Files changed (2) hide show
  1. agents/jung_agent.py +9 -1
  2. core/rag/rag_jung.py +6 -2
agents/jung_agent.py CHANGED
@@ -264,9 +264,17 @@ def jung_agent(state):
264
  5. Explore the user’s query
265
  6. To NOT provide or assume answers unless you have a clear understanding and the needed information regarding the question and the context
266
 
 
 
 
 
 
 
 
 
267
  ### Self-evaluation ###
268
  - Ensure you've based your responses on the provided JUNGIAN KNOWLEDGE -> {context}
269
- - Be careful to not include your paraphrasing or meta-talk about your understanding of the context in your response; rather
270
  - Self-evaluate and refine your final response by going through, and cross-checking your final response using, all the above instructions at least once
271
 
272
 
 
264
  5. Explore the user’s query
265
  6. To NOT provide or assume answers unless you have a clear understanding and the needed information regarding the question and the context
266
 
267
+ SELF-CORRECTION PROTOCOL (INTERNAL ONLY)
268
+ . Before outputting, ensure:
269
+ . Am I psychologizing a greeting? -> If yes, delete
270
+ . Am I being too warm/flowery? -> If yes, sharpen
271
+ . Am I empathizing in excess, being over-dramatic? -> If, yes, moderate and maintain professional detachment
272
+ . Am I paraphrasing or engaging in meta-talk about my understanding of the context in my response? -> If yes, delete the said paraphrasing/meta-talk and address the context directly
273
+ . Did I translate literal facts into archetypal patterns and psychological shifts occurring within the (direct or indirect) client (individual)
274
+
275
  ### Self-evaluation ###
276
  - Ensure you've based your responses on the provided JUNGIAN KNOWLEDGE -> {context}
277
+ - Be careful to not include your paraphrasing or meta-talk about your understanding of the context in your response
278
  - Self-evaluate and refine your final response by going through, and cross-checking your final response using, all the above instructions at least once
279
 
280
 
core/rag/rag_jung.py CHANGED
@@ -31,7 +31,10 @@ with open(TEXT_PATH, "r", encoding="utf-8") as f:
31
  # -------------------------------
32
  def retrieve(query, k=3):
33
 
 
34
  query_vec = model.encode([query])
 
 
35
  D, I = index.search(np.array(query_vec).astype("float32"), k)
36
 
37
  results = []
@@ -43,8 +46,9 @@ def retrieve(query, k=3):
43
  results.append(chunk)
44
 
45
  if not results:
46
- return ""
47
-
 
48
  return "\n\n".join(results)
49
 
50
 
 
31
  # -------------------------------
32
  def retrieve(query, k=3):
33
 
34
+ # Convert query → embedding
35
  query_vec = model.encode([query])
36
+
37
+ # Search FAISS
38
  D, I = index.search(np.array(query_vec).astype("float32"), k)
39
 
40
  results = []
 
46
  results.append(chunk)
47
 
48
  if not results:
49
+ #return ""
50
+ return "No relevant Jungian context found."
51
+
52
  return "\n\n".join(results)
53
 
54