OpenClaw Full Tutorial: Zero to Ready in 1 Hour
Open Claw: Building a Multi-Agent System from Scratch
Introduction to Open Claw
- Open Claw is a powerful yet misunderstood tool; many users struggle with setup rather than building effective systems.
- The video aims to provide a comprehensive guide on installing and configuring Open Claw, addressing common setup issues.
Video Structure Overview
- The tutorial will cover installation, configuration in Slack, memory setup (native memory, QMD, lossless cloth), and building a multi-agent system.
- The presenter emphasizes practical experience over theoretical documentation, sharing insights from personal projects.
Detailed Breakdown of the Tutorial
Part 1: Setup
- Installation and configuration of Open Claw will be demonstrated on a Mac Mini.
- Viewers will learn about navigating file structures and configurations necessary for effective use.
Part 2: Memory Configuration
- Two types of memory setups will be explored: native memory and enhanced options like QMD and lossless cloth for better context retention.
Part 3: Building the Multi-Agent System
- A real-world use case will illustrate how agents can work together autonomously through roles and task delegation.
Practical Application of Open Claw
- The tutorial includes setting up an orchestrator agent that manages sub-agents (CTO agent, back-end agent, iOS/front-end agent, QA agent).
- Each sub-agent performs long-running tasks using route loops to ensure efficiency without constant user intervention.
Installation Process Overview
Visual Studio Code Installation
- Visual Studio Code is recommended as an IDE for managing files effectively during the project setup.
Installing Open Claw
- Instructions are provided for downloading Open Claw safely from its official site to avoid counterfeit versions.
Initial Setup Steps
- After installation via terminal commands, security settings must be configured correctly for optimal performance.
Setting Up Open Claw
Initial Setup with Opus Model
- The speaker emphasizes using the Opus model for setting up Open Claw due to its capabilities, despite being expensive.
- The process begins by selecting the Anthropic API key and choosing the Opus 46 model.
Configuring Slack Integration
- The speaker details creating a Slack app named "Open Claw bot" and selecting the appropriate workspace.
- Necessary permissions are set, including chat write, mentions read, and channel history.
- After installing the app in the workspace, the bot token is copied for further configuration.
App Token Generation
- An app token is generated by navigating to basic information and adding necessary scopes like connections write.
- The speaker highlights enabling socket mode and event subscriptions for better functionality within Slack.
Finalizing Slack Configuration
- Bot events such as message.im are enabled to allow interaction through direct messages on Slack.
- Reinstallation of the app in Open Claw workspace is confirmed after making changes to OAuth permissions.
Integrating Search Providers
Setting Up Brave Search
- Brave search is selected as a search provider; an API key is created and pasted into the setup interface.
Exploring Additional Skills
- Various skills options are mentioned but deemed unnecessary at this stage, including Google Places API and Notion API keys.
Agent Configuration Process
Enabling Voice Capabilities
- Mention of 11 Labs integration allows agents to have voice capabilities but is skipped for now.
Restarting Gateway Service
- A restart of the gateway service is performed; users may see different prompts based on their setup status.
Creating Your Agent
Defining Agent Identity
- Users are prompted to define their agent's identity; specifics about its role can be adjusted later in configuration files.
Finalizing Agent Setup
- The agent named "Max," designed to assist with content creation related to Open Claw demos, is established successfully.
Navigating File Structure
Understanding Folder Organization
- A walkthrough of Open Claw's file structure begins, emphasizing how folders are organized and managed.
Open Claw Setup and Configuration
Exploring Open Claw Folder Structure
- The hidden folders can be accessed by using the command
command + shift + period, revealing the.Open Clawfolder, which contains all relevant files for Open Claw including agents, crons, identity logs, and workspace.
- Opening the folder in Visual Studio Code (VS Code) simplifies navigation through these directories. Users are prompted to trust authors when opening files.
Understanding Key Files in Open Claw
- Within the workspace, important folders include agent sessions that log activity during runtime and a core infrastructure for the Open Claw agent.
- The
Open Claw.jsonfile holds critical configurations such as models and memory infrastructure necessary for operation. Users should familiarize themselves with this file despite infrequent edits.
Caution When Editing Configurations
- Care must be taken while editing
Open Claw.json; minor errors like missing brackets or colons can cause failures in agent functionality. VS Code provides error notifications to assist users.
- Backup files exist but should not be solely relied upon; caution is advised when making changes.
Setting Up Workspace for Git Integration
- A new window is opened in VS Code to access specific workspaces rather than the entire setup. This is where users will push updates to GitHub.
- Important markdown files include
agents.md, which contains system prompts essential for agent requests, andidentity.md, detailing user information.
Finalizing Slack Integration
- To complete Slack integration, users need to configure their Slack application settings by adding their user ID into the channels object within their configuration file.
- Pairing approval requires pasting a code from Slack into the configuration after initiating an approval request via commands.
Testing Slack Functionality
- After setting up pairing codes and restarting gateways, testing confirms successful communication between Slack and Open Claw agents.
- Documentation on full setup processes is available through community resources for further guidance on functionalities like memory setup.
Implementing QMD and Lossless Claw for Enhanced Memory Systems
Setting Up Local Core Memory
- The process begins with setting up local core memory, which will be enhanced using QMD (Quantum Memory Design) and a new plugin called lossless claw from Open Claw.
- It is noted that Anthropic does not support memory embeddings in Open Claw, necessitating the use of an API key for memory functionality.
Configuring OpenAI API
- The configuration involves accessing the OpenAI API by entering the appropriate API key to enable memory embeddings.
- A smaller model, such as 4040 mini, is selected for testing purposes after successfully setting up the OpenAI API.
Establishing Memory Structure
- After configuring the API, a workspace folder is created containing a memory folder with daily notes and a
memory.mdfile.
- The next step involves setting up QMD to strengthen the backend of the memory system.
Installing QMD
- QMD is described as an advanced memory system; documentation exists explaining its differences from native memory systems.
- Instead of following standard installation procedures, a GitHub link for QMD is used to facilitate direct integration into Open Claw.
Testing and Configuring QMD
- Upon installation, tests confirm that QMD operates significantly better than built-in options. Configuration changes are made to set it as the primary memory backend.
- The
openclaw.jsonfile reflects these changes by indicating that the memory backend has been switched to QMD.
Integrating Lossless Claw
- Lossless claw is introduced as a recommended plugin by Peter Steinberger. Similar installation methods are applied using its GitHub link.
- Key configurations include using Claude high-quality models for summarization while ensuring old messages are retained through DAG structures instead of being lost when context windows fill.
Finalizing Setup
- With lossless claw installed, every message remains accessible in SQLite. Tools like LCM grep allow users to retrieve compacted information effectively.
- A missing context engine slot was identified; this slot assignment ensures proper routing through LCM rather than relying on built-in compaction methods.
Conclusion of Setup Process
- With both plugins configured correctly—lossless claw for context management and QMD as the backend—the setup appears complete. A confirmation shows that each agent now has dedicated indexed memories established in their respective directories.
Memory Management and Multi-Agent System Development
Saving Relevant Information
- The speaker emphasizes the importance of saving relevant information to memory periodically, ensuring a detailed daily log of activities such as QMD installation and configuration, LCM installation, and lessons learned regarding slot assignments.
- A curated long-term record is created that includes setup details, key decisions, and lessons learned for future reference.
Memory Architecture Insights
- The speaker invites viewers to join a free school community for more information on memory architecture and its functionalities.
- Discussion transitions into building a multi-agent system involving sub-agents, multi-agents, Ralph loops, long-running tasks, and PRDs (Product Requirement Documents).
Setting Up the CTO Agent
- Introduction of the CTO agent designed to draft PRDs; it will delegate tasks to an orchestrator agent responsible for managing backend and frontend agents.
- Each task will utilize Ralph loops to create new sub-agents for efficient task management.
Creating the Agent Workspace
- Instructions are provided on creating a new terminal window to set up the CTO agent workspace using specific commands.
- Configuration steps include copying authentication profiles from the main agent and setting up model authentication with an API key.
Interacting with the CTO Agent
- Confirmation that the CTO agent is ready; users can interact through a command interface.
- The speaker prepares a system prompt defining the role of the CTO agent in developing app ideas into complete PRDs while emphasizing its limitations in coding or deployment.
Drafting Product Requirement Documents
- The CTO agent is instructed to ask clarifying questions about vague ideas before drafting PRDs based on templates provided in documentation.
- Clear guidelines are established for what tasks fall within the scope of the CTO's responsibilities—planning, delegating, tracking progress without writing code directly.
Creating Sub-Agents in the CTO Workspace
Initial Setup of the Workspace
- The workspace for projects has been established, including a folder for documents and templates, such as a PRD template.
- The speaker decides to let Open Claw create sub-agents instead of doing it manually, starting with the orchestrator.
Orchestrator Configuration
- An attempt is made to set up the orchestrator as a separate workspace, which is corrected to be a sub-agent within the CTO workspace.
- The orchestrator agent is deleted after realizing it was incorrectly created as a top-level agent.
Creation of Sub-Agent Files
- A sub-agents file is being created in real-time, showcasing its system prompt and initial configurations.
- There’s an acknowledgment that some configurations need adjustments; specifically, changing iOS references to front-end functionality.
Backend Agent Development
- Instructions are provided for creating backend functionality using Supabase rather than Convex, emphasizing responsibilities like authentication and business logic implementation.
- Clarification is made that the previously mentioned iOS agent should actually be categorized as a front-end agent.
Frontend and QA Agent Specifications
- The front-end system prompt outlines requirements for building screens and navigation while ensuring responsiveness and testing protocols are followed.
- The QA agent's role includes verifying compliance with PRD standards, running tests, checking security issues, and reporting results back to the orchestrator.
Finalizing Agent Pipeline
- Discussion on how all agents will interact within the CTO workspace pipeline once approved by PRD.
- Mention of needing a deployment agent for app deployment processes post-completion.
Model Routing Considerations
- Plans are made to optimize resource usage by routing sub-agents through Sonnet instead of keeping them on Opus due to power needs.
- Updates are proposed for specifying models when spawning agents and documenting these conventions clearly in agents.md.
Setting Up Deployment Agents and API Keys
Configuring Deployment Agents
- The model header comment was added for self-documentation, clarifying which model each agent is intended to run on.
- All five agents—Orchestrator, Back End, Front End, QA, and Deployment—are now configured to use the Sonnet model.
Setting Up API Keys
- Three API keys for Supabase and one for Vercel are required for the setup; Supabase will serve as the database for data storage.
- The process begins with exporting the Supabase API key using a command format:
export Supabase_API_key=<your_api_key>.
- An environment object in
openclaw.jsonwill be created to store these variables securely without hardcoding sensitive information.
Updating PRD Template
- The PRD (Product Requirements Document) template is being updated to provide more specific guidelines on what it should create.
- The new template includes detailed sections such as hard rules, content tone, deployment instructions for back end and front end agents, design system details, and global components.
Communicating with Open Claw Agent
- A conversation with the Open Claw agent's CTO confirms that the new PRD template can be adapted based on project needs (website vs. app dashboard).
- It’s established that while this is a universal PRD format, specific tasks can still be tailored according to different project types.
Implementing Ralph Loops
- Each task in the PRD will have checkboxes linked to Ralph loops that track completion status directly within the document.
- Ralph state files (
ralph.md) will monitor agent levels instead of being separate summaries; this integration aims at better tracking of progress.
Building a New PRD
Generating Application-Specific PRDs
- A prompt is prepared for building a new PRD focused on an internal tool rather than a sales demo.
- Key considerations include whether real data or simulated responses are used and ensuring password protection for security purposes.
Finalizing Architecture Decisions
- The generated PRD outlines essential features like server-side only calls to Anthropic API and real-time metrics through Superbase.
Addressing Open Questions Before Approval
- Clarifications needed include access roles (full access recommended), live integrations versus managed status in Superbase, and domain usage preferences.
Orchestrator Development and Application Deployment
Overview of the Orchestrator's Functionality
- The orchestrator is currently running, managing data connections and development processes with full access for all team members.
- Progress tracking occurs live in the task document (PRD.md), allowing real-time updates on build status and task completion.
Current PRD Insights
- The current PRD outlines specific backend sections, including Superbase schemas, edge functions, deployment environments, security measures, and front-end design systems.
- As of now, the build status shows that backend work is ongoing while frontend and QA tasks are pending.
Application Deployment Status
- The application has been successfully deployed to Vercel with user credentials set up. It includes eight tables with RLS triggers and real-time metrics enabled.
- Out of 212 tasks in total, 195 have been completed (92%), with 17 non-blocking items deferred to a future version (V2).
User Experience and Application Features
- Users can see marked-off tasks as they are completed during the build process. The application features various charts for CPU/memory usage and system events.
- Some APIs like data connections are not fully configured yet but will be functional once set up.
Importance of Detailed PRDs
- Utilizing a detailed PRD allows for more complex applications to be built effectively by specifying exact steps rather than relying on vague prompts.
Finalization of Tasks
- All tasks have been completed successfully; users can now explore the fully wired multi-agent system that has been established.
Building Beyond Basics
- Emphasizes that what was built serves as a foundation; advanced systems require additional layers for effective operation in personal or business contexts.
Community Support for Development Challenges
- Highlights the importance of community support in overcoming challenges faced during development. Access to guides, blueprints, and direct assistance from experienced users is available within the community.