From 537be740e1d1f71cf3fbbc40d592f2e1b10f8978 Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:30:27 +0530 Subject: [PATCH 01/30] Run mongodb in docker --- .env.example | 1 - .gitignore | 3 ++- README.md | 23 ++++------------------- docker-compose.yml | 23 ++++++++++++++++------- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.env.example b/.env.example index 1d7210dd..1d0adf59 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,5 @@ # Basic configuration # ------------------------------------------------------------ -MONGODB_CONNECTION_STRING=mongodb://host.docker.internal:27017/rowboat OPENAI_API_KEY= diff --git a/.gitignore b/.gitignore index 1a196ddf..6e2254a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store .env -.vscode/ \ No newline at end of file +.vscode/ +data/ diff --git a/README.md b/README.md index c44e852c..f8db38a4 100644 --- a/README.md +++ b/README.md @@ -33,14 +33,6 @@ Before running Rowboat, ensure you have: 2. **OpenAI API Key** - Obtain from your OpenAI account. - -3. **MongoDB** - - macOS (Homebrew) - ```bash - brew tap mongodb/brew - brew install mongodb-community@8.0 - brew services start mongodb-community@8.0 - ``` - Other platforms: Refer to the [MongoDB documentation](https://www.mongodb.com/docs/manual/installation/) for details. ## Setup Rowboat @@ -51,17 +43,10 @@ Before running Rowboat, ensure you have: cd rowboat ``` -2. **Environment Configuration** - - Copy the `.env.example` file and rename it to `.env`: - ```bash - cp .env.example .env - ``` - - Open the new .env file and update the OPENAI_API_KEY: - - ```ini - # OpenAI Configuration - OPENAI_API_KEY=your-openai-api-key - ``` +2. **Set OpenAI key** + ```bash + export OPENAI_API_KEY=your-openai-api-key + ``` 3. **Start the App** ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 9bd9f45b..ae67db3d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - "3000:3000" environment: - OPENAI_API_KEY=${OPENAI_API_KEY} - - MONGODB_CONNECTION_STRING=${MONGODB_CONNECTION_STRING} + - MONGODB_CONNECTION_STRING=mongodb://mongo:27017/rowboat - USE_AUTH=${USE_AUTH} - AUTH0_SECRET=${AUTH0_SECRET} - AUTH0_BASE_URL=${AUTH0_BASE_URL} @@ -49,7 +49,7 @@ services: - OPENAI_API_KEY=${OPENAI_API_KEY} - API_KEY=${AGENTS_API_KEY} - REDIS_URL=redis://redis:6379 - - MONGODB_URI=${MONGODB_CONNECTION_STRING} + - MONGODB_URI=mongodb://mongo:27017/rowboat - QDRANT_URL=${QDRANT_URL} - QDRANT_API_KEY=${QDRANT_API_KEY} restart: unless-stopped @@ -80,7 +80,7 @@ services: context: ./apps/simulation_runner dockerfile: Dockerfile environment: - - MONGODB_URI=${MONGODB_CONNECTION_STRING} + - MONGODB_URI=mongodb://mongo:27017/rowboat - ROWBOAT_API_HOST=http://rowboat:3000 - OPENAI_API_KEY=${OPENAI_API_KEY} restart: unless-stopped @@ -115,7 +115,7 @@ services: profiles: [ "rag_files_worker" ] environment: - OPENAI_API_KEY=${OPENAI_API_KEY} - - MONGODB_CONNECTION_STRING=${MONGODB_CONNECTION_STRING} + - MONGODB_CONNECTION_STRING=mongodb://mongo:27017/rowboat - GOOGLE_API_KEY=${GOOGLE_API_KEY} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} @@ -133,7 +133,7 @@ services: profiles: [ "rag_urls_worker" ] environment: - OPENAI_API_KEY=${OPENAI_API_KEY} - - MONGODB_CONNECTION_STRING=${MONGODB_CONNECTION_STRING} + - MONGODB_CONNECTION_STRING=mongodb://mongo:27017/rowboat - FIRECRAWL_API_KEY=${FIRECRAWL_API_KEY} - QDRANT_URL=${QDRANT_URL} - QDRANT_API_KEY=${QDRANT_API_KEY} @@ -147,7 +147,7 @@ services: profiles: [ "rag_text_worker" ] environment: - OPENAI_API_KEY=${OPENAI_API_KEY} - - MONGODB_CONNECTION_STRING=${MONGODB_CONNECTION_STRING} + - MONGODB_CONNECTION_STRING=mongodb://mongo:27017/rowboat - QDRANT_URL=${QDRANT_URL} - QDRANT_API_KEY=${QDRANT_API_KEY} restart: unless-stopped @@ -165,6 +165,15 @@ services: - ROWBOAT_HOST=http://localhost:3000 restart: unless-stopped + mongo: + image: mongo:latest + ports: + - "27017:27017" + restart: unless-stopped + attach: false + volumes: + - ./data/mongo:/data/db + redis: image: redis:latest ports: @@ -188,5 +197,5 @@ services: # environment: # - ELEVENLABS_API_KEY=${ELEVENLABS_API_KEY} # - ROWBOAT_API_HOST=http://rowboat:3000 - # - MONGODB_URI=${MONGODB_CONNECTION_STRING} + # - MONGODB_URI=mongodb://mongo:27017/rowboat # restart: unless-stopped From a106db9a2241b61b83acf09b7708a2d3371bf6c3 Mon Sep 17 00:00:00 2001 From: arkml Date: Mon, 7 Apr 2025 16:13:49 +0530 Subject: [PATCH 02/30] Update README.md --- README.md | 341 +++--------------------------------------------------- 1 file changed, 16 insertions(+), 325 deletions(-) diff --git a/README.md b/README.md index f8db38a4..5f8e8926 100644 --- a/README.md +++ b/README.md @@ -1,321 +1,40 @@ ![ui](/assets/banner.png) -

The AI-assisted agent builder

+

Let AI build multi-agents with MCP for you

[Quickstart](#quick-start) | [Docs](https://docs.rowboatlabs.com/) | [Website](https://www.rowboatlabs.com/) | [Discord](https://discord.gg/jHhUKkKHn8)
-A Cursor-like, AI-assisted, no-code IDE for building production-ready multi-agents. +Build multi-agents in minutes with Rowboat: +- โœจ Start from an Idea -> AI plans and builds the multi-agent system for you + - E.g. "Build me an assistant for a food delivery company to handle delivery status and missing items. Include the necessary tools." +- ๐ŸŒ Connect MCP servers + - Add the MCP servers in settings -> import the tools into Rowboat. +- ๐Ÿ“ž Integrate into your app using the HTTP API + - Grab the project ID and generated API key from settings and use the API. -- โœจ Start from a simple prompt to create fully functional agents with the Copilot -- ๐Ÿงช Test them in AI-simulated scenarios -- ๐ŸŒ Connect MCP servers and tools -- ๐Ÿ“ž Interact through the Python SDK, a web widget, or a Twilio phone number -- โ™ป๏ธ Continuously refine your agents by providing feedback to the Copilot +Built with OpenAI's Agents SDK, Rowboat is the fastest way to build multi-agents! +## Quick start - -Built on OpenAI's Agents SDK, **Rowboat is the fastest way to build multi-agents!** - - -![ui](/assets/ui_revamp_screenshot.png) - -# Quick start - -## Prerequisites - -Before running Rowboat, ensure you have: - -1. **Docker Desktop** - - [Download Docker Desktop](https://www.docker.com/products/docker-desktop) - -2. **OpenAI API Key** - - Obtain from your OpenAI account. - - Other platforms: Refer to the [MongoDB documentation](https://www.mongodb.com/docs/manual/installation/) for details. - -## Setup Rowboat - -1. **Clone the Repository** +1. **Clone the Repository and start Rowboat docker** ```bash git clone git@github.com:rowboatlabs/rowboat.git cd rowboat - ``` - -2. **Set OpenAI key** - ```bash - export OPENAI_API_KEY=your-openai-api-key - ``` - -3. **Start the App** - ```bash docker-compose up --build ``` + 4. **Access the App** - Visit [http://localhost:3000](http://localhost:3000). +![ui](/assets/ui_revamp_screenshot.png) -Refer to [Docs](https://docs.rowboatlabs.com/) to learn how to start building agents with Rowboat. +## Integrate Rowboat to your app with the HTTP API -# Advanced - -## 1. Tool Use - -You can add your tools / APIs to Rowboat through (a) connecting MCP servers, or (b) connecting a webhook. - -### 1.1 MCP Servers - -You can intergrate any MCP server in Settings -> Tools -> MCP Servers. The Tools on the servers will show up inside Rowboats Tools section. - -ui - -Tip: You might want to set the MCP url as http://host.docker.internal/... to allow services to access the MCP servers on your localhost. - -### 1.2 Webhook - -You can point Rowboat to any webhook in Settings -> Tools -> Webhook. - -Rowboat also includes a built-in webhook service that allows you to implement custom tool functions easily. To use this feature: - -1. **Generate Signing Secret** - Generate a secret for securing webhook requests: - ```bash - openssl rand -hex 32 - ``` - -2. **Update Environment Variables** - ```ini - SIGNING_SECRET= - ``` - -3. **Implement Your Functions** - Add your custom functions to `apps/tools_webhook/function_map.py`: - ```python - def get_weather(location: str, units: str = "metric"): - """Return weather data for the given location.""" - # Your implementation here - return {"temperature": 20, "conditions": "sunny"} - - def check_inventory(product_id: str): - """Check inventory levels for a product.""" - # Your implementation here - return {"in_stock": 42, "warehouse": "NYC"} - - # Add your functions to the map - FUNCTIONS_MAP = { - "get_weather": get_weather, - "check_inventory": check_inventory - } - ``` - -4. **Start the Tools Webhook Service** - ```bash - docker compose --profile tools_webhook up -d - ``` - -5. **Register Tools in Rowboat** - - Navigate to your project config at `/projects//config` - - Ensure that the webhook URL is set to: `http://tools_webhook:3005/tool_call` - - Tools will automatically be forwarded to your webhook implementation - -The webhook service handles all the security and parameter validation, allowing you to focus on implementing your tool logic. - -## 2. Retrieve Augmented Generation (RAG) - -Rowboat supports adding text directly, document uploads or scraping URLs to enhance the responses with your custom knowledge base. Rowboat uses Qdrant as the vector DB. - -### 2.1 Setup Qdrant -To enable RAG you need to first setup Qdrant. - -1. Option1: Run Qdrant locally - - Run Qdrant docker - ```bash - docker run -p 6333:6333 qdrant/qdrant - ``` - - Update environment variables - ```ini - USE_RAG=true - QDRANT_URL=http://localhost:6333 - QDRANT_API_KEY= # Only needed for Qdrant Cloud - ``` -2. Option2: Use [Qdrant Cloud](https://cloud.qdrant.io/) - - Note your cluster URL and API key - - Update environment variables - ```ini - USE_RAG=true - QDRANT_URL= - QDRANT_API_KEY= - ``` -3. Initialize Qdrant Collections - ```bash - docker compose --profile setup_qdrant up setup_qdrant - ``` - - If you need to delete the collections and start fresh, you can run: - ```bash - docker compose --profile delete_qdrant up delete_qdrant - ``` -### 2.2 Adding Knowledge Base for RAG - -You can add a knowledge corpus to Rowboat by directly adding text information, uploading supported files or by pointing Rowboat to URLs for scraping. - -#### (a) Create Text for Knowledge -Rowboat support directly creating a corpus of knowledge inside the platform. - -- Start the Text Worker - ```bash - docker compose --profile rag_text_worker up -d - ``` -#### (b) Scrape URLs for Knowledge - -Rowboat supports scraping urls using Firecrawl. To setup scraping: - -1. Get Firecrawl API Key - - Sign up at [Firecrawl](https://firecrawl.co) - - Generate an API key - -2. Update Environment Variables - ```ini - USE_RAG_SCRAPING=true - FIRECRAWL_API_KEY= - ``` - -3. Start the URLs Worker - ```bash - docker compose --profile rag_urls_worker up -d - ``` - -#### (c) Upload Files for Knowledge - -Rowboat supports file uploads (PDF, DOCX, TXT) for your knowledge base. It uses Google's Gemini LLM to convert the documents to Markdown before indexing: - -1. Prerequisites - - An AWS S3 bucket for file storage - - Google Cloud API key with Generative Language (Gemini) API enabled (for enhanced document parsing) - -2. Configure AWS S3 - - Create an S3 bucket - - Add the following CORS configuration to your bucket: - ```json - [ - { - "AllowedHeaders": [ - "*" - ], - "AllowedMethods": [ - "PUT", - "POST", - "DELETE", - "GET" - ], - "AllowedOrigins": [ - "http://localhost:3000", - ], - "ExposeHeaders": [ - "ETag" - ] - } - ] - ``` - - Ensure your AWS credentials have the following IAM policy: - ```json - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "VisualEditor0", - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:GetObject", - "s3:DeleteObject", - "s3:ListBucket" - ], - "Resource": [ - "arn:aws:s3:::/*", - "arn:aws:s3:::" - ] - } - ] - } - ``` - -3. Update Environment Variables - ```ini - USE_RAG_UPLOADS=true - AWS_ACCESS_KEY_ID= - AWS_SECRET_ACCESS_KEY= - RAG_UPLOADS_S3_BUCKET= - RAG_UPLOADS_S3_REGION= - GOOGLE_API_KEY= - ``` - -4. Start the Files Worker - ```bash - docker compose --profile rag_files_worker up -d - ``` - -After enabling RAG and starting the required workers, you can manage your knowledge base through the Rowboat UI at `/projects//sources`. - -## 3. Chat Widget - -Rowboat provides an embeddable chat widget that you can add to any website. To enable and use the chat widget: - -1. **Generate JWT Secret** - Generate a secret for securing chat widget sessions: - ```bash - openssl rand -hex 32 - ``` - -2. **Update Environment Variables** - ```ini - USE_CHAT_WIDGET=true - CHAT_WIDGET_SESSION_JWT_SECRET= - ``` - -3. **Start the Chat Widget Service** - ```bash - docker compose --profile chat_widget up -d - ``` - -4. **Add Widget to Your Website** - You can find the chat-widget embed code under `/projects//config` - -After setup, the chat widget will appear on your website and connect to your Rowboat project. - - -## 4. Interact with Rowboat API - -There are two ways to interact with Rowboat's API: - -1. **Option 1: Python SDK** - - - For Python applications, we provide an official SDK for easier integration: - ```bash - pip install rowboat - ``` - - ```python - from rowboat import Client - - client = Client( - host="http://localhost:3000", - project_id="", - api_key="" # Generate this from /projects//config - ) - - # Simple chat interaction - messages = [{"role": "user", "content": "Tell me the weather in London"}] - response_messages, state = client.chat(messages=messages) - ``` - - For more details, see the [Python SDK documentation](./apps/python-sdk/README.md). - -1. **Option 2: HTTP API** - You can use the API directly at [http://localhost:3000/api/v1/](http://localhost:3000/api/v1/) +You can use the API directly at [http://localhost:3000/api/v1/](http://localhost:3000/api/v1/) - Project ID is available in the URL of the project page - API Key can be generated from the project config page at `/projects//config` @@ -358,35 +77,7 @@ There are two ways to interact with Rowboat's API: } ``` -### 5. Authentication +Refer to [Docs](https://docs.rowboatlabs.com/) to learn how to start building agents with Rowboat. -By default, Rowboat runs without authentication. To enable user authentication using Auth0: - -1. **Auth0 Setup** - - **Create an Auth0 Account**: Sign up at [Auth0](https://auth0.com). - - **Create a New Application**: Choose "Regular Web Application", select "Next.js" as the application type, and name it "Rowboat". - - **Configure Application**: - - **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. - - **Get Credentials**: Collect the following from your Auth0 application settings: - - **Domain**: Copy your Auth0 domain (ensure you append `https://` to the Domain that the Auth0 dashboard shows you) - - **Client ID**: Your application's unique identifier - - **Client Secret**: Your application's secret key - - **Generate secret**: Generate a session encryption secret in your terminal and note the output for later: - ```bash - openssl rand -hex 32 - ``` - -2. **Update Environment Variables** - Add the following to your `.env` file: - ```ini - USE_AUTH=true - AUTH0_SECRET=your-generated-secret # Generated using openssl command - AUTH0_BASE_URL=http://localhost:3000 # Your application's base URL - AUTH0_ISSUER_BASE_URL=https://example.auth0.com # Your Auth0 domain (ensure it is prefixed with https://) - AUTH0_CLIENT_ID=your-client-id - AUTH0_CLIENT_SECRET=your-client-secret - ``` - -After enabling authentication, users will need to sign in to access the application. From 50ac0ebec7d8d91e4074ccd0eb639e8d4800de06 Mon Sep 17 00:00:00 2001 From: arkml Date: Mon, 7 Apr 2025 16:49:47 +0530 Subject: [PATCH 03/30] Update README.md --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5f8e8926..6752de66 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,41 @@ ![ui](/assets/banner.png) -

Let AI build multi-agents with MCP for you

+

Let AI build multi-agent workflows for you in minutes

[Quickstart](#quick-start) | [Docs](https://docs.rowboatlabs.com/) | [Website](https://www.rowboatlabs.com/) | [Discord](https://discord.gg/jHhUKkKHn8)
-Build multi-agents in minutes with Rowboat: -- โœจ Start from an Idea -> AI plans and builds the multi-agent system for you +- โœจ **Start from an idea -> copilot builds your multi-agent workflows** - E.g. "Build me an assistant for a food delivery company to handle delivery status and missing items. Include the necessary tools." -- ๐ŸŒ Connect MCP servers +- ๐ŸŒ **Connect MCP servers** - Add the MCP servers in settings -> import the tools into Rowboat. -- ๐Ÿ“ž Integrate into your app using the HTTP API +- ๐Ÿ“ž **Integrate into your app using the HTTP API** - Grab the project ID and generated API key from settings and use the API. -Built with OpenAI's Agents SDK, Rowboat is the fastest way to build multi-agents! +Powered by OpenAI's Agents SDK, Rowboat is the fastest way to build multi-agents! ## Quick start - -1. **Clone the Repository and start Rowboat docker** +1. Set your OpenAI key + ```bash + export OPENAI_API_KEY=your-openai-api-key + ``` + +2. Clone the repository and start Rowboat docker ```bash git clone git@github.com:rowboatlabs/rowboat.git cd rowboat docker-compose up --build ``` +3. Access the app at [http://localhost:3000](http://localhost:3000). -4. **Access the App** - - Visit [http://localhost:3000](http://localhost:3000). +## Demo ![ui](/assets/ui_revamp_screenshot.png) -## Integrate Rowboat to your app with the HTTP API +## Integrate with the Rowboat HTTP API You can use the API directly at [http://localhost:3000/api/v1/](http://localhost:3000/api/v1/) - Project ID is available in the URL of the project page From 01f16a11d34222b2d8cf943b352cfc0f53c88056 Mon Sep 17 00:00:00 2001 From: akhisud3195 Date: Mon, 7 Apr 2025 16:42:03 +0530 Subject: [PATCH 04/30] Add feature flags for use multiple projects and display project page accordingly Update project new page style --- apps/rowboat/app/lib/feature_flags.ts | 8 +- .../projects/[projectId]/playground/app.tsx | 37 ++-- apps/rowboat/app/projects/select/app.tsx | 198 ++++++++++-------- .../select/components/submit-button.tsx | 2 +- 4 files changed, 143 insertions(+), 102 deletions(-) diff --git a/apps/rowboat/app/lib/feature_flags.ts b/apps/rowboat/app/lib/feature_flags.ts index 37c83deb..d388e9fa 100644 --- a/apps/rowboat/app/lib/feature_flags.ts +++ b/apps/rowboat/app/lib/feature_flags.ts @@ -2,4 +2,10 @@ export const USE_RAG = process.env.USE_RAG === 'true'; export const USE_RAG_UPLOADS = process.env.USE_RAG_UPLOADS === 'true'; export const USE_RAG_SCRAPING = process.env.USE_RAG_SCRAPING === 'true'; export const USE_CHAT_WIDGET = process.env.USE_CHAT_WIDGET === 'true'; -export const USE_AUTH = process.env.USE_AUTH === 'true'; \ No newline at end of file +export const USE_AUTH = process.env.USE_AUTH === 'true'; + +// export const USE_MULTIPLE_PROJECTS = true; +export const USE_MULTIPLE_PROJECTS = false; + +export const USE_TESTING_FEATURE = false; +export const USE_VOICE_FEATURE = false; \ No newline at end of file diff --git a/apps/rowboat/app/projects/[projectId]/playground/app.tsx b/apps/rowboat/app/projects/[projectId]/playground/app.tsx index 3eb62053..320e6029 100644 --- a/apps/rowboat/app/projects/[projectId]/playground/app.tsx +++ b/apps/rowboat/app/projects/[projectId]/playground/app.tsx @@ -11,6 +11,7 @@ import { TestProfile } from "@/app/lib/types/testing_types"; import { WithStringId } from "@/app/lib/types/types"; import { ProfileSelector } from "@/app/projects/[projectId]/test/[[...slug]]/components/selectors/profile-selector"; import { CheckIcon, CopyIcon, PlusIcon, UserIcon } from "lucide-react"; +import { USE_TESTING_FEATURE } from "@/app/lib/feature_flags"; const defaultSystemMessage = ''; @@ -103,15 +104,17 @@ export function App({ } rightActions={
- + {USE_TESTING_FEATURE && ( + + )}