Update documentation and add agent workspaces guide
All checks were successful
GBCI / build (push) Successful in 31s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-03-03 14:53:13 -03:00
parent 5b6e9d7208
commit 66c65c6167
9 changed files with 50 additions and 12 deletions

View file

@ -55,7 +55,7 @@ On first run, botserver automatically:
- Installs required components (PostgreSQL, S3 storage, Cache, LLM)
- Sets up database with migrations
- Downloads AI models
- Starts HTTP server at `http://127.0.0.1:9000`
- Starts HTTP server at `http://127.0.0.1:8080`
### Run the Desktop App

View file

@ -14,7 +14,7 @@ The Storage API allows you to:
## Base URL
```
http://localhost:9000/api/v1/storage
http://localhost:8080/api/v1/storage
```
## Authentication
@ -190,7 +190,7 @@ Generate a presigned URL for temporary access.
**Response:**
```json
{
"url": "http://localhost:9000/mybot.gbai/file.pdf?X-Amz-Algorithm=...",
"url": "http://localhost:8080/mybot.gbai/file.pdf?X-Amz-Algorithm=...",
"expires_at": "2024-01-15T11:30:00Z"
}
```
@ -268,7 +268,7 @@ curl -X PUT \
-H "Authorization: Bearer token123" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf \
http://localhost:9000/api/v1/storage/buckets/mybot.gbai/objects/docs/manual.pdf
http://localhost:8080/api/v1/storage/buckets/mybot.gbai/objects/docs/manual.pdf
```
### Download File
@ -276,7 +276,7 @@ curl -X PUT \
```bash
curl -X GET \
-H "Authorization: Bearer token123" \
http://localhost:9000/api/v1/storage/buckets/mybot.gbai/objects/docs/manual.pdf \
http://localhost:8080/api/v1/storage/buckets/mybot.gbai/objects/docs/manual.pdf \
-o downloaded.pdf
```
@ -285,7 +285,7 @@ curl -X GET \
```bash
curl -X GET \
-H "Authorization: Bearer token123" \
"http://localhost:9000/api/v1/storage/buckets/mybot.gbai/objects?prefix=docs/"
"http://localhost:8080/api/v1/storage/buckets/mybot.gbai/objects?prefix=docs/"
```
## Storage Organization

View file

@ -159,7 +159,7 @@ Run General Bots on your own infrastructure with single binary deployment, conta
./botserver
```
Access at `http://localhost:9000` and start building.
Access at `http://localhost:8080` and start building.
## Summary

View file

@ -123,7 +123,7 @@ Document WebSocket protocols with connection details, message formats for both d
### Connection
```
ws://localhost:9000/ws
ws://localhost:8080/ws
```
### Message Format

View file

@ -67,7 +67,7 @@ return {
'botserver/nvim-botserver',
config = function()
require('botserver').setup({
server_url = 'http://localhost:9000',
server_url = 'http://localhost:8080',
default_bot = 'edu'
})
end

View file

@ -0,0 +1,37 @@
# Agent Workspaces
General Bots supports an advanced "Agent Mode" UI where the interaction with an AI agent shifts from a simple chat interface to a fully realized multi-panel workspace. This design empowers users to monitor complex autonomous tasks in real-time, providing deep visibility into what the AI is doing.
## Architectural Overview
When an application logic branch triggers a computationally heavy or open-ended action (like `APP_CREATE` or deep research), the backend kicks off an **Agent Executor** process. This executor brings up a dedicated, highly isolated LXC container for that specific session.
The Agent Executor communicates back to the frontend in real-time. This provides a transparent view of:
1. **Thought Processes**: High-level textual reasoning of the agent.
2. **Terminal Output**: Verbatim standard output and standard error from the LXC container.
3. **Browser Output**: Visual previews of web applications being built or research being conducted, served via localhost proxies from within the container.
## The Agent UI
The main interface pivots from a standard 1-panel conversation to a complex multi-panel grid when "Agent Mode" is toggled from the Chat interface.
This layout includes:
- **Left Sidebar**: A collapsible "Agents & Workspaces" sidebar that summarizes the current state of active agents, their resource usage (quota), and provides drag-and-drop workspace organization.
- **Center Chat**: A persistent interactive chat with the specific agent, allowing for ongoing refinement of the task.
- **Right Hand Split Screens**:
- **Top Right**: An active Browser Window. The agent can stream HTML rendering updates or host internal applications (`localhost`) from its LXC sandbox, exposing them visually to the user.
- **Bottom Right**: A live Terminal feed streaming `stdout` and `stderr` directly from the bash environment of the underlying LXC container.
## LXC Sandbox execution
To prevent dependency collisions, protect the host operating system, and offer clean slate environments for arbitrary execution, every agent session spins up a temporary **Ubuntu 22.04 LXC container**.
1. When the agent intent classifier matches a heavy task (e.g. `APP_CREATE`), the backend initiates the `ContainerSession` struct.
2. An `lxc launch` command instantiates a fast, lightweight container instance.
3. A bash shell is opened inside this container, and its I/O streams are piped back to the `TaskProgressEvent` broadcast channel using Tokio.
4. The user sees the bash output instantly in the bottom-right terminal panel.
5. On completion or failure, the container is forcibly stopped and deleted (`lxc delete --force`).
This isolated environment gives agents the absolute freedom to execute package installations (like `npm install`), launch development servers, and write arbitrary code, entirely segregated from the primary `BotServer`.

View file

@ -100,7 +100,7 @@ lxc config set botserver limits.memory 4GB
lxc config set botserver limits.cpu 2
# Forward ports
lxc config device add botserver http proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:9000
lxc config device add botserver http proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:8080
lxc config device add botserver https proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:8443
# Set environment for Vault
@ -118,7 +118,7 @@ services:
botserver:
image: generalbots/botserver:latest
ports:
- "8080:9000"
- "8080:8080"
environment:
- VAULT_ADDR=http://vault:8200
volumes:

View file

@ -410,6 +410,7 @@
- [Data Model](./17-autonomous-tasks/data-model.md)
- [Examples](./17-autonomous-tasks/examples.md)
- [Designer](./17-autonomous-tasks/designer.md)
- [Agent Workspaces](./17-autonomous-tasks/agent-workspaces.md)
# Part XVII - Scale

View file

@ -250,7 +250,7 @@ chmod +x botserver
### 2. Open Browser
```
http://localhost:9000
http://localhost:8080
```
### 3. Start Chatting