Documentation Index
Fetch the complete documentation index at: https://docs.lucid.foundation/llms.txt
Use this file to discover all available pages before exploring further.
Managed Channels
Deploy and manage AI agents directly from Telegram without the need for a terminal or website.Commands
Here are the available commands you can use to interact with the Lucid platform via Telegram:| Command | Description | Requires DB |
|---|---|---|
/launch [slug] | Initiates an interactive agent deployment wizard. | No (catalog from Layer API) |
/start <passport_id> | Connects the chat to an existing agent. | Yes |
/start link_TOKEN | Links your Telegram account to a web account using a token from the dashboard. | MergedDb |
/status | Checks the current status of the agent. | Yes |
/list | Lists the user’s agents. | Yes |
/plan | Displays the current plan and usage. | MergedDb |
/upgrade | Shows upgrade options and initiates a Stripe checkout. | MergedDb |
/help | Displays all available commands. | No |
Architecture
The architecture for managing Telegram interactions is as follows:User Identity
There are two primary flows for user identity management:- Telegram-only: The
ensureUser()function automatically provisions a profile, organization, and free plan using thecreate_telegram_user()RPC. - Web→Telegram: The dashboard generates a link token which can be used with
t.me/bot?start=link_TOKEN. The bot consumes this token to link to an existing account.
Billing Gate
Before deploying an agent with/launch, the system checks if deployment is allowed by comparing the plan’s agents_deployed limit with usage_metrics using checkLaunchAllowed(). After a successful deployment, trackAgentDeploy() increments the usage count.
Module Structure
The following is the structure of the Telegram bot module:Environment Variables
The following environment variables are required for the Telegram bot API:LucidMerged Migrations
The following migrations are applied to the LucidMerged database:079_telegram_user_links.sql— Adds the telegram_user_links table and agents_deployed plan limits.080_telegram_user_provisioning.sql— Implements the create_telegram_user() RPC.081_telegram_account_link_tokens.sql— Adds link tokens and create/consume RPCs.
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)