Files
lettabot/docs/getting-started.md
Cameron 320c1cd6a0 docs: add npm run update script and recommend npm ci (#259)
Users running npm install get a dirty lockfile that blocks git pull.
Add an update script that handles the reset+pull+install+build cycle,
and document npm ci as the recommended install method.

Written by Cameron ◯ Letta Code

"Simplicity is the ultimate sophistication." -- Leonardo da Vinci
2026-02-10 13:25:42 -08:00

2.5 KiB

Getting Started

Get LettaBot running in 5 minutes.

Prerequisites

  • Node.js 20+
  • npm or yarn
  • A Telegram account
  • A Letta account (app.letta.com)

Quick Start

1. Clone and Install

git clone https://github.com/letta-ai/lettabot.git
cd lettabot
npm ci

Note: Always use npm ci (not npm install) to avoid modifying the lockfile, which would block future git pull updates.

2. Create a Telegram Bot

  1. Open Telegram and message @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the bot token (looks like 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)

3. Get a Letta API Key

  1. Go to app.letta.com
  2. Sign in or create an account
  3. Go to Settings > API Keys
  4. Create a new API key and copy it

4. Configure LettaBot

Option A: Interactive Setup (Recommended)

npm run build
npm link
lettabot onboard

This will walk you through configuration interactively.

Option B: Manual Setup

cp .env.example .env

Edit .env:

TELEGRAM_BOT_TOKEN=your_telegram_bot_token
LETTA_API_KEY=your_letta_api_key

5. Start the Bot

npm run dev

You should see:

Starting LettaBot...
Bot started as @your_bot_name
Allowed users: all

6. Chat with Your Bot

Open Telegram and message your bot. Try:

  • "Hello!"
  • "What can you help me with?"
  • "Remember that my favorite color is blue"

Configuration Options

Variable Required Description
TELEGRAM_BOT_TOKEN Yes From @BotFather
LETTA_API_KEY Yes From app.letta.com
ALLOWED_USERS No Comma-separated Telegram user IDs to allow
WORKING_DIR No Base directory for agent workspaces (default: /tmp/lettabot)
LETTA_CLI_PATH No Custom path to letta CLI

Restricting Access

To limit who can use your bot, set ALLOWED_USERS:

# Find your Telegram user ID by messaging @userinfobot
ALLOWED_USERS=123456789,987654321

Updating

Pull the latest changes and rebuild:

npm run update

This resets the lockfile, pulls from git, installs dependencies, and rebuilds. If you've modified source files locally, stash them first with git stash.

Next Steps