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
2.5 KiB
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(notnpm install) to avoid modifying the lockfile, which would block futuregit pullupdates.
2. Create a Telegram Bot
- Open Telegram and message @BotFather
- Send
/newbotand follow the prompts - Copy the bot token (looks like
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
3. Get a Letta API Key
- Go to app.letta.com
- Sign in or create an account
- Go to Settings > API Keys
- 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
- Commands Reference - Learn all bot commands
- Gmail Integration - Set up email notifications
- Slack Setup - Add Slack channel
- Discord Setup - Add Discord channel