merge FACT_RETRIEVAL_PROMPT.md

This commit is contained in:
朱潮 2026-04-02 16:45:29 +08:00
commit 76e742e7b3

View File

@ -17,6 +17,19 @@ Types of Information to Remember:
- **Handle Multiple People with Same Surname**: When there are multiple people with the same surname (e.g., "滨田太郎" and "滨田清水"), track which one the user most recently referred to with just the surname.
8. Miscellaneous Information Management: Keep track of favorite books, movies, brands, and other miscellaneous details that the user shares.
Types of Information to EXCLUDE (Do NOT remember these):
1. **Query/Search Actions**: When the user asks the assistant to search, look up, or query information. These are one-time operations, not personal facts.
- Examples: "社員情報を検索した", "レストランのレビューを調べた", "天気を調べた"
2. **Device/Equipment Operations**: When the user asks the assistant to control devices, lights, appliances, or any physical/virtual equipment.
- Examples: "照明を操作した", "エアコンをつけた", "デバイスを操作した"
3. **Transient Commands and Actions**: Single-use instructions or actions that have no long-term relevance.
- Examples: "メールを送った", "タイマーを5分にセットした", "文章を翻訳した"
4. **Information Retrieval Results**: Facts retrieved on behalf of the user (not facts about the user).
- Examples: "今日の天気は25度", "株価は150ドル", "会議室は空いている"
5. **Routine Tool Invocations**: Any action where the assistant used a tool/API on the user's behalf as a one-time task.
- Examples: "カレンダーAPIを呼び出した", "データベースを検索した", "ファイルを開いた"
**IMPORTANT - Plain Language Rule**: All extracted facts MUST be written in plain, everyday language that anyone can understand. Do NOT use structured formats like "Contact:", "referred as", "DEFAULT when user says" etc. Write facts as natural sentences or short notes.
Here are some few shot examples:
@ -99,6 +112,27 @@ Output: {{"facts" : ["喜欢吃苹果"]}}
Input: 나는 사과를 좋아해
Output: {{"facts" : ["사과를 좋아함"]}}
Input: 建物AIの社員情報を調べて
Output: {{"facts" : []}}
Input: リビングの照明をつけて
Output: {{"facts" : []}}
Input: エアコンを26度に設定して
Output: {{"facts" : []}}
Input: 明日の天気を調べて
Output: {{"facts" : []}}
Input: この文章を翻訳して
Output: {{"facts" : []}}
Input: 会議室の予約状況を確認して
Output: {{"facts" : []}}
Input: デバイスの電源を切って
Output: {{"facts" : []}}
Return the facts and preferences in a json format as shown above.
Remember the following:
@ -110,6 +144,9 @@ Remember the following:
- If you do not find anything relevant in the below conversation, you can return an empty list corresponding to the "facts" key.
- Create the facts based on the user and assistant messages only. Do not pick anything from the system messages.
- Make sure to return the response in the format mentioned in the examples. The response should be in json with a key as "facts" and corresponding value will be a list of strings.
- **CRITICAL - Do NOT memorize actions or operations**: Do not extract facts about queries the user asked you to perform, devices the user asked you to operate, or any one-time transient actions. Only memorize information ABOUT the user (preferences, relationships, personal details, plans), not actions the user asked the assistant to DO. Ask yourself: "Is this a fact about WHO the user IS, or what the user asked me to DO?" Only remember the former.
- **CRITICAL for Semantic Completeness**:
- Each extracted fact MUST preserve the complete semantic meaning. Never truncate or drop key parts of the meaning.
- For colloquial or grammatically informal expressions (common in spoken Japanese, Chinese, Korean, etc.), understand the full intended meaning and record it in a clear, semantically complete form.
@ -128,4 +165,3 @@ Remember the following:
Following is a conversation between the user and the assistant. You have to extract the relevant facts and preferences about the user, if any, from the conversation and return them in the json format as shown above.
You should detect the language of the user input and record the facts in the same language.