Installing client

This guide will help you configure Meshagent across various environments: Browser, Node.js, Python, and Dart/Flutter.

To get started, install the MeshAgent API:

pip3 install meshagent-api

Set Environment Variables

Before you begin, you must export three environment variables. Make sure to substitute the placeholder values (xxxx-xxxx...) with your actual keys and secrets.

export MESHAGENT_KEY_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export MESHAGENT_PROJECT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export MESHAGENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Let’s connect to a room

import asyncio
from meshagent.api import RoomClient, websocket_protocol

async def main():    
    # Define a unique room name
    room_name = 'my-room'
    participant_name = 'my-participant'

    async with RoomClient(
        websocket_protocol(
            participant_name=participant_name,
            room_name=room_name
        )) as room:   
            print("connected to room")

if __name__ == '__main__':
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)
    asyncio.get_event_loop().run_until_complete(main())


Meshagent Rooms provide a shared workspace for agents and participants to collaborate in real time. Each room includes a participant list, presence tracking, and a mechanism for sharing information. Because Meshagent is designed for seamless integration, rooms are provisioned on demand as participants connect. This eliminates the complexity of syncing rules and allows agents and people to quickly spin up a shared environment to collaborate in.

How Rooms Work

  • Temporary by design
    A room is provisioend when the first participant joins and deprovisioned when the last participant leaves. It only exists to facilitate communication during the session.

  • No state persistence
    The Meshagent admin console logs session activity for debugging, such as which agents participated and what questions were asked. However, the state of the room will be discarded at the end of the session, so any data that should persist after the session ends needs to be written to an external storage provider.

  • Document management
    A room can help participants discover, sync, and share documents when they connect to it, but the room only temporarily stores MeshDocuments in memory while they are open. When documents are modified, or a session ends, the changes are written to an external storage provider. By default, Meshagent Cloud provides a storage folder (named for the room) where documents are kept. For more complex scenarios, you can configure an existing storage solution using a custom provider and save the documents in your own database or storage buckets.