Launch a company agent
Launch your own AI agent in a workspace, test what a member can do in the app, then connect Telegram and verify a real conversation.
Give the agent one job and one role
Start with a linked workspace and one question whose answer you can verify. In the starter, a sales member might ask who owns a known lead. Decide which records that role may read and which action, if any, it may take. Give the agent a second test where a different role must be refused.
Set up the agent in the app
The current starter includes agent/. In an older project that lacks it, initialize the agent from the workspace root with the command below. Use agent/agent/instructions.md for its job and response conventions, agent/segmentstream.json for model and channel configuration, and ontology/ for the actions and their permissions. The signed-in starter app includes a chat at /agent, so you can try the first version there.
segmentstream agent init --channel noneTest with a member in a preview
Commit the agent and its ontology changes on a branch in the linked workspace. Deploy a named preview, open its app and try the question about the known record. Compare the answer with the record itself. Repeat the permission test. Preview chat and evals run against the preview ontology. External channels, tasks and connections are inactive there.
segmentstream deploy --preview --preview-name agent-pilot
segmentstream previews show agent-pilotTurn the conversation into an eval
For a repeatable check, add a case in agent/evals/ with a known record and an expected result, then commit and redeploy the preview. Run the eval as an invented email address that does not belong to a production member. The example uses the starter’s sales role. In another workspace, supply a role its ontology declares.
segmentstream agent eval --preview agent-pilot --as pilot@example.invalid --role salesPublish the agent in the app
Merge the reviewed changes to the linked repository’s main branch and deploy that revision. Check the deployment and the agent status. Open /agent on the production app, sign in as a pilot member and repeat the question about a known record. The team can use app chat from this point.
segmentstream deploy
segmentstream status
segmentstream agent statusConnect a production Telegram bot
If the team wants Telegram, run agent init with the Telegram channel in the linked project. Supply the workspace’s replies.pairingRequired, replies.pairingButton and texts.confirmation messages, review its file and dependency changes, and commit them. Deploy the reviewed main revision. For a newly declared telegram connection, run segmentstream connection authorize telegram after deployment and complete Telegram’s bot creation flow. For an existing BotFather token, configure the deployed connection with that token.
segmentstream agent init --channel telegramVerify a live conversation
Check that the deployed revision is live and that the agent lists the expected channel. In a member-only workspace, message the bot directly, open the app’s /agent/connect pairing link, sign in and approve it. Ask about the same known record. If self-sign-up is enabled, check which roles it assigns to the new user.
- If the bot stays silent, check the channel name and connection status, then try a direct message to separate a connection problem from the group’s reply policy.
- If the agent replies but cannot read the record, check the paired member’s role and the action logs. Use the session trace to inspect the tool call and its result.
segmentstream connection get telegram
segmentstream agent status