Updated user_communication flowchart

This commit is contained in:
2025-04-19 20:55:04 +02:00
parent c1cef08941
commit a165772411

View File

@@ -1,65 +1,65 @@
# User Communication # User Communication
## Prerequisites ## Prerequisites
- User information is stored in the /user directory - User information is stored in the /user directory
- Tasks and their progress are documented in the /tasks directory - Tasks and their progress are documented in the /tasks directory
## Flow ## Flow
```mermaid ```mermaid
flowchart TD flowchart TD
Start([The /root/data/user/basic.md file contains info to identify and address the user<br>Load the last 10 messages from /root/data/user/conversation_history/ ]) Start([The /root/data/user/basic.md file contains info to identify and address the user<br>Load the last 10 messages from /root/data/user/conversation_history/ ])
PrepareForDraft{Have everything needed for drafting a message?} PrepareForDraft{Have everything needed for drafting a message?}
DraftMessage[Draft message in reasoning entry] DraftMessage[Draft message in reasoning entry]
ReadInput[Read input from standard input] ReadInput[Read input from standard input]
AddHistoryUser[Add the message to the /root/data/user/conversation_history/ directory<br>The filename is the id of the stdin entry with .user extension] AddHistoryUser[Add the message to the /root/data/user/conversation_history/ directory<br>The filename is the id of the stdin entry with .user extension]
LoadTask[Look for the task in the /root/data/tasks directory and load relevant files] LoadTask[Look for the task in the /root/data/tasks directory and load relevant files]
LoadUserDetails[Look in the /root/data/user directory for relevant files] LoadUserDetails[Look in the /root/data/user directory for relevant files]
EstimateScript[Draft the script in a reasoning block and estimate its runtime and output length] EstimateScript[Draft the script in a reasoning block and estimate its runtime and output length]
ScriptAcceptable{Does the draft script make sense and are the estimations short enough to not hinder the conversation?} ScriptAcceptable{Does the draft script make sense and are the estimations short enough to not hinder the conversation?}
RunScript[Run the script, make sure to set appropriate timeout and output limits] RunScript[Run the script, make sure to set appropriate timeout and output limits]
ReviewDraft{Is the message well structured and free of logical errors?} ReviewDraft{Is the message well structured and free of logical errors?}
SendMessage[Send the message using standard output] SendMessage[Send the message using standard output]
AddHistoryAgent[Add the message to the /root/data/user/conversation_history/ directory<br>The filename is the id of the stdout entry with .agent extension] AddHistoryAgent[Add the message to the /root/data/user/conversation_history/ directory<br>The filename is the id of the stdout entry with .agent extension]
ReasonResponse[Is the conversation ongoing?<br>How long is the user expected to take to respond?] ReasonResponse[Is the conversation ongoing?<br>How long is the user expected to take to respond?]
NeedAwaitResponse{Is it likely to get a response within a minute of sending the message?} NeedAwaitResponse{Is it likely to get a response within a minute of sending the message?}
BusyWait[Wait 5 seconds<br>Make sure to set the timout] BusyWait[Wait 5 seconds<br>Make sure to set the timout]
AnalyzeContext[Create reasoning entry<br>For each entry in context indicate:<br>- Can delete<br>- Contains info to save<br>- Must keep in context] AnalyzeContext[Create reasoning entry<br>For each entry in context indicate:<br>- Can delete<br>- Contains info to save<br>- Must keep in context]
MakeNotes[Create or update files with info to save] MakeNotes[Create or update files with info to save]
End([Clean the context]) End([Clean the context])
Start --> PrepareForDraft Start --> PrepareForDraft
PrepareForDraft -->|Got all needed info| DraftMessage PrepareForDraft -->|Got all needed info| DraftMessage
PrepareForDraft -->|Getting the required info would slow the conversation| DraftMessage PrepareForDraft -->|Getting the required info would slow the conversation| DraftMessage
PrepareForDraft -->|Input available on stdin| ReadInput PrepareForDraft -->|Input available on stdin| ReadInput
PrepareForDraft -->|Task mentioned but not loaded| LoadTask PrepareForDraft -->|Task mentioned but not loaded| LoadTask
PrepareForDraft -->|Personal or social info mentioned but not loaded| LoadUserDetails PrepareForDraft -->|Personal or social info mentioned but not loaded| LoadUserDetails
PrepareForDraft -->|Calculations, system info or other numerical values that can be scripted are mentioned| EstimateScript PrepareForDraft -->|Calculations, system info or other numerical values that can be scripted are mentioned| EstimateScript
ReadInput --> AddHistoryUser ReadInput --> AddHistoryUser
AddHistoryUser --> PrepareForDraft AddHistoryUser --> PrepareForDraft
LoadTask --> PrepareForDraft LoadTask --> PrepareForDraft
LoadUserDetails --> PrepareForDraft LoadUserDetails --> PrepareForDraft
EstimateScript --> ScriptAcceptable EstimateScript --> ScriptAcceptable
ScriptAcceptable -->|Acceptable| RunScript ScriptAcceptable -->|Acceptable| RunScript
ScriptAcceptable -->|Not acceptable| PrepareForDraft ScriptAcceptable -->|Not acceptable| PrepareForDraft
RunScript --> PrepareForDraft RunScript --> PrepareForDraft
DraftMessage --> ReviewDraft{Is this really what I want to say?} DraftMessage --> ReviewDraft{Is this really what I want to say?}
ReviewDraft -->|Rewrite better| DraftMessage ReviewDraft -->|Rewrite better| DraftMessage
ReviewDraft -->|Good message| SendMessage ReviewDraft -->|Good message| SendMessage
SendMessage --> AddHistoryAgent SendMessage --> AddHistoryAgent
AddHistoryAgent --> ReasonResponse AddHistoryAgent --> ReasonResponse
ReasonResponse --> NeedAwaitResponse ReasonResponse --> NeedAwaitResponse
NeedAwaitResponse -->|Quick response is unlikely| AnalyzeContext NeedAwaitResponse -->|Quick response is unlikely| MakeNotes
NeedAwaitResponse -->|Input available on stdin| PrepareForDraft NeedAwaitResponse -->|Input available on stdin| PrepareForDraft
NeedAwaitResponse -->|Quick response is likely| BusyWait NeedAwaitResponse -->|Quick response is likely| BusyWait
BusyWait --> NeedAwaitResponse BusyWait --> NeedAwaitResponse
AnalyzeContext --> MakeNotes MakeNotes --> AnalyzeContext
MakeNotes --> End AnalyzeContext --> End
``` ```