Skip to content

TemurTurayev/siblings

Repository files navigation

Siblings

Two AI agents — Sarah & Atlas — powered by Claude Code CLI, running as Telegram bots.

Sarah is the supervisor. Atlas is the coder. Together, they form a sibling system with shared memory, cross-communication, and self-improvement capabilities.


How It Works

                         ┌─────────────────────────────────────────┐
                         │            Google Cloud VM              │
                         │          (e2-standard-2, 8GB)           │
                         │                                        │
  ┌──────────┐           │  ┌──────────┐       ┌──────────┐      │
  │ Telegram │◄──────────┼──┤  Sarah   │       │  Atlas   │      │
  │  Users   │───────────┼─►│ (Python) │       │ (Python) │      │
  └──────────┘           │  └────┬─────┘       └────┬─────┘      │
                         │       │                   │            │
                         │       ▼                   ▼            │
                         │  ┌─────────────────────────────┐      │
                         │  │    Claude Code CLI (Opus)    │      │
                         │  │  ┌───────────────────────┐  │      │
                         │  │  │ Tools: Read, Write,    │  │      │
                         │  │  │ Bash, Grep, WebSearch  │  │      │
                         │  │  └───────────────────────┘  │      │
                         │  │  ┌───────────────────────┐  │      │
                         │  │  │ MCP: MemPalace,       │  │      │
                         │  │  │ GitButler, RTK        │  │      │
                         │  │  └───────────────────────┘  │      │
                         │  └─────────────────────────────┘      │
                         │       │                   │            │
                         │       ▼                   ▼            │
                         │  ┌─────────┐    ┌──────────────┐      │
                         │  │ SQLite  │    │  Sibling DB  │      │
                         │  │ per-bot │    │  (shared)    │      │
                         │  └─────────┘    └──────────────┘      │
                         └─────────────────────────────────────────┘

  Message Flow:
  ─────────────
  1. User sends message in Telegram
  2. python-telegram-bot receives update
  3. Handler checks access (approved/blacklisted/pending)
  4. Brain builds system prompt (identity + memory + user context)
  5. Claude Code CLI runs with prompt + session resume
  6. Response streams back via JSON → sent to Telegram
  7. Message stored in SQLite + MemPalace for long-term recall

Sibling Communication

  ┌────────┐    Sibling DB (SQLite)    ┌────────┐
  │ Sarah  │◄─────────────────────────►│ Atlas  │
  │        │   msg_type: "chat"        │        │
  │        │   msg_type: "task"        │        │
  │        │   msg_type: "question"    │        │
  └────────┘                           └────────┘
       │                                    │
       └──── Siblings Group Chat ───────────┘
             (shared Telegram group)

Memory Architecture

  ┌─────────────────── Memory Layers ───────────────────┐
  │                                                     │
  │  Layer 1: Conversation (SQLite)                     │
  │  ├── Full message history per user                  │
  │  ├── Auto-compaction at threshold                   │
  │  └── Conversation summaries                         │
  │                                                     │
  │  Layer 2: Relationship (File-based)                 │
  │  ├── system.txt      ← immutable core identity      │
  │  ├── instructions.md ← behavioral rules             │
  │  ├── identity.md     ← personality & relationships  │
  │  └── people/{id}/    ← per-user observations        │
  │                                                     │
  │  Layer 3: Semantic (MemPalace MCP)                  │
  │  ├── Long-term fact storage                         │
  │  ├── Searchable by meaning                          │
  │  └── Proactive store & recall                       │
  │                                                     │
  │  Layer 4: Self-Improvement                          │
  │  ├── Daily research triggers (cron → Claude)        │
  │  ├── Learned behaviors from feedback                │
  │  └── Capability expansion log                       │
  └─────────────────────────────────────────────────────┘

Architecture

siblings/
├── sarah/          # Supervisor agent — warm, personal, Islamic knowledge
│   ├── bot/
│   │   ├── core/       # brain.py, claude.py, memory.py
│   │   ├── handlers/   # commands.py, messages.py, groups.py
│   │   └── storage/    # database.py
│   ├── config/         # .env, access.json (gitignored)
│   ├── memory/         # system.txt, instructions.md, identity.md
│   └── requirements.txt
├── atlas/          # Coder agent — technical tasks, software engineering
│   └── (same structure as sarah/)
├── shared/         # Shared libraries & knowledge
│   ├── lib/            # claude_wrapper.py, access_control.py, detection.py
│   └── knowledge/      # coding patterns, team values
└── scripts/        # start/stop/restart/status scripts

Sarah (Supervisor)

  • Warm, emotionally intelligent conversations
  • Islamic knowledge with proper adab
  • File processing (PDF, DOCX, images, spreadsheets)
  • Image generation via Google Imagen (/imagine)
  • Video generation (/video)
  • Web search (/search)
  • Long-term memory via MemPalace MCP
  • Self-improvement through daily research triggers
  • Access control with approval workflow + blacklist system
  • DM privacy enforcement (private conversations never leak)

Atlas (Coder)

  • Software engineering and coding assistance
  • Project-scoped memory per user
  • Code review, debugging, architecture discussions
  • Self-modification capabilities

Access Control

  New User ──► /start ──► Pending ──► Owner approves? ──► Approved
                                          │                    │
                                          ▼                    ▼
                                       Rejected           Full access
                                          │
                                          ▼
                              Owner can blacklist
                              (silent ignore + data purge)

Three tiers: Owner (full trust) → VIP (pre-approved) → Approved (passed workflow)

Plus: Pending, Rejected, and Blacklisted (silently ignored, all data purged).


Setup

Prerequisites

Installation

git clone https://github.com/TemurTurayev/siblings.git
cd siblings/sarah
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp config/.env.example config/.env  # Edit with your tokens

Running

./scripts/start_sarah.sh    # Start Sarah
./scripts/start_atlas.sh    # Start Atlas
./scripts/start_both.sh     # Start both
./scripts/status.sh         # Check status

Tech Stack

Component Technology
AI Backend Claude Code CLI (Opus 4.6)
Telegram python-telegram-bot 22.x
Database SQLite (aiosqlite)
Memory MemPalace MCP + SQLite
Image Gen Google Imagen / Nano Banana
Video Gen Google Veo
Git Tools GitButler CLI, RTK
Hosting Google Cloud (e2-standard-2)

License

MIT License — @TemurTurayev

About

Sarah & Atlas Telegram bots powered by Claude Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors