• DocsDocs
  • PricingPricing
Sign in
Get started
Sign in
Get started
    • Realtime Infrastructure
      • Presence
        Presence

        Online users, cursors, selections

      • Broadcast
        Broadcast

        Temporary event signals

      • Storage
        Storage

        Synced conflict-free data

      • Feeds
        FeedsBeta

        Messages and activity logs

      • Threads
        Threads

        Contextual conversations

    • Collaboration features
      • Multiplayer
        Multiplayer

        Realtime collaboration

      • Comments
        Comments

        Contextual commenting

      • Notifications
        Notifications

        Smart alerts for your app

      • AI Copilots
        AI Copilots

        Individual AI assistants

    • Tools
      • Examples

        Gallery of open source examples

      • Showcase

        Gallery of collaborative experiences

      • Next.js Starter Kit

        Kickstart your Next.js collaborative app

      • DevTools

        Browser extension

      • Tutorial

        Step-by-step interactive tutorial

      • Guides

        How-to guides and tutorial

      • Figma UI Kit

        Liveblocks Collaboration Kit

    • Company
      • Blog

        The latest from Liveblocks

      • Customers

        The teams Liveblocks empowers

      • Changelog

        Weekly product updates

      • Security

        Our approach to security

      • About

        The story and team behind Liveblocks

  • Docs
  • Pricing
  • Realtime Infrastructure
    • Presence
    • Broadcast
    • Storage
    • FeedsBeta
    • Threads
    Collaborative features
    • Multiplayer
    • Comments
    • Notifications
    • AI Copilots
    Solutions
    • People platforms
    • Sales tools
    • Startups
    Use cases
    • Multiplayer forms
    • Multiplayer text editor
    • Multiplayer creative tools
    • Multiplayer whiteboard
    • Comments
    • Sharing and permissions
    • Document browsing
  • Resources
    • Documentation
    • Examples
    • Showcase
    • DevTools
    • React components
    • Next.js Starter Kit
    • Tutorial
    • Guides
    • Release notes
    Technologies
    • Next.js
    • React
    • JavaScript
    • Redux
    • Zustand
    • Yjs
    • Tiptap
    • BlockNote
    • Slate
    • Lexical
    • Quill
    • Monaco
    • CodeMirror
  • Company
    • Pricing
    • Blog
    • Customers
    • Changelog
    • About
    • Contact us
    • Careers
    • Terms of service
    • Privacy policy
    • DPA
    • Security
    • Trust center
    • Subprocessors
  • HomepageSystem status
    • Github
    • Discord
    • X
    • LinkedIn
    • YouTube
    © 2026 Liveblocks Inc.
Blog/Updates

Python SDK for Liveblocks

We're excited to announce the release of the Python SDK for Liveblocks, allowing you to build the back end for collaborative applications and agent-driven software in Python.

on April 9th
Python SDK for Liveblocks
April 9th·4 min read
Share article
Product updatesOpen sourceAIPython

Ready to get started?

Join thousands of companies using Liveblocks to build multiplayer experiences for people and agents.

Get started for free

Related blog posts

  • Chat SDK adapter for Liveblocks

    Chat SDK adapter for Liveblocks

    Picture of Chris Nicholas
    April 8th
    Updates
  • Multiplayer SDK for React Flow: Realtime collaboration between humans and agents

    Multiplayer SDK for React Flow: Realtime collaboration between humans and agents

    Picture of Chris Nicholas
    April 7th
    Updates
  • AI agents are becoming native users of software

    AI agents are becoming native users of software

    Picture of Steven Fabre
    April 6th
    Updates

Today, we’re releasing the Python SDK for Liveblocks, bringing powerful back end capabilities to one of the most popular modern languages. This is especially important as Python continues to dominate the AI ecosystem, making it a natural choice for building intelligent, collaborative applications and agent-driven software.

Terminal
$pip install liveblocks

Python SDK

Our Python SDK introduces 85+ new methods for Liveblocks, allowing you to manage rooms, update realtime storage, and build agent workflows directly in Python. Let’s look at how it can be used.

Create a room

Rooms are the foundation of Liveblocks—they’re multiplayer spaces where people and agents can collaborate. In Python, you can use create_room to set them up, and define permissions.

from liveblocks.models import CreateRoomRequestBody
result = client.create_room( body=CreateRoomRequestBody( id="my-room-id", default_accesses=[], ),)

In your React front end, you can join this room using RoomProvider.

import { RoomProvider } from "@liveblocks/react";
export function Room({ children }) { return ( <RoomProvider id="my-room-id"> {children} </RoomProvider> );}

Modify realtime storage

Your multiplayer room may use Liveblocks Storage to store realtime data, for example shapes on a collaborative canvas. You can use patch_storage_document to modify this data in realtime.

patch = [    {        "op": "add",        "path": "/shapes/-",        "value": {            "id": "rect-1",            "type": "rectangle",            "x": 100,            "y": 150,            "width": 200,            "height": 120,        },    }]
result = client.patch_storage_document( room_id="my-room-id", body=patch,)

Changes are displayed in realtime for all connected clients with useStorage.

export function Canvas() {  const shapes = useStorage((root) => root.shapes);
// [..., { id: "rect-1", type: "rectangle", x: 100, y: 150, ... }] console.log(shapes)
return ( <div> {shapes.map((shape) => <Shape key={shape.id} shape={shape} />)} </div> )}

Use AI to modify realtime storage

By using get_storage_document, you can get the current realtime document as JSON. In combination with patch_storage_document, you can then use this to generate a patch with AI.

user_prompt = "Add a rectangle near the center of the canvas"
storage = client.get_storage_document( room_id="my-room-id", format_="json",)
patch = generate_patch_with_ai( prompt=user_prompt, context=storage, instructions=""" You are given the current storage document as JSON. Return a valid JSON patch array that updates the document. Only use operations like 'add', 'replace', or 'remove'. """)
result = client.patch_storage_document( room_id="my-room-id", body=patch,)

Show AI presence in a document

By using setPresence, you can show AI presence in a document while it’s making changes.

from liveblocks.models import SetPresenceRequestBody
client.set_presence( room_id="my-room-id", body=SetPresenceRequestBody( user_id="ai-agent-123", user_info={ "name": "AI agent", "avatar": "https://example.com/avatar.png", }, data={ "is_typing": True, }, ),)

In your front end, the AI’s avatar will appear in AvatarStack.

import { AvatarStack } from "@liveblocks/react-ui";
export function Header() { return ( <AvatarStack size="48px" /> );}

You can also build fully custom presence UI with useOthers.

Display realtime AI workflow status

Feeds is a new primitive for storing realtime chat messages, AI activity logs, and more. You can use create_feed_message to create a realtime message in a feed, for example to display the status of an AI workflow, currently Thinking….

from liveblocks.models import CreateFeedMessageRequestBody
result = client.create_feed_message( room_id="my-room-id", feed_id="my-feed-id", body=CreateFeedMessageRequestBody( data={ "status": "Thinking…", }, ),)print(result)

In your front end, you can show this message in your UI as soon as it’s created.

import { useFeedMessages } from "@liveblocks/react/suspense";
export function AgentStatus() { const { messages } = useFeedMessages("my-feed-id"); const latestMessage = messages[messages.length - 1];
return ( <div> {latestMessage.data.status} </div> )}

Sending new feed messages will update this UI in realtime.

Lots more APIs

We’ve only briefly touched upon uses for our new Python SDK. There are around 80 more methods to explore, allowing you to:

  • Authenticate users, manage permissions, create share menus.
  • List rooms, fetch connected users, send realtime events.
  • Multiplayer: Fetch and modify Yjs text document data.
  • Comments: Send emails when users have unread comments.
  • Notifications: Trigger custom notifications in notification inboxes.
  • AI Copilots: Upload knowledge sources to your chats.

Get started

To get started with the Python SDK, read our new API reference page.

Get started now

Contributors

Contributors include:nimeshnayajuctnicholas

2 authors