How to Build an AI-Native Company on Telegram
Most companies add AI to existing workflows. An AI-native company starts the other way around: the AI agents ARE the company, and humans steer them through messaging. In this tutorial you will build exactly that - a multi-agent company that lives entirely on Telegram, where each agent is a department you can message to get work done.
By the end, you will have four specialized Telegram bots that share a common workspace, delegate work to each other, and restrict access to authorized users only. No dashboards, no web apps - just Telegram conversations that run your business.
What You'll Build
A Telegram-native company with four departments:
| Department | Bot | Responsibilities |
|---|---|---|
| Executive Office | Executive Assistant | Scheduling, priorities, daily briefings, delegation to other departments |
| Operations | Operations Bot | Shell scripts, file management, infrastructure tasks, data processing |
| Research | Research Analyst | Market research, competitor monitoring, report writing |
| Customer Relations | Customer Liaison | Outreach drafts, follow-up scheduling, CRM notes |
Each department is a separate Telegram bot. They share a workspace (Space) for handing off artifacts, and the Executive Assistant can delegate tasks to any department using background task management.
Prerequisites
- A ChatBotKit account
- A Telegram account
- Four Telegram bot tokens from @BotFather (one per department)
- Approximately 45-60 minutes
Tip: Create all four bots in BotFather before starting. Name them something like
MyCoExecBot,MyCoOpsBot,MyCoResearchBot, andMyCoOutreachBot. Save each token - you will need them in the final step.
Step 1: Create the Blueprint with the Executive Assistant
Start with a single bot - the Executive Assistant. This will be the central coordinator that you interact with most often.
- Navigate to Blueprints in your ChatBotKit dashboard.
- Click Create and select Blueprint.
- Name it "AI Company".
- Click Design to open the Blueprint Designer.
Add a Bot, a Skillset, and a Space to the canvas. Configure them as shown:
At this point you have a single bot with workspace access. Test it in the Agent Console by asking it to create a priorities file - it should write to the shared Space.
Step 2: Add the Operations Bot
The Operations Bot handles infrastructure work - running shell commands, processing data files, and executing scripts. It gets its own skillset with shell execution abilities.
Add a second Bot and Skillset to the canvas:
Notice both bots share the same Space (#space:::company-workspace). This is what makes cross-department handoffs possible - the Executive Assistant can write a task brief to /ops/tasks/, and the Operations Bot can pick it up and write results back.
Step 3: Add the Research Analyst
The Research Analyst handles information gathering, competitive analysis, and report writing. It gets web fetching abilities in addition to workspace access.
Add a third bot with its own skillset:
The Research Analyst has a fetch/structured ability that lets it pull content from the web. Combined with workspace write access, it can research a topic and drop a finished report into /research/reports/ where the Executive Assistant or anyone else can read it.
Step 4: Add the Customer Liaison
The Customer Liaison handles outreach drafts, follow-up scheduling, and customer notes. It rounds out the team.
Add a fourth bot:
You now have four department bots, each with their own skillset, all sharing one workspace. The next step is enabling the Executive Assistant to delegate work to the other departments.
Step 5: Enable Cross-Department Delegation
The Executive Assistant needs to create background tasks for other bots. Add task management abilities to the Executive Toolkit so it can dispatch work, check on progress, and report back.
Add these abilities to the Executive Assistant's skillset:
The Executive Assistant now has five new abilities:
- List Departments - discovers available department bots in the blueprint
- Assign Task - creates a background task assigned to a specific bot
- List Tasks - checks the status of outstanding work
- Get Task Details - fetches the full output of a completed task
- Cancel Task - removes a task that is no longer needed
When you tell the Executive Assistant "Ask the Research Analyst to write a report on competitor pricing", it will create a background task for the Research Bot. The Research Bot processes the task independently, writes results to the workspace, and the Executive Assistant can check on progress later.
Step 6: Connect Everything to Telegram
Now wire each department bot to its own Telegram bot. This is what makes the company accessible from your phone.
Add four Telegram integrations to the blueprint:
For each Telegram integration, paste the bot token you created in BotFather into the botToken field. Leave it empty in the blueprint code and fill it in through the Blueprint Designer UI after deploying.
Deploy the blueprint by clicking Build in the designer. Each Telegram integration will start listening for messages once the token is set.
Step 7: Restrict Access to Authorized Users
This is the most important security step. By default, anyone who finds your Telegram bot can message it. For a company that runs real operations, you need to lock each bot down to authorized users only.
Each Telegram integration has an allowFrom field that controls exactly who can interact with the bot. This is enforced at the platform level before the AI even sees the message - unauthorized users are rejected outright.
How allowFrom Works
The allowFrom field accepts a newline-separated or comma-separated list of entries. Messages from anyone not on the list are silently dropped.
Supported formats:
| Format | Example | Matches |
|---|---|---|
* | * | Everyone (wildcard) |
@userId | @123456789 | A specific Telegram user by numeric ID (most reliable) |
@username | @bob | A specific Telegram user by username (advisory - usernames can change) |
#chatId | #-1001234567 | A specific group or channel by chat ID |
| Raw positive integer | 123456789 | Treated as a user ID |
| Raw negative integer | -1001234567 | Treated as a chat ID |
Important: If
allowFromis empty, all messages are denied. You must either list specific users or use*to allow everyone. For a company setup, always list specific user IDs.
Tip: Find your Telegram user ID by messaging @userinfobot on Telegram. Use numeric IDs rather than usernames for security-sensitive restrictions, since usernames can be changed or transferred.
Configure Access for Each Department
- Open each Telegram integration in the Blueprint Designer.
- In the
allowFromfield, enter the Telegram user IDs of people who should have access to that department. - You can give different people access to different departments.
For example, you might restrict the Operations Bot to the founder and the operations lead, while giving the entire team access to the Research Analyst:
| Department | Who has access | allowFrom value |
|---|---|---|
| Executive Assistant | Founder, co-founder | @123456789, @987654321 |
| Operations Bot | Founder, ops lead | @123456789, @555555555 |
| Research Analyst | Entire team | @123456789, @987654321, @555555555, @444444444 |
| Customer Liaison | Founder, sales lead | @123456789, @666666666 |
This is enforced at the integration layer, not by the AI model. There is no way to bypass it through prompt injection or conversation tricks - the message never reaches the bot if the sender is not on the list.
Combining with Contact Collection
For additional visibility, enable Contact Collection alongside allowFrom. This creates a contact record in your ChatBotKit dashboard for every user who messages the bot, giving you an audit trail of who is interacting with each department:
- Set
contactCollection: trueon each Telegram integration. - Review contacts in the ChatBotKit dashboard under Contacts.
Contact Collection is complementary to allowFrom - it does not replace it. Even with contact collection enabled, unauthorized users are still blocked by the allowFrom list.
Step 8: Add a Daily Briefing Trigger
The final piece is automation. Add a trigger that wakes the Executive Assistant every morning to prepare a daily briefing by reviewing the workspace.
The trigger runs on a daily schedule. It wakes the Executive Assistant, which reviews the entire workspace, checks on department tasks, and sends you a Telegram summary. You wake up to a briefing instead of having to ask for one.
Tip: Change
triggerSchedule: dailytotriggerSchedule: quarterhourlyif you want more frequent check-ins, or use a custom cron expression for a specific time.
Running Your AI Company
With everything deployed, here is how a typical workday looks:
Morning: The daily briefing trigger fires and sends you a summary on Telegram via the Executive Assistant bot.
Throughout the day: You message different department bots directly on Telegram:
- To the Executive Assistant: "Delegate a competitor analysis on Acme Corp to the Research Analyst"
- To the Operations Bot: "Write a Python script that converts the CSV in /ops/outputs/sales.csv to JSON"
- To the Research Analyst: "What is the latest pricing for Acme Corp's enterprise plan?"
- To the Customer Liaison: "Draft a follow-up email to John Smith about the partnership discussion"
Cross-department workflows: Tell the Executive Assistant to coordinate multi-step work:
- "Ask the Research Analyst to analyze our top 5 competitors, then have the Customer Liaison draft outreach messages based on the findings"
- "Have Operations process last month's sales data, then ask the Research Analyst to write a trends report"
Checking on delegated work:
- To the Executive Assistant: "What tasks are running right now?"
- To the Executive Assistant: "Show me the results of the competitor analysis"
Privilege Separation and Security Summary
The architecture enforces natural privilege boundaries:
| Bot | Can Execute Code | Can Access Web | Can Delegate | Can Send Telegram |
|---|---|---|---|---|
| Executive Assistant | No | No | Yes | Yes (via trigger) |
| Operations Bot | Yes (sandboxed) | No | No | No |
| Research Analyst | No | Yes | No | No |
| Customer Liaison | No | No | No | No |
This means:
- The Executive Assistant can read the workspace and route tasks, but cannot run arbitrary code or fetch external URLs. If its conversation is compromised, the blast radius is limited to reading files and creating tasks.
- The Operations Bot can run shell commands, but only in an isolated sandbox. It cannot access the web or delegate to other bots.
- The Research Analyst can fetch web pages but cannot execute code. A malicious web page it reads cannot lead to code execution.
- The Customer Liaison can only read and write files. It has the smallest attack surface of all.
Combined with Telegram access restrictions (Step 7), you have a multi-layered defense:
- Integration layer - The
allowFromfield blocks unauthorized users before the AI sees the message - Capability layer - Each bot only has the abilities it needs
- Sandbox layer - Shell execution runs in ephemeral, isolated containers
- Behavioral layer - Backstory instructions enforce operational rules
Troubleshooting
Bot does not respond on Telegram
Verify the bot token is correctly entered in the Telegram integration. Check that the blueprint is deployed. Try sending /start to the bot.
Executive Assistant cannot find department bots
The "List Departments" ability uses blueprint/resource/list. Ensure all four bots are part of the same blueprint.
Tasks are created but never complete Background tasks require the target bot to have the abilities needed to fulfill the request. Verify the department bot's skillset includes the necessary tools.
Daily briefing does not fire
Check that the trigger integration is deployed and the schedule is set. The trigger needs authenticate: true and a valid botId pointing to the Executive Assistant.
Next Steps
- Add more departments - Add a Finance Bot with Google Sheets abilities, or a Marketing Bot with social media tools.
- Add proactive notifications - Give each department a Telegram notification ability so they can push updates to the founder without waiting to be asked.
- Connect external services - Add Google Calendar to the Executive Assistant, Gmail to the Customer Liaison, or Stripe to a new Finance Bot using ability templates and OAuth secrets.
- Add a heartbeat - Change the daily trigger to a more frequent heartbeat (every 15 minutes) for real-time operational awareness. See the Heartbeat Async Operator blueprint for the pattern.
- Scale with sub-accounts - As the company grows, move departments into separate sub-accounts with shared resources. See Setting Up Resources in the Master Account and Using Them in Sub-Accounts.