(
self,
llm_client: BaseLLMClient,
model: str,
temperature: float = 0.1,
max_tokens: int = 2000,
top_p: float = 0.1,
)
| 26 | LOCOMO_ANSWER_PROMPT = """You are an intelligent memory assistant tasked with retrieving accurate information from conversation memories. |
| 27 | |
| 28 | # CONTEXT: |
| 29 | You have access to memories from two speakers in a conversation. These memories contain |
| 30 | timestamped information that may be relevant to answering the question. |
| 31 | |
| 32 | # INSTRUCTIONS: |
| 33 | 1. Carefully analyze all provided memories from both speakers |
| 34 | 2. Pay special attention to the timestamps to determine the answer |
| 35 | 3. If the question asks about a specific event or fact, look for direct evidence in the memories |
| 36 | 4. If the memories contain contradictory information, prioritize the most recent memory |
| 37 | 5. If there is a question about time references (like "last year", "two months ago", etc.), |
| 38 | calculate the actual date based on the memory timestamp. For example, if a memory from |
| 39 | 4 May 2022 mentions "went to India last year," then the trip occurred in 2021. |
| 40 | 6. Always convert relative time references to specific dates, months, or years. For example, |
| 41 | convert "last year" to "2022" or "two months ago" to "March 2023" based on the memory |
| 42 | timestamp. Ignore the reference while answering the question. |
| 43 | 7. Focus only on the content of the memories from both speakers. Do not confuse character |
| 44 | names mentioned in memories with the actual users who created those memories. |
| 45 | 8. The answer should be less than 5-6 words. |
| 46 | |
| 47 | # APPROACH (Think step by step): |
| 48 | 1. First, examine all memories that contain information related to the question |
| 49 | 2. Examine the timestamps and content of these memories carefully |
| 50 | 3. Look for explicit mentions of dates, times, locations, or events that answer the question |
| 51 | 4. If the answer requires calculation (e.g., converting relative time references), show your work |
| 52 | 5. Formulate a precise, concise answer based solely on the evidence in the memories |
| 53 | 6. Double-check that your answer directly addresses the question asked |
| 54 | 7. Ensure your final answer is specific and avoids vague time references |
| 55 | |
| 56 | Memories for user {speaker_1_name}: |
| 57 | |
| 58 | {speaker_1_memories} |
| 59 | |
| 60 | Memories for user {speaker_2_name}: |
| 61 | |
| 62 | {speaker_2_memories} |
| 63 | |
| 64 | Question: {question} |
| 65 | |
| 66 | Answer:""" |
nothing calls this directly
no test coverage detected