Improved the system prompt

This commit is contained in:
Niels Geens
2024-11-04 14:10:49 +01:00
parent b4c70cd5b8
commit 5da6dca5ec
7 changed files with 150 additions and 214 deletions

View File

@@ -74,7 +74,7 @@ Start by reasoning about the task.
Store important information on disk.
```xml
<single_shot><![CDATA[echo 'Remind John to feed the cat on 2024-10-18T09:00:00+02:00. Use standard output.' > /tasks/reminder_to_feed_cat.txt]]></single_shot>
<script><![CDATA[echo 'Remind John to feed the cat on 2024-10-18T09:00:00+02:00. Use standard output.' > /tasks/reminder_to_feed_cat.txt]]></script>
```
Respond to the user.
@@ -90,7 +90,7 @@ Clear initial reasoning.
The conversation is kept in context to understand the user's expected response.
If the context was near full, it would be summarized and cleaned up.
The single shot is also kept in context.
The `script` output is also kept in context.
If the file was updated often, it could be replaced by a repeated `cat`, like the general info.
## Working principles
@@ -112,30 +112,22 @@ There are only a few core actions:
### Scripts
Scripts can run in one of 3 modes: single-shot, background or repeat.
Their mode, status and output (stdout and stderr) stay in the context until they are explicitly removed.
Scripts can run in one of 2 modes: single-shot or repeat.
Their mode and output (stdout and stderr) stay in the context until they are explicitly removed.
In this way the agent manages what information is available in the context.
#### Single-shot
#### Single-shot script
The script is executed once.
This is useful for most operations e.g. writing to or moving a file or downloading content from the internet.
The next iteration starts after all single shot scripts have finished.
The next iteration starts after the scripts has finished.
#### Repeat
#### Repeat script
The script is restarted on each iteration.
This is useful for monitoring files or the file system.
commands like `head` and `tail` can be used to limit the data in context.
Similar to single-shot scripts, the next iteration starts after all repeat scripts have finished.
#### Background
The script is started and keeps running.
This is useful for waiting for events, a communication channels or a process that requires attention.
Long-running processes e.g. a web server can be run as a service or detached process to keep the context small.
The output can be redirected to a file and monitored with a repeat script.
The next iteration starts after all repeat scripts in context have finished.
### Use of XML
@@ -204,10 +196,8 @@ Both agent types share common components:
#### Working Memory
The working memory stores the current state of the system through different types of entries:
- Script Entries:
- SingleShotEntry: Results of one-time script executions
- RepeatEntry: Continuously refreshed script outputs
- BackgroundEntry: Status of long-running processes
- Script Entries: Results of script executions
- RepeatEntry: Continuously refreshed script outputs
- ReasoningEntry: LLM's thought process documentation
- ParseErrorEntry: XML validation or parsing errors
- IOEntry: Input/output operations
@@ -524,13 +514,13 @@ classDiagram
+cleanup() void*
}
class SingleShotEntry {
class ScriptEntry {
+script: str readonly
+stdout: str readonly
+stderr: str readonly
+exit_code: Optional~int~ readonly
+SingleShotEntry(script str, id str, timestamp datetime)
+Script(script str, id str, timestamp datetime)
+update() void
+generate_context() ElementTree
}
@@ -546,19 +536,6 @@ classDiagram
+generate_context() ElementTree
}
class BackgroundEntry {
+script: str readonly
+stdout: str readonly
+stderr: str readonly
+exit_code: Optional~int~ readonly
+pid: Optional~int~ readonly
+BackgroundEntry(script str, id str, timestamp datetime)
+update() void
+generate_context() ElementTree
+cleanup() void
}
class ReasoningEntry {
+content: str readonly
@@ -596,9 +573,8 @@ classDiagram
ParseErrorEntry --|> Entry
ReadEntry --|> Entry
Entry <|-- WriteEntry
Entry <|-- SingleShotEntry
Entry <|-- ScriptEntry
Entry <|-- RepeatEntry
Entry <|-- BackgroundEntry
```
#### IO Buffer classes
@@ -669,4 +645,4 @@ classDiagram
Command <|-- DeleteCommand
Command <|-- StopCommand
Command -- CommandResult
```
```