Skip to content

omer-here/tiny-openclaw

Repository files navigation

Tiny-OpenClaw Hero

Tiny-OpenClaw 🦞

A Lightweight, Production-Ready, Agentic AI Runtime


📖 Overview

Tiny-OpenClaw is a highly extensible, asynchronous agentic AI framework designed to interact seamlessly via Telegram. Built around the powerful ReAct (Reasoning + Acting) paradigm, it acts as a robust runtime for Large Language Models (LLMs), giving them the ability to use custom tools, access long-term memory, and maintain session context across interactions.

This project was developed with a focus on scalability, reliability, and extensibility, serving as a blueprint for production-grade AI agents.


🏗️ Architecture & Engineering Decisions

Tiny-OpenClaw is architected for high performance and clean separation of concerns.

1. The ReAct Loop Engine (agent_runtime.py)

At its core, the system utilizes a custom ReAct loop that interfaces with the Anthropic API (Claude Opus). Instead of static query-response pipelines, the agent can:

  • Reason about the user's request.
  • Act by invoking one or multiple loaded skills (tools).
  • Observe the output and recursively iterate until the goal is met.

2. High-Performance Memory & State Management (Redis)

  • Challenge: Initially, session histories and long-term user memories were persisted using local JSON files, which presented significant bottlenecks for concurrent access and horizontal scaling.
  • Solution: I introduced Redis as the central data store for both Memory (memory_store.py) and SessionManager (session_manager.py).
  • Impact: This transition eliminated file I/O locks, enabled atomic operations, and decoupled state from the application runtime, paving the way for multi-instance deployments.

3. Dynamic Skill Loading (skill_loader.py)

The platform supports hot-loading of capabilities. Skills are distinct modules automatically discovered and loaded at runtime. This plugin-like architecture ensures that the core loop remains isolated from specific tool logic, following the Open-Closed Principle.

Current Built-in Skills:

  • browser_use: Empowers the agent to autonomously navigate the web, click elements, fill forms, and extract content using Playwright.
  • datetime: Provides real-time temporal awareness.
  • memory_work: Enables the agent to perform long-term recall and contextual note-taking.

Adding Future Skills: Because of the modular design, adding new capabilities (like API integrations, database querying, or third-party webhooks) is as simple as dropping a new folder into the skills/ directory with a handler.py defining the tools and execution logic!

4. Fully Asynchronous I/O

The entire application stack—from API calls (httpx) to Telegram webhook polling (python-telegram-bot) and file handling—utilizes Python's asyncio. This non-blocking architecture allows the bot to handle multiple users simultaneously without thread starvation.

5. Production-Ready Deployment

To ensure zero-friction deployment and environment consistency, the application is fully containerized.

  • Dockerized: The Python runtime is containerized using a slim base image for optimal footprint.
  • Docker Compose: Orchestrates both the Tiny-OpenClaw agent container and the Redis datastore, handling networking and environment variable ingestion out of the box.

🛠️ Technology Stack

Category Technologies
Language & Concurrency Python 3.11+, asyncio
AI / LLM Integration Anthropic API (Claude), ReAct Pattern
Memory & Storage Redis
Bot Framework python-telegram-bot
Containerization Docker, Docker Compose

🚀 Getting Started

Prerequisites

  • Docker & Docker Compose
  • Telegram Bot Token (from @BotFather)
  • Anthropic API Key

Installation

  1. Clone the repository:

    git clone https://github.com/omer-here/tiny-openclaw.git
    cd tiny-openclaw
  2. Configure Environment:

    cp .env.sample .env
    # Edit .env and add your ANTHROPIC_API_KEY and TELEGRAM_BOT_TOKEN
  3. Run via Docker Compose:

    docker-compose up --build -d
  4. Interact: Open Telegram and start messaging your bot!


🧠 Example Workflow

  1. User: "What's on my schedule today, and remember that my favorite color is cyan."
  2. Agent Reason: I need to use the datetime skill to get the current date, and the memory_work skill to save the user's favorite color.
  3. Agent Action:
    • Calls save_memory(key="favorite_color", value="cyan")
    • Calls get_current_time()
  4. Agent Response: "It's currently [Time]. I've also noted that your favorite color is cyan! What's next?"

Developed with ❤️ to push the boundaries of accessible Agentic AI.

About

Python, Anthropic Claude API, Redis, Playwright, asyncio, Docker. Production-ready agentic AI runtime implementing the ReAct loop via Claude API; supports hot-loaded skills (web browsing via Playwright, long-term memory recall) with fully async I/O. Migrated session/memory persistence from JSON files to Redis, enabling concurrent multi-user acces

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors