Added a first example

This commit is contained in:
2024-10-18 23:38:02 +02:00
parent f3b679098e
commit e76bf19039

View File

@@ -3,7 +3,7 @@
SIA is an agentic artificial intelligence system that autonomously completes complex tasks by writing and executing scripts.
It uses a Large Language Model (LLM) which operates in a loop, generating reasoning and actions based on an updating context.
SIA manages Docker containers for task execution.
These can be short-lived or long-running.
These can be short-lived for e.g. bash one-liners or long-running for e.g. background tasks, training or communication.
The system implements reinforcement learning by analyzing past iterations to improve its LLM.
SIA can also modify its own source code, allowing it to adapt to new challenges.
@@ -21,14 +21,14 @@ Each iteration of the loop the system prompt and main context are provided.
The LLM generates a response with reasoning and a list of core actions to take.
The main context is always regenerated and contains:
- Orientation info
- time
- date
- System status and limits
- CPU
- GPU
- memory
- disk
- time and date (ISO 8601 UTC)
- CPU usage (%)
- GPU usage (%)
- memory usage and total (bytes)
- disk usage and total (bytes)
- context usage (%)
- standard input buffer contents (bytes)
- List of containers
- description
- status (initializing, running, finished)
@@ -146,4 +146,76 @@ The Context Template collects information from the modules and creates the input
The LLM Engine is responsible for:
- Running inference based on the provided context
- Updating the model's weights during the learning process
- Updating the model's weights during the learning process
## Implementation
This section explains technical details of the implementation.
### Context structure
The context is formatted as XML.
## Example iterations
### Clarifying a task
This example shows how to work with standard IO, run simple scripts and monitor files.
#### Context
```xml
<context>
<system
time="2024-10-18T12:00:00Z"
cpu=12
gpu=26
memory_used=9556302234
memory_total=17179869184
disk_used=244434939904
disk_total=273145991168
context=3
stdin=0
/>
<containers/>
<previous>
<reasoning>
There is data available on the standard input channel. I should read it. I have no other running tasks to tend to.
</reasoning>
<actions>
<read_stdin n="42">
Remind me to feed the cat tomorrow morning
</read_stdin>
</actions>
</previous>
<files>
<file name="/" type="dir">
drwxr-xr-x 1 sia 197121 0 2024-10-16 23:02:16.486152500 +0200 tasks/
drwxr-xr-x 1 sia 197121 0 2024-10-16 22:35:31.806079500 +0200 user/
</file>
<file name="/tasks" type="dir">
</file>
<file name="/user" type="dir">
-rw-r--r-- 1 sia 197121 71 2024-10-16 22:41:23.223580300 +0200 general_info.txt
</file>
<file name="/user/general_info.txt" type="file">
Name: John (I don't know his last name)
Location: Somewhere in Belgium
</file>
</files>
</context>
```
#### LLM response
```xml
John did not specify an exact time. I'll suggest 9am. He also did not specify how to be reminded. I'll ask but if he doesn't respond I'll assume a text message on standard output is fine. I'll write down this task in a file so I can keep it in context. I can write simple files with busybox:latest and echo but I will need to use sh -c to do the redirect.
<actions>
<write_stdout message="I'll remind you to feed the cat tomorrow morning at 9am. Is a message on the standard output ok?"/>
<start_container image="busybox:latest" timeout="1000" volumes="/tasks:/tasks" command="sh -c 'echo \'Remind John to feed the cat on 2024-10-18T09:00:00+02:00. Use standard output.\' > /tasks/reminder.txt'"/>
<monitor_file path="/tasks/reminder.txt"/>
</actions>
```
### Researching a topic
### Modifying the SIA code
### Learning from a mistake