Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 0e2fd2c

Browse files
committed
Merge branch 'development'
2 parents b1d4410 + dd5227d commit 0e2fd2c

File tree

101 files changed

+6003
-954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+6003
-954
lines changed

README.md

Lines changed: 188 additions & 287 deletions
Large diffs are not rendered by default.

docker/docker-compose.core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.9"
1+
name: bytebot
22

33
services:
44
bytebot-desktop:
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## docker-compose file that spins up a bytebot-desktop container
2+
## and a postgres container. bytebot-ui and bytebot-agent are not included
3+
## in this file, and can be run separately using npm, allowing for
4+
## easier local development.
5+
6+
name: bytebot
7+
8+
services:
9+
bytebot-desktop:
10+
# Build from source
11+
build:
12+
context: ../packages/
13+
dockerfile: bytebotd/Dockerfile
14+
# Use pre-built image
15+
image: ghcr.io/bytebot-ai/bytebot-desktop:edge
16+
shm_size: "2g"
17+
container_name: bytebot-desktop
18+
restart: unless-stopped
19+
hostname: computer
20+
privileged: true
21+
ports:
22+
- "9990:9990" # bytebotd service & noVNC
23+
environment:
24+
- DISPLAY=:0
25+
networks:
26+
- bytebot-network
27+
28+
postgres:
29+
image: postgres:16-alpine
30+
container_name: bytebot-postgres
31+
restart: unless-stopped
32+
ports:
33+
- "5432:5432"
34+
environment:
35+
- POSTGRES_PASSWORD=postgres
36+
- POSTGRES_USER=postgres
37+
- POSTGRES_DB=bytebotdb
38+
networks:
39+
- bytebot-network
40+
volumes:
41+
- postgres_data:/var/lib/postgresql/data
42+
43+
networks:
44+
bytebot-network:
45+
driver: bridge
46+
47+
volumes:
48+
postgres_data:

docker/docker-compose.proxy.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: bytebot
2+
3+
services:
4+
bytebot-desktop:
5+
# Build from source
6+
build:
7+
context: ../packages/
8+
dockerfile: bytebotd/Dockerfile
9+
# Use pre-built image
10+
image: ghcr.io/bytebot-ai/bytebot-desktop:edge
11+
shm_size: "2g"
12+
container_name: bytebot-desktop
13+
restart: unless-stopped
14+
hostname: computer
15+
privileged: true
16+
ports:
17+
- "9990:9990" # bytebotd service & noVNC
18+
environment:
19+
- DISPLAY=:0
20+
networks:
21+
- bytebot-network
22+
23+
postgres:
24+
image: postgres:16-alpine
25+
container_name: bytebot-postgres
26+
restart: unless-stopped
27+
ports:
28+
- "5432:5432"
29+
environment:
30+
- POSTGRES_PASSWORD=postgres
31+
- POSTGRES_USER=postgres
32+
- POSTGRES_DB=bytebotdb
33+
networks:
34+
- bytebot-network
35+
volumes:
36+
- postgres_data:/var/lib/postgresql/data
37+
38+
bytebot-agent:
39+
build:
40+
context: ../packages/
41+
dockerfile: bytebot-agent/Dockerfile
42+
# Use pre-built image
43+
image: ghcr.io/bytebot-ai/bytebot-agent:edge
44+
container_name: bytebot-agent
45+
restart: unless-stopped
46+
ports:
47+
- "9991:9991"
48+
environment:
49+
- DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/bytebotdb}
50+
- BYTEBOT_DESKTOP_BASE_URL=${BYTEBOT_DESKTOP_BASE_URL:-http://bytebot-desktop:9990}
51+
- BYTEBOT_LLM_PROXY_URL=${BYTEBOT_LLM_PROXY_URL:-http://bytebot-llm-proxy:4000}
52+
depends_on:
53+
- postgres
54+
networks:
55+
- bytebot-network
56+
57+
bytebot-llm-proxy:
58+
build:
59+
context: ../packages/
60+
dockerfile: bytebot-llm-proxy/Dockerfile
61+
ports:
62+
- "4000:4000"
63+
environment:
64+
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
65+
- OPENAI_API_KEY=${OPENAI_API_KEY}
66+
- GEMINI_API_KEY=${GEMINI_API_KEY}
67+
networks:
68+
- bytebot-network
69+
70+
bytebot-ui:
71+
build:
72+
context: ../packages/
73+
dockerfile: bytebot-ui/Dockerfile
74+
args:
75+
- BYTEBOT_AGENT_BASE_URL=${BYTEBOT_AGENT_BASE_URL:-http://bytebot-agent:9991}
76+
- BYTEBOT_DESKTOP_VNC_URL=${BYTEBOT_DESKTOP_VNC_URL:-http://bytebot-desktop:9990/websockify}
77+
# Use pre-built image
78+
image: ghcr.io/bytebot-ai/bytebot-ui:edge
79+
container_name: bytebot-ui
80+
restart: unless-stopped
81+
ports:
82+
- "9992:9992"
83+
environment:
84+
- NODE_ENV=production
85+
- BYTEBOT_AGENT_BASE_URL=${BYTEBOT_AGENT_BASE_URL:-http://bytebot-agent:9991}
86+
- BYTEBOT_DESKTOP_VNC_URL=${BYTEBOT_DESKTOP_VNC_URL:-http://bytebot-desktop:9990/websockify}
87+
depends_on:
88+
- bytebot-agent
89+
networks:
90+
- bytebot-network
91+
92+
networks:
93+
bytebot-network:
94+
driver: bridge
95+
96+
volumes:
97+
postgres_data:

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
- BYTEBOT_DESKTOP_BASE_URL=${BYTEBOT_DESKTOP_BASE_URL:-http://bytebot-desktop:9990}
5151
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
5252
- OPENAI_API_KEY=${OPENAI_API_KEY}
53-
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
53+
- GEMINI_API_KEY=${GEMINI_API_KEY}
5454
depends_on:
5555
- postgres
5656
networks:

docs/api-reference/agent/tasks.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,25 @@ Create a new task for the agent to process.
3434

3535
```json
3636
{
37-
"description": "This is a description of the task"
37+
"description": "This is a description of the task",
38+
"priority": "MEDIUM" // Optional: LOW, MEDIUM, HIGH, URGENT
3839
}
3940
```
4041

42+
#### With File Upload
43+
44+
To upload files with a task, use `multipart/form-data`:
45+
46+
```bash
47+
curl -X POST http://localhost:9991/tasks \
48+
-F "description=Analyze the uploaded contracts and extract key terms" \
49+
-F "priority=HIGH" \
50+
-F "files=@contract1.pdf" \
51+
-F "files=@contract2.pdf"
52+
```
53+
54+
Uploaded files are automatically saved to the desktop and can be referenced in the task description.
55+
4156
#### Response
4257

4358
```json

docs/api-reference/computer-use/unified-endpoint.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The unified computer action API allows for granular control over all aspects of
99

1010
## Endpoint
1111

12-
| Method | URL | Description |
13-
| ------ | ------------------------ | ----------------------------------------------- |
14-
| POST | `/computer-use/computer` | Execute computer actions in the virtual desktop |
12+
| Method | URL | Description |
13+
| ------ | ---------------- | ----------------------------------------------- |
14+
| POST | `/computer-use` | Execute computer actions in the virtual desktop |
1515

1616
## Request Format
1717

Lines changed: 107 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,110 @@
11
---
22
title: "API Reference"
3-
description: "Overview of the Bytebot API endpoints"
3+
description: "Overview of the Bytebot API endpoints for programmatic control"
44
---
55

6-
## Computer Use API
6+
# Bytebot API Overview
77

8-
Bytebot's core functionality is exposed through its Computer Use API, which provides a unified endpoint for all interactions with the desktop environment. The API allows for programmatic control of mouse movement, keyboard input, and screen capture.
8+
Bytebot provides two main APIs for programmatic control:
99

10-
### Authentication
10+
## 1. Agent API (Task Management)
1111

12-
The Bytebot API does not require authentication by default when accessed locally. For remote access, standard network security practices should be implemented.
12+
The Agent API runs on port 9991 and provides high-level task management:
1313

14-
### Base URL
15-
16-
All API endpoints are relative to the base URL:
14+
<CardGroup cols={2}>
15+
<Card
16+
title="Task Management"
17+
icon="list-check"
18+
href="/api-reference/agent/tasks"
19+
>
20+
Create, manage, and monitor AI-powered tasks programmatically
21+
</Card>
22+
<Card
23+
title="UI Integration"
24+
icon="window"
25+
href="/api-reference/agent/ui"
26+
>
27+
WebSocket connections and real-time updates for custom UIs
28+
</Card>
29+
</CardGroup>
1730

31+
### Agent API Base URL
1832
```
19-
http://localhost:9990
33+
http://localhost:9991
2034
```
2135

22-
The port can be configured when running the container.
36+
### Example Task Creation
37+
```bash
38+
curl -X POST http://localhost:9991/tasks \
39+
-H "Content-Type: application/json" \
40+
-d '{
41+
"description": "Download invoices from webmail and organize by date",
42+
"priority": "HIGH"
43+
}'
44+
```
45+
46+
## 2. Desktop API (Direct Control)
2347

24-
### API Endpoints
48+
The Desktop API runs on port 9990 and provides low-level desktop control:
2549

2650
<CardGroup cols={2}>
2751
<Card
28-
title="Unified Computer Actions"
52+
title="Computer Control"
2953
icon="keyboard"
3054
href="/api-reference/computer-use/unified-endpoint"
3155
>
32-
Single endpoint for all desktop interactions including mouse, keyboard, and
33-
screen operations
56+
Direct control of mouse, keyboard, and screen capture
3457
</Card>
3558
<Card
3659
title="Usage Examples"
3760
icon="code"
3861
href="/api-reference/computer-use/examples"
3962
>
40-
Code examples and snippets for common automation scenarios
63+
Code examples for common automation scenarios
4164
</Card>
4265
</CardGroup>
4366

44-
### Response Format
67+
### Desktop API Base URL
68+
```
69+
http://localhost:9990
70+
```
71+
72+
### Example Desktop Control
73+
```bash
74+
curl -X POST http://localhost:9990/computer-use \
75+
-H "Content-Type: application/json" \
76+
-d '{"action": "screenshot"}'
77+
```
78+
79+
### MCP Support
4580

46-
All API responses follow a standard JSON format:
81+
The Desktop API also exposes an MCP (Model Context Protocol) endpoint:
82+
```
83+
http://localhost:9990/mcp
84+
```
4785

86+
Connect your MCP client to access desktop control tools over SSE.
87+
88+
## Authentication
89+
90+
- **Local Access**: No authentication required by default
91+
- **Remote Access**: Configure authentication based on your security requirements
92+
- **Production**: Implement API keys, OAuth, or other authentication methods
93+
94+
## Response Formats
95+
96+
### Agent API Response
97+
```json
98+
{
99+
"id": "task-123",
100+
"status": "RUNNING",
101+
"description": "Your task description",
102+
"messages": [...],
103+
"createdAt": "2024-01-01T00:00:00Z"
104+
}
105+
```
106+
107+
### Desktop API Response
48108
```json
49109
{
50110
"success": true,
@@ -53,26 +113,39 @@ All API responses follow a standard JSON format:
53113
}
54114
```
55115

56-
### Error Handling
116+
## Error Handling
57117

58-
When an error occurs, the API returns:
118+
Both APIs use standard HTTP status codes:
59119

60-
```json
61-
{
62-
"success": false,
63-
"data": null,
64-
"error": "Detailed error message"
65-
}
66-
```
120+
| Status Code | Description |
121+
| ----------- | ------------------------------------ |
122+
| 200 | Success |
123+
| 201 | Created (new resource) |
124+
| 400 | Bad Request - Invalid parameters |
125+
| 401 | Unauthorized - Authentication failed |
126+
| 404 | Not Found - Resource doesn't exist |
127+
| 500 | Internal Server Error |
128+
129+
## Rate Limiting
130+
131+
- **Agent API**: No hard limits, but consider task queue capacity
132+
- **Desktop API**: No rate limiting, but rapid actions may impact desktop performance
67133

68-
Common HTTP status codes:
134+
## Best Practices
69135

70-
| Status Code | Description |
71-
| ----------- | -------------------------------- |
72-
| 200 | Success |
73-
| 400 | Bad Request - Invalid parameters |
74-
| 500 | Internal Server Error |
136+
1. **Use Agent API for high-level automation** - Let the AI handle complexity
137+
2. **Use Desktop API for precise control** - When you need exact actions
138+
3. **Combine both APIs** - Create tasks via Agent API, monitor via Desktop API
139+
4. **Handle errors gracefully** - Implement retry logic for transient failures
140+
5. **Monitor resource usage** - Both APIs can be resource-intensive
75141

76-
### Rate Limiting
142+
## Next Steps
77143

78-
The API currently does not implement rate limiting, but excessive requests may impact performance of the virtual desktop environment.
144+
<CardGroup cols={2}>
145+
<Card title="Quick Start" icon="rocket" href="/quickstart">
146+
Get your APIs running
147+
</Card>
148+
<Card title="Task Examples" icon="code" href="/guides/task-creation">
149+
See the APIs in action
150+
</Card>
151+
</CardGroup>

0 commit comments

Comments
 (0)