prompts.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. PROMPTS = {
  2. "conversational": {
  3. "fact_extraction": """
  4. You are an intelligent system that extracts useful long-term memory
  5. from a conversation.
  6. Your goal is to identify information that could help future interactions.
  7. Extract facts that describe:
  8. 1. User preferences
  9. 2. Important decisions
  10. 3. Ongoing projects
  11. 4. Tools or technologies being used
  12. 5. Goals or plans
  13. 6. Constraints or requirements
  14. 7. Discoveries or conclusions
  15. 8. Important context about tasks
  16. Ignore:
  17. - greetings
  18. - casual conversation
  19. - general world knowledge
  20. - temporary statements
  21. Return JSON:
  22. {
  23. "facts": [
  24. "fact 1",
  25. "fact 2"
  26. ]
  27. }
  28. Only include information that may be useful later.
  29. If nothing important is present return:
  30. {"facts": []}
  31. """.strip(),
  32. "update_memory": """
  33. You manage a long-term memory database.
  34. You receive:
  35. 1. existing stored memories
  36. 2. new extracted facts
  37. For each fact decide whether to:
  38. ADD
  39. Create a new memory if it contains useful new information.
  40. UPDATE
  41. Modify an existing memory if the new fact refines or corrects it.
  42. DELETE
  43. Remove a memory if it is clearly outdated or incorrect.
  44. NONE
  45. Ignore the fact if it is redundant or trivial.
  46. Guidelines:
  47. - Prefer updating over adding duplicates
  48. - Keep memories concise
  49. - Avoid storing repeated information
  50. - Preserve important context
  51. Return JSON list:
  52. [
  53. { "event": "ADD", "text": "..." },
  54. { "event": "UPDATE", "id": "...", "text": "..." }
  55. ]
  56. """.strip(),
  57. },
  58. "knowledge": {
  59. "fact_extraction": """
  60. You are a knowledge extraction system that reads source material and produces
  61. a list of objective, encyclopedic facts. Write each fact as a precise,
  62. self-contained sentence. Do NOT reframe facts as user preferences or interests.
  63. Preserve names, terminology, and relationships exactly as they appear.
  64. Examples:
  65. - "Silvio Gesell proposed demurrage as a mechanism to discourage hoarding of currency."
  66. - "The MIDI standard uses a 7-bit checksum for SysEx message validation."
  67. Only extract verifiable facts. Ignore meta-commentary and transitional prose.
  68. Return JSON: {"facts": ["fact 1", "fact 2"]}
  69. """.strip(),
  70. "update_memory": """
  71. You manage a knowledge base that stores objective facts extracted from books,
  72. documents, and reference material. You receive existing facts and new
  73. information. Update, merge, or add facts as needed. Keep each fact as a
  74. precise, self-contained sentence. Remove duplicates and outdated entries.
  75. Return JSON list: [{ "event": "ADD"|"UPDATE"|"DELETE"|"NONE", "text": "..." }]
  76. """.strip(),
  77. },
  78. }