algopian/chromeclaw
Acerca de
Your own personal AI assistant in Chrome/Firefox. π¦
IA y aprendizaje automΓ‘ticoWhat you can do
- Multi-provider LLM support β OpenAI, Anthropic, Google, OpenRouter, custom endpoints
- Streaming responses β Real-time text and reasoning deltas with markdown rendering
- Messaging channels β WhatsApp (Baileys WebSocket client) and Telegram (Bot API long-polling) via offscreen document
- Voice β TTS (Kokoro local ONNX + OpenAI cloud), STT (Whisper local via Transformers.js + OpenAI cloud)
Crecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +2
- in 1 month
- Recopilando historial
Cambios netos en perΓodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interΓ©s, no calidad.
README.md
OriginalChromeClaw
A lightweight OpenClaw-inspired AI agent running entirely in the Chrome browser sandbox β with multi-provider LLM support, messaging channels (WhatsApp, Telegram), voice (TTS/STT), memory, agents, and browser automation.
Overview
ChromeClaw brings the capabilities of a full AI agent platform into a Chrome extension that is super easy to install and set up β just load the extension, add an API key, and start chatting. No server, no Docker, no CLI. Protected by the modern browser sandbox and inspired by the OpenClaw project, it delivers a lightweight, self-contained alternative that runs entirely in the browser's side panel. It supports multiple LLM providers (OpenAI, Anthropic, Google, OpenRouter, and any OpenAI-compatible endpoint) using your own API keys. Beyond chat, it connects to WhatsApp and Telegram as messaging channels, speaks and listens via local or cloud TTS/STT, and remembers context across sessions with a hybrid memory system.
Features
- Multi-provider LLM support β OpenAI, Anthropic, Google, OpenRouter, custom endpoints
- Streaming responses β Real-time text and reasoning deltas with markdown rendering
- Messaging channels β WhatsApp (Baileys WebSocket client) and Telegram (Bot API long-polling) via offscreen document
- Voice β TTS (Kokoro local ONNX + OpenAI cloud), STT (Whisper local via Transformers.js + OpenAI cloud)
- Memory system β BM25 full-text search + optional vector embeddings with MMR re-ranking and temporal decay
- Multi-agent system β Named agents with per-agent models, tools, workspace files, and custom JS tools
- Tool calling β 25+ built-in tools including web search, documents, browser automation, Google services, and more
- Google integration β Gmail, Calendar, Drive tools via OAuth (
chrome.identity) - Deep research β Multi-step autonomous research with parallel search, fetch, and synthesize phases
- Browser automation β Chrome DevTools Protocol with DOM snapshots, click/type, screenshots, JS evaluation
- Local LLM β On-device inference via Transformers.js (WebGPU/WASM)
- Cron/scheduler β Alarm-based one-shot, interval, and cron-expression tasks with optional channel delivery
- Custom tools β Register workspace JS files as callable LLM tools with
@toolmetadata comments - Context compaction β Sliding-window + LLM summarization when approaching token limits; adaptive multi-part summarization for very long histories
- Session journaling β Auto-converts chat transcripts to durable memory entries on session end
- Artifacts β Create and view text, code, spreadsheets, and images
- Chat history β Persistent IndexedDB storage with search, date grouping, and auto-titling
- Reasoning display β Collapsible thinking/reasoning output for supported models
- Workspace files β Attach AGENTS.md, SOUL.md, USER.md, IDENTITY.md, TOOLS.md, MEMORY.md, and custom files as persistent LLM context
- Skills system β Configurable prompt templates with variable substitution
- Firefox support β Cross-browser builds via a single flag
Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Chrome Extension (Manifest V3, React + Vite + TypeScript + Tailwind) β
β β
β ββββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββββββ β
β β Side Panel β β Full-Page Chat β β Options β β
β β - Chat UI + Streamingβ β - Chat UI β β - Model config β β
β β - Artifacts β β - Options β β - Tool management β β
β β - Chat history β β β β - Channel setup β β
β β - Voice input/output β β β β - Agent management β β
β ββββββββββββ¬ββββββββββββ ββββββββββ¬ββββββββββ βββββββββββ¬ββββββββββββ β
β β chrome.runtime.Port / sendMessage β β
β ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Background Service Worker β β
β β β β
β β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββ βββββββββββββββ β β
β β β Agent β β Tools β β Memory β β Cron β β Channels β β β
β β β System β β (25+) β β (BM25 + β β Sched- β β Registry β β β
β β β β β β β vectors)β β uler β β β β β
β β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ βββββ¬βββββ ββββββββ¬βββββββ β β
β β β β β β β β β
β β βββββββββββββββ΄βββββββββββββ΄ββββββββββββ΄ββββββββββββββ β β
β β β β β
β β ββββββββββββββββββββββ΄βββββββββββββββββββββ β β
β β β Provider Factory + Context Compaction β β β
β β β pi-mono streamSimple() / Local LLM β β β
β β ββββββββββββββββββββββ¬βββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββ β
β β Offscreen Document (persistent) β β
β β β β β
β β ββββββββββββββ βββββββββββ΄βββ ββββββββββββ ββββββββββββββββββββββ β β
β β β WhatsApp β β Telegram β β Kokoro β β Whisper STT / β β β
β β β Worker β β Worker β β TTS β β Local LLM Worker β β β
β β β (Baileys) β β (Bot API) β β Worker β β (Transformers.js) β β β
β β βββββββ¬βββββββ βββββββ¬βββββββ ββββββ¬ββββββ βββββββββββ¬βββββββββββ β β
β ββββββββββΌββββββββββββββββΌββββββββββββββΌββββββββββββββββββΌββββββββββββββ β
β β β β β β
βββββββββββββΌββββββββββββββββΌββββββββββββββΌββββββββββββββββββΌβββββββββββββββββ
β β β β
βΌ βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββ ββββββββββββ ββββββββββββββββββββ
β WhatsApp β β Telegram β β Audio β β On-device β
β (WebSocket) β β Bot API β β Output β β Inference β
ββββββββββββββββ ββββββββββββββ ββββββββββββ ββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
β External Services β
β β
β ββββββββββββββββββ β
β β LLM Providers β β
β β - OpenAI β β
β β - Anthropic β β
β β - Google β β
β β - OpenRouter β β
β β - Custom β β
β ββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Storage:
chrome.storage (local/session) ββ settings, tool configs
IndexedDB (Dexie.js) ββ chats, messages, artifacts, agents, models,
workspaceFiles, memoryChunks, scheduledTasks,
taskRunLogs, embeddingCache
Tech Stack
| Category | Technology |
|---|---|
| UI | React 19, TypeScript, Tailwind CSS, shadcn/ui, Radix UI, Lucide icons, Framer Motion |
| AI/LLM & Agents | pi-mono (@mariozechner/pi-ai, @mariozechner/pi-agent-core) |
| AI/ML (local) | Transformers.js (local inference, embeddings, Whisper STT), ONNX Runtime Web (WebGPU/WASM) |
| Channels | Baileys 6.x (WhatsApp WebSocket client), Telegram Bot API (direct HTTP long-polling) |
| Voice | Kokoro-JS + Kokoro-82M ONNX (local TTS), OpenAI TTS API, Whisper ONNX (local STT) |
| Storage | Dexie.js 4 (IndexedDB), Chrome Storage API |
| Auth | Google OAuth (chrome.identity) |
| Build | Vite 6, Turborepo, pnpm workspaces |
| Testing | Vitest, Playwright |
| Code Quality | ESLint (flat config), Prettier, TypeScript strict mode |
Getting Started
Prerequisites
- Node.js β₯ 22.15.1
- pnpm 10.x
Install & Build
pnpm install
pnpm build
Install from Chrome Web Store
Install ChromeClaw directly from the Chrome Web Store β no build step required.
Install from Firefox Add-ons
Install ChromeClaw for Firefox from Mozilla Add-ons β no build step required.
Load from Source
- Open
chrome://extensions - Enable Developer mode (top-right toggle)
- Click Load unpacked
- Select the
dist/directory - Open any page and click the ChromeClaw icon to open the side panel
First Run
No login required. Open the Options page, add your API key for any supported provider, select a model, and start chatting.
Project Structure
chrome-extension/ # Background service worker
β βββ src/background/
β βββ index.ts # Main background entry
β βββ local-llm-bridge.ts # Local model IPC bridge
β βββ agents/ # Agent system (loop, setup, model adapter, streaming)
β βββ channels/ # Channel registry + adapters (WhatsApp, Telegram)
β βββ context/ # Context compaction + summarization
β βββ cron/ # Scheduler service (alarms, executor, store)
β βββ errors/ # Error handling
β βββ logging/ # Logging utilities
β βββ media-understanding/ # Speech-to-text, media transcription
β βββ memory/ # Memory system (BM25, embeddings, MMR, journaling)
β βββ tts/ # TTS engine routing (Kokoro bridge, OpenAI)
β βββ tools/ # All tool implementations
pages/ # Extension UI pages
βββ side-panel/ # Primary chat interface
βββ full-page-chat/ # Full-page chat (push sidebar mode)
βββ options/ # Settings & configuration
βββ offscreen-channels/ # Offscreen document β WhatsApp, Telegram,
# Kokoro TTS, Whisper STT, local LLM workers
packages/ # Shared monorepo packages
βββ baileys/ # Bundled Baileys fork (WhatsApp Web client)
βββ config-panels/ # Options page tab panels and tab group definitions
βββ shared/ # Types, hooks, prompts, env config
βββ skills/ # Skill template loading and parsing
βββ storage/ # Chrome storage + IndexedDB (Dexie.js)
βββ ui/ # shadcn/ui components
βββ env/ # Build-time environment variables
βββ i18n/ # Internationalization
βββ ... # hmr, vite-config, tailwindcss-config, etc.
tests/ # E2E test suites (Playwright)
package.json
turbo.json
pnpm-workspace.yaml
Development
Watch Mode
pnpm dev
This cleans the dist/ folder, builds all packages, then starts Vite in watch mode via Turborepo. After loading the extension once, changes are picked up automatically (reload the extension page to apply).
Code Quality
pnpm lint # ESLint
pnpm format:check # Prettier check
pnpm type-check # TypeScript
pnpm test # Vitest unit tests
pnpm quality # All of the above
E2E Tests
pnpm build && pnpm test:e2e # Build, then run Playwright tests (Chrome)
Firefox Build
pnpm build:firefox
Configuration
Model Management
Add your API key and base URL on the Options page. Supported providers: OpenAI, Anthropic, Google, OpenRouter, and any OpenAI-compatible endpoint.
Local models β Select a Transformers.js-compatible model for on-device inference via WebGPU or WASM. No API key required.
Workspace Files
Workspace files provide persistent context to every conversation:
AGENTS.mdβ Agent behavior instructionsSOUL.mdβ Personality and toneUSER.mdβ User-specific contextIDENTITY.mdβ Agent identityTOOLS.mdβ Tool usage guidanceMEMORY.mdβ Auto-curated memory summary- Custom files via the workspace tool configuration
Skills
Skills are reusable prompt templates with variable substitution ({{variable}}). Configure them on the Options page under the Skills tab. Skills appear as quick actions in the chat input.
Suggested Actions
Configurable quick-action buttons shown below the chat input. Managed on the Options page.
Channels
ChromeClaw can send and receive messages on WhatsApp and Telegram. Channel workers run in a persistent offscreen document; inbound messages are routed through the agent system and replies are sent back via the same channel.
- Connection: QR code pairing via Baileys WebSocket client
- Auth storage: Credentials persisted in
chrome.storage.local - Sender control:
allowedSenderIdsallowlist,acceptFromMe/acceptFromOthersflags - Voice messages: Inbound audio is decrypted and transcribed via STT; outbound TTS replies are sent as PTT voice messages
- Message limits: Long messages are auto-split at 4096 characters
Telegram
- Connection: Bot token with HTTP long-polling (25s poll timeout)
- Sender control:
allowedSenderIdsallowlist
Both channels are configured on the Options page under the Channels section.
Tools
Configured on the Options page under the Tools tab. Tools can be enabled/disabled globally and overridden per agent.
| Tool | Description |
|---|---|
| Web Search | Brave Search API (requires API key) |
| Fetch URL | Retrieve and extract content from web pages |
| Create Document | Create text, code, spreadsheet, and image artifacts |
| Browser | Chrome DevTools Protocol β DOM snapshots, click/type, screenshots, JS eval, console/network logs |
| Read / Write / Edit / List | Workspace file operations |
| Memory Search | BM25 + vector search over memory chunks |
| Memory Get | Retrieve a specific memory entry |
| Deep Research | Multi-step autonomous research with parallel search and synthesis |
| Agent Manager | List, create, remove, and switch between named agents |
| Scheduler | Create one-shot, interval, and cron-expression tasks |
| Execute JavaScript | Run JS in a sandboxed tab; register custom tool files |
| Gmail | Search, read, send, and draft emails (OAuth) |
| Calendar | List, create, update, and delete events (OAuth) |
| Drive | Search, read, and create files (OAuth) |
| Custom JS tools | Workspace files with @tool metadata, registered per agent |
Voice
Text-to-Speech (TTS)
| Engine | Description |
|---|---|
| Kokoro (local) | On-device synthesis via Kokoro-82M ONNX model. Supports streaming (per-sentence) and batched modes. Configurable voice and speed. |
| OpenAI (cloud) | OpenAI /audio/speech endpoint with Opus output. Works with any OpenAI-compatible TTS API. |
Speech-to-Text (STT)
| Engine | Description |
|---|---|
| Whisper (local) | On-device transcription via Whisper ONNX models (tiny/base/small). Audio resampled to 16kHz mono PCM. Supports language selection. |
Auto-mode
TTS auto-mode controls when responses are spoken aloud:
offβ TTS disabledalwaysβ Every response is spokeninboundβ Only speak responses triggered by voice input or channel messages
Memory
The memory system provides long-term context recall across sessions.
Search
- BM25 full-text search over workspace file chunks (always available)
- Optional vector embeddings via OpenAI-compatible API for semantic search
- Hybrid ranking combines BM25 and vector scores with configurable weights
Ranking
- MMR re-ranking (Maximal Marginal Relevance) β reduces redundancy by balancing relevance against diversity (configurable lambda, default 0.7)
- Temporal decay β exponential decay with configurable half-life (default 30 days). Dated entries (
memory/YYYY-MM-DD.md) decay; evergreen files (MEMORY.md) do not
Session Journaling
When the user switches chats, the LLM extracts durable memories from the conversation transcript and:
- Appends dated entries to
memory/YYYY-MM-DD.md - Curates the
MEMORY.mdsummary (max 4000 chars) - Deduplicates against existing memories before writing
Environment Variables
Set in .env (copied from .example.env on install):
| Variable | Description |
|---|---|
CEB_GOOGLE_CLIENT_ID |
Google OAuth2 client ID (for Gmail/Calendar/Drive tools) |
CEB_ENABLE_WEBGPU_MODELS |
Enable WebGPU local models (false by default) |
CEB_DEV_LOCALE |
Force locale for development |
CEB_CI |
CI mode flag |
CLI flags (set on the command line):
| Variable | Description |
|---|---|
CLI_CEB_DEV |
Enable development mode (set automatically by pnpm dev) |
CLI_CEB_FIREFOX |
Build for Firefox (set automatically by pnpm build:firefox) |
Known Limitations
- MV3 service worker idle β The background service worker may be terminated after 30s of inactivity; long-running streams use keep-alive mechanisms
- Local LLM performance β On-device inference speed depends on hardware
- WhatsApp connection β Requires a persistent offscreen document to maintain the Baileys WebSocket connection; Chrome may reclaim the offscreen document under memory pressure
License
MIT β see LICENSE.
Acknowledgements
- pi-mono (
@mariozechner/pi-ai+@mariozechner/pi-agent-core) β Multi-provider LLM streaming and tool-calling core by Mario Zechner. - Baileys (
packages/baileys/) β TypeScript/JavaScript API for WhatsApp Web by WhiskeySockets. Licensed under the MIT License. - Vercel AI Chatbot β Chat UI components and patterns. Licensed under the Apache License 2.0.
- Chrome Extension Boilerplate React Vite β Extension scaffolding with React, Vite, and Turborepo by nicedreamdo. Licensed under the MIT License.
- OpenClaw β Open-source AI agent platform that inspired ChromeClaw's architecture and capabilities.
Star History
Explorar proyectos relacionados
Cargandoβ¦