Talor-A/strix

based on https://timkellogg.me/blog/2025/12/15/strix

โ˜… 0Forks 0TypeScriptGitHub โ†—Compare

README

Strix - Ambient AI Assistant

Strix is a stateful AI assistant built with the Claude Agent SDK and Telegram. It maintains persistent memory through file-based state management and can autonomously use tools to communicate and manage its own memory.

Architecture

  • Claude Agent SDK: Autonomous agent with built-in file operations
  • Telegram (via grammY): User interface
  • File-based Memory: Three-tier memory system (identity, working memory, temporal awareness)
  • Custom Tools: Telegram communication tools (send_message, send_reaction, send_image)

Setup

1. Install Dependencies

Dependencies are already installed. You have:

  • Claude Code CLI (globally installed)
  • @anthropic-ai/claude-agent-sdk
  • grammy (Telegram bot framework)
  • zod (schema validation)
  • dotenv (environment variables)

2. Configure API Keys

Edit .env file and add your API keys:

# Get from https://console.anthropic.com
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here

# Get from @BotFather on Telegram
TELEGRAM_BOT_TOKEN=123456789:your-token-here

To create a Telegram bot:

  1. Open Telegram and search for @BotFather
  2. Send /newbot command
  3. Follow prompts to choose a name and username
  4. Copy the token to your .env file

3. Run Strix

bun run index.ts

You should see:

๐Ÿฆ‰ Starting Strix...
๐Ÿ“ก Connecting to Telegram...
โœ… Strix is now running!
๐Ÿ’ฌ Send a message to your bot on Telegram to begin

4. Test the Bot

  1. Find your bot on Telegram (search for the username you chose)
  2. Send /start to get a welcome message
  3. Send any message - Strix will respond using the Claude Agent SDK
  4. Check state/ files to see memory updates
  5. Check logs/journal.jsonl for interaction logs

How It Works

Message Flow

User sends Telegram message
    โ†“
grammY receives message
    โ†“
Handler loads memory context from state files
    โ†“
Claude Agent SDK processes with memory + custom tools
    โ†“
Agent autonomously uses tools:
    - send_message to respond to user
    - Read/Write/Edit to manage state files
    - Bash to commit changes to Git
    โ†“
Interaction logged to journal

Memory System

Persistent Identity (.claude/CLAUDE.md):

  • Loaded automatically by Agent SDK
  • Defines Strix's persona and operational guidelines

Working Memory (state/*.md):

  • inbox.md - Unprocessed items
  • today.md - Current tasks
  • commitments.md - Promises made
  • patterns.md - Learned behaviors

Temporal Awareness (logs/*.jsonl):

  • journal.jsonl - Conversation history
  • events.jsonl - System events

Custom Tools

Strix can use these Telegram-specific tools:

  • send_message: Send text to user (can call multiple times)
  • send_reaction: React with emoji
  • send_image: Send images with captions

Plus all Claude Agent SDK built-in tools:

  • Read, Write, Edit: File operations
  • Bash: Run commands (for Git commits)
  • Grep, Glob: Search capabilities

Project Structure

strix/
โ”œโ”€โ”€ .claude/
โ”‚   โ””โ”€โ”€ CLAUDE.md              # Strix's persona (loaded by Agent SDK)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ agent/tools/
โ”‚   โ”‚   โ””โ”€โ”€ telegram-tools.ts  # Custom Telegram tools
โ”‚   โ”œโ”€โ”€ bot/
โ”‚   โ”‚   โ”œโ”€โ”€ telegram.ts        # Bot initialization
โ”‚   โ”‚   โ””โ”€โ”€ handlers.ts        # Message handlers (main integration)
โ”‚   โ””โ”€โ”€ memory/
โ”‚       โ”œโ”€โ”€ loader.ts          # Memory context builder
โ”‚       โ””โ”€โ”€ journal.ts         # Journal utilities
โ”œโ”€โ”€ state/                      # Working memory (Git tracked)
โ”‚   โ”œโ”€โ”€ inbox.md
โ”‚   โ”œโ”€โ”€ today.md
โ”‚   โ”œโ”€โ”€ commitments.md
โ”‚   โ”œโ”€โ”€ patterns.md
โ”œโ”€โ”€ logs/                       # Temporal awareness
โ”‚   โ”œโ”€โ”€ journal.jsonl
โ”‚   โ””โ”€โ”€ events.jsonl
โ”œโ”€โ”€ index.ts                    # Main entry point
โ””โ”€โ”€ .env                        # API keys (not in Git)

Next Steps

Before running, you need to:

  1. Add your API keys to .env:

  2. Run the bot: bun run index.ts

  3. Test on Telegram: Send messages to your bot

Resources

This project was created using bun init in bun v1.2.19. Bun is a fast all-in-one JavaScript runtime.

Issues