Skip to content

ClawReg/clawreg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClawReg Logo

@clawreg/core

The ultimate open-source gateway for AI Agents. Build, host, and route your agents across WhatsApp, Telegram, Discord, and more with ease. This specification is part of the ClawReg Core Library ecosystem. Visit docs.clawreg.fun for updates.

NPM Version License: MIT Visit docs.clawreg.fun for full documentation.

🚀 Key Features

  • Self-hosted: Your hardware, your rules. Complete privacy and control.
  • Multi-channel: One SDK to rule them all. Route messages from WhatsApp, Telegram, Discord, or custom bridges.
  • Agent-Native: Built-in support for tool-calling, long-term memory, and session management.
  • CLI Wizard: Powerful onboarding tools to get your gateway running in seconds.

📦 Installation

npm install @clawreg/core

🏎️ Quick Start

Create a simple bot that echoes messages on WhatsApp:

import { ClawRegClient, WhatsAppProvider } from '@clawreg/core';

const client = new ClawRegClient();

// Connect WhatsApp
const wa = new WhatsAppProvider({ phoneNumber: '123456789' });
client.registerProvider(wa);

// Handle incoming messages
client.onMessage(async (msg) => {
  console.log(`[${msg.channel}] Message from ${msg.sender}: ${msg.text}`);
  await client.send(msg.sender, `You said: ${msg.text}`, msg.channel);
});

await wa.initialize();

🧠 Advanced Usage (Tools & Routing)

ClawReg shines when managing complex AI agents with specialized tools.

import { 
  ClawRegClient, 
  MessageRouter, 
  AIAgent, 
  WhatsAppProvider, 
  DiscordProvider,
  FileSystemTool 
} from '@clawreg/core';

// 1. Initialize Client & Router
const client = new ClawRegClient();
const router = new MessageRouter();

// 2. Define an AI Agent with recursive tool-calling capabilities
const devAgent = new AIAgent("Developer", "You are an assistant with access to the file system.");
devAgent.registerTool(FileSystemTool);

// 3. Setup Intelligent Routing
router.registerRoute(/dev|code|fix/i, devAgent);

// 4. Connect Multiple Channels
client.registerProvider(new WhatsAppProvider({ phoneNumber: '+15555550123' }));
client.registerProvider(new DiscordProvider({ botToken: 'YOUR_DISCORD_TOKEN' }));

// 5. Unified Message Handling
client.onMessage(async (msg) => {
  const result = await router.handle(msg);
  if (result) {
    await client.send(msg.sender, result.text, msg.channel);
  }
});

🛠️ CLI Tooling

ClawReg comes with a built-in CLI for configuration and daemon management.

# Start the onboarding wizard
npx clawreg onboard --install-daemon

# Run the gateway server
npx clawreg serve

🗺️ Architecture Overview

graph TD
    User((User)) --> WhatsApp[WhatsApp Provider]
    User((User)) --> Discord[Discord Provider]
    WhatsApp --> Router{Message Router}
    Discord --> Router
    Router --> SupportAgent[Support Agent]
    Router --> DevAgent[Dev Agent]
    DevAgent --> FSTool[File System Tool]
    DevAgent --> WebTool[Web Search Tool]
Loading

🏗️ Core Modules

Module Description
Providers Specialized adapters that normalize platform-specific data into a standard AgentMessage.
Router Central steering engine that maintains sessions and routes messages to the right agent.
Agents The "brains" - ranging from simple Echo agents to advanced Tool-using AI agents.
Tools/Skills A standardized plugin system for autonomous capabilities. See SKILL.md.

🤝 Contributing

We love contributions! Please read our Contribution Guide to get started.

📄 License

ClawReg is MIT licensed. See the LICENSE file for more information.


Built with ❤️ for the Agentic Future by the ClawReg Team.

About

The ultimate open-source gateway for AI agents. Build, host, and route your agents across WhatsApp, Telegram, Discord, and more with ease.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors