Skip to content

Commit bc7898a

Browse files
authored
Merge pull request #50 from rowboatlabs/dev
Dev changes
2 parents d877486 + 04f9b92 commit bc7898a

File tree

139 files changed

+14183
-6731
lines changed

Some content is hidden

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

139 files changed

+14183
-6731
lines changed

.env.example

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22
# ------------------------------------------------------------
33
MONGODB_CONNECTION_STRING=mongodb://127.0.0.1:27017/rowboat
44
OPENAI_API_KEY=<OPENAI_API_KEY>
5-
AUTH0_SECRET=<AUTH0_SECRET>
5+
6+
7+
# Uncomment to enable auth using Auth0
8+
# ------------------------------------------------------------
9+
# USE_AUTH=true
10+
11+
# Even though auth is disabled by default, these test values are needed for the auth0 imports
12+
# --------------------------------------------------------------------------------------------
13+
AUTH0_SECRET=test_secret
614
AUTH0_BASE_URL=http://localhost:3000
7-
AUTH0_ISSUER_BASE_URL=<AUTH0_ISSUER_BASE_URL>
8-
AUTH0_CLIENT_ID=<AUTH0_CLIENT_ID>
9-
AUTH0_CLIENT_SECRET=<AUTH0_CLIENT_SECRET>
15+
AUTH0_ISSUER_BASE_URL=https://test.com
16+
AUTH0_CLIENT_ID=test
17+
AUTH0_CLIENT_SECRET=test
1018

1119
# Uncomment to enable RAG:
1220
# ------------------------------------------------------------

README.md

+134-154
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
11
# RowBoat
22
[![RowBoat Logo](/assets/rb-logo.png)](https://www.rowboatlabs.com/)
33

4-
This guide will help you set up and run the RowBoat applications locally using Docker. Please see our [docs](https://docs.rowboatlabs.com/) for more details.
5-
6-
RowBoat offers several optional services that can be enabled using Docker Compose profiles. You can run multiple profiles simultaneously using:
7-
```bash
8-
docker compose --profile rag_urls_worker --profile chat_widget --profile tools_webhook up -d
9-
```
10-
See the relevant sections below for details on each service.
11-
12-
## Table of Contents
13-
- [Prerequisites](#prerequisites)
14-
- [Local Development Setup](#local-development-setup)
15-
- [Python SDK](#option-1-python-sdk)
16-
- [HTTP API](#option-2-http-api)
17-
- [Optional Features](#enable-rag)
18-
- [Enable RAG](#enable-rag)
19-
- [URL Scraping](#url-scraping)
20-
- [File Uploads](#file-uploads)
21-
- [Enable Chat Widget](#enable-chat-widget)
22-
- [Enable Tools Webhook](#enable-tools-webhook)
23-
- [Troubleshooting](#troubleshooting)
24-
- [Attribution](#attribution)
4+
RowBoat is the fastest way to build production-ready multi-agent systems with OpenAI's Agents SDK.
255

266
## Prerequisites
277

@@ -34,29 +14,15 @@ Before running RowBoat, ensure you have:
3414
- Obtain from your OpenAI account.
3515

3616
3. **MongoDB**
37-
- **Option 1**: Use an existing MongoDB deployment with your connection string.
38-
- **Option 2**: Install MongoDB locally:
17+
- macOS (Homebrew)
3918
```bash
4019
brew tap mongodb/brew
4120
brew install [email protected]
4221
brew services start [email protected]
4322
```
23+
- Other platforms: Refer to the MongoDB documentation for details.
4424

45-
4. **Auth0 Account and Application Setup**
46-
- **Create an Auth0 Account**: Sign up at [Auth0](https://auth0.com).
47-
- **Create a New Application**: Choose "Regular Web Application", select "Next.js" as the application type, and name it "RowBoat".
48-
- **Configure Application**:
49-
- **Allowed Callback URLs**: In the Auth0 Dashboard, go to your "RowBoat" application settings and set `http://localhost:3000/api/auth/callback` as an Allowed Callback URL.
50-
- **Get Credentials**: Collect the following from your Auth0 application settings:
51-
- **Domain**: Copy your Auth0 domain (ensure you append `https://` to the Domain that the Auth0 dashboard shows you)
52-
- **Client ID**: Your application's unique identifier
53-
- **Client Secret**: Your application's secret key
54-
- **Generate secret**: Generate a session encryption secret in your terminal and note the output for later:
55-
```bash
56-
openssl rand -hex 32
57-
```
58-
59-
## Local Development Setup
25+
## Quickstart
6026

6127
1. **Clone the Repository**
6228
```bash
@@ -69,24 +35,11 @@ Before running RowBoat, ensure you have:
6935
```bash
7036
cp .env.example .env
7137
```
72-
- Update your `.env` file with the following configurations:
38+
- Open the new .env file and update the OPENAI_API_KEY:
7339

7440
```ini
7541
# OpenAI Configuration
7642
OPENAI_API_KEY=your-openai-api-key
77-
78-
# Auth0 Configuration
79-
AUTH0_SECRET=your-generated-secret # Generated using openssl command
80-
AUTH0_BASE_URL=http://localhost:3000 # Your application's base URL
81-
AUTH0_ISSUER_BASE_URL=https://example.auth0.com # Your Auth0 domain (ensure it is prefixed with https://)
82-
AUTH0_CLIENT_ID=your-client-id
83-
AUTH0_CLIENT_SECRET=your-client-secret
84-
85-
# MongoDB Configuration (choose one based on your setup)
86-
# For local MongoDB
87-
MONGODB_CONNECTION_STRING=mongodb://host.docker.internal:27017/rowboat
88-
# or, for remote MongoDB
89-
MONGODB_CONNECTION_STRING=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/rowboat
9043
```
9144

9245
3. **Start the App**
@@ -97,82 +50,6 @@ Before running RowBoat, ensure you have:
9750
4. **Access the App**
9851
- Visit [http://localhost:3000](http://localhost:3000).
9952

100-
5. **Interact with RowBoat**
101-
102-
There are two ways to interact with RowBoat:
103-
104-
### Option 1: Python SDK
105-
106-
For Python applications, we provide an official SDK for easier integration:
107-
```bash
108-
pip install rowboat
109-
```
110-
111-
```python
112-
from rowboat import Client
113-
114-
client = Client(
115-
host="http://localhost:3000",
116-
project_id="<PROJECT_ID>",
117-
api_key="<API_KEY>" # Generate this from /projects/<PROJECT_ID>/config
118-
)
119-
120-
# Simple chat interaction
121-
messages = [{"role": "user", "content": "Tell me the weather in London"}]
122-
response_messages, state = client.chat(messages=messages)
123-
```
124-
125-
For more details, see the [Python SDK documentation](./apps/python-sdk/README.md).
126-
127-
### Option 2: HTTP API
128-
129-
You can use the API directly at [http://localhost:3000/api/v1/](http://localhost:3000/api/v1/)
130-
- Project ID is available in the URL of the project page
131-
- API Key can be generated from the project config page at `/projects/<PROJECT_ID>/config`
132-
133-
```bash
134-
curl --location 'http://localhost:3000/api/v1/<PROJECT_ID>/chat' \
135-
--header 'Content-Type: application/json' \
136-
--header 'Authorization: Bearer <API_KEY>' \
137-
--data '{
138-
"messages": [
139-
{
140-
"role": "user",
141-
"content": "tell me the weather in london in metric units"
142-
}
143-
]
144-
}'
145-
```
146-
which gives:
147-
```json
148-
{
149-
"messages": [
150-
{
151-
"role": "assistant",
152-
"tool_calls": [
153-
{
154-
"function": {
155-
"arguments": "{\"location\":\"London\",\"units\":\"metric\"}",
156-
"name": "weather_lookup_tool"
157-
},
158-
"id": "call_r6XKuVxmGRogofkyFZIacdL0",
159-
"type": "function"
160-
}
161-
],
162-
"agenticSender": "Example Agent",
163-
"agenticResponseType": "internal"
164-
}
165-
],
166-
"state": {
167-
// .. state data
168-
}
169-
}
170-
```
171-
172-
6. **Documentation**
173-
174-
The documentation site is available at [http://localhost:8000](http://localhost:8000)
175-
17653
## Enable RAG
17754

17855
RowBoat supports RAG capabilities to enhance responses with your custom knowledge base. To enable RAG, you'll need:
@@ -298,32 +175,6 @@ Enable file upload support (PDF, DOCX, TXT) for your knowledge base:
298175
299176
After enabling RAG and starting the required workers, you can manage your knowledge base through the RowBoat UI at `/projects/<PROJECT_ID>/sources`.
300177
301-
## Enable Chat Widget
302-
303-
RowBoat provides an embeddable chat widget that you can add to any website. To enable and use the chat widget:
304-
305-
1. **Generate JWT Secret**
306-
Generate a secret for securing chat widget sessions:
307-
```bash
308-
openssl rand -hex 32
309-
```
310-
311-
2. **Update Environment Variables**
312-
```ini
313-
USE_CHAT_WIDGET=true
314-
CHAT_WIDGET_SESSION_JWT_SECRET=<your-generated-secret>
315-
```
316-
317-
3. **Start the Chat Widget Service**
318-
```bash
319-
docker compose --profile chat_widget up -d
320-
```
321-
322-
4. **Add Widget to Your Website**
323-
You can find the chat-widget embed code under `/projects/<PROJECT_ID>/config`
324-
325-
After setup, the chat widget will appear on your website and connect to your RowBoat project.
326-
327178
## Enable Tools Webhook
328179
329180
RowBoat includes a built-in webhook service that allows you to implement custom tool functions. To use this feature:
@@ -371,6 +222,135 @@ RowBoat includes a built-in webhook service that allows you to implement custom
371222
372223
The webhook service handles all the security and parameter validation, allowing you to focus on implementing your tool logic.
373224
225+
## Enable Chat Widget
226+
227+
RowBoat provides an embeddable chat widget that you can add to any website. To enable and use the chat widget:
228+
229+
1. **Generate JWT Secret**
230+
Generate a secret for securing chat widget sessions:
231+
```bash
232+
openssl rand -hex 32
233+
```
234+
235+
2. **Update Environment Variables**
236+
```ini
237+
USE_CHAT_WIDGET=true
238+
CHAT_WIDGET_SESSION_JWT_SECRET=<your-generated-secret>
239+
```
240+
241+
3. **Start the Chat Widget Service**
242+
```bash
243+
docker compose --profile chat_widget up -d
244+
```
245+
246+
4. **Add Widget to Your Website**
247+
You can find the chat-widget embed code under `/projects/<PROJECT_ID>/config`
248+
249+
After setup, the chat widget will appear on your website and connect to your RowBoat project.
250+
251+
## Enable Authentication
252+
253+
By default, RowBoat runs without authentication. To enable user authentication using Auth0:
254+
255+
1. **Auth0 Setup**
256+
- **Create an Auth0 Account**: Sign up at [Auth0](https://auth0.com).
257+
- **Create a New Application**: Choose "Regular Web Application", select "Next.js" as the application type, and name it "RowBoat".
258+
- **Configure Application**:
259+
- **Allowed Callback URLs**: In the Auth0 Dashboard, go to your "RowBoat" application settings and set `http://localhost:3000/api/auth/callback` as an Allowed Callback URL.
260+
- **Get Credentials**: Collect the following from your Auth0 application settings:
261+
- **Domain**: Copy your Auth0 domain (ensure you append `https://` to the Domain that the Auth0 dashboard shows you)
262+
- **Client ID**: Your application's unique identifier
263+
- **Client Secret**: Your application's secret key
264+
- **Generate secret**: Generate a session encryption secret in your terminal and note the output for later:
265+
```bash
266+
openssl rand -hex 32
267+
```
268+
269+
2. **Update Environment Variables**
270+
Add the following to your `.env` file:
271+
```ini
272+
USE_AUTH=true
273+
AUTH0_SECRET=your-generated-secret # Generated using openssl command
274+
AUTH0_BASE_URL=http://localhost:3000 # Your application's base URL
275+
AUTH0_ISSUER_BASE_URL=https://example.auth0.com # Your Auth0 domain (ensure it is prefixed with https://)
276+
AUTH0_CLIENT_ID=your-client-id
277+
AUTH0_CLIENT_SECRET=your-client-secret
278+
```
279+
280+
After enabling authentication, users will need to sign in to access the application.
281+
282+
## Interact with RowBoat API
283+
284+
There are two ways to interact with RowBoat's API:
285+
286+
1. **Option 1: Python SDK**
287+
288+
289+
For Python applications, we provide an official SDK for easier integration:
290+
```bash
291+
pip install rowboat
292+
```
293+
294+
```python
295+
from rowboat import Client
296+
297+
client = Client(
298+
host="http://localhost:3000",
299+
project_id="<PROJECT_ID>",
300+
api_key="<API_KEY>" # Generate this from /projects/<PROJECT_ID>/config
301+
)
302+
303+
# Simple chat interaction
304+
messages = [{"role": "user", "content": "Tell me the weather in London"}]
305+
response_messages, state = client.chat(messages=messages)
306+
```
307+
308+
For more details, see the [Python SDK documentation](./apps/python-sdk/README.md).
309+
310+
1. **Option 2: HTTP API**
311+
You can use the API directly at [http://localhost:3000/api/v1/](http://localhost:3000/api/v1/)
312+
- Project ID is available in the URL of the project page
313+
- API Key can be generated from the project config page at `/projects/<PROJECT_ID>/config`
314+
315+
```bash
316+
curl --location 'http://localhost:3000/api/v1/<PROJECT_ID>/chat' \
317+
--header 'Content-Type: application/json' \
318+
--header 'Authorization: Bearer <API_KEY>' \
319+
--data '{
320+
"messages": [
321+
{
322+
"role": "user",
323+
"content": "tell me the weather in london in metric units"
324+
}
325+
]
326+
}'
327+
```
328+
which gives:
329+
```json
330+
{
331+
"messages": [
332+
{
333+
"role": "assistant",
334+
"tool_calls": [
335+
{
336+
"function": {
337+
"arguments": "{\"location\":\"London\",\"units\":\"metric\"}",
338+
"name": "weather_lookup_tool"
339+
},
340+
"id": "call_r6XKuVxmGRogofkyFZIacdL0",
341+
"type": "function"
342+
}
343+
],
344+
"agenticSender": "Example Agent",
345+
"agenticResponseType": "internal"
346+
}
347+
],
348+
"state": {
349+
// .. state data
350+
}
351+
}
352+
```
353+
374354
## Troubleshooting
375355

376356
1. **MongoDB Connection Issues**

0 commit comments

Comments
 (0)