Skip to main content

Piazza

CI PyPI Release License: MIT

English Version | 中文版

A lightweight message bus for multi-agent AI collaboration — the town square (广场) where agents meet.

Overview

Piazza provides structured, persistent communication channels for AI agents. Instead of point-to-point RPC or shared memory, agents interact through named channels with pub/sub semantics, cursor-based polling, and built-in identity management.

Backend (storage)  →  Bus (routing)  →  Client SDK (agent API)
   SQLite / Memory       pub/sub           identity, cursors,
                         channels           DMs, notes, memory

Features

  • Channel-based messaging — named channels with pub/sub, cursor-tracked polling, and message ordering via monotonic UUIDs
  • Pluggable storage — SQLiteBackend (persistent, WAL mode) and MemoryBackend (ephemeral, testing); protocol-based, easy to extend
  • Client SDK — PiazzaClient with agent identity, cursor persistence across sessions, and authentication (register/reconnect/secret hashing)
  • Semantic APIs — DMs, broadcast channels, notes (with tags), thoughts (chain-of-thought logging), memory (store/recall), notifications
  • Admin panel — built-in HTTP dashboard with REST API for stats, channel browsing, message inspection, and throughput monitoring; modular admin/routes/ subpackage with dict-based dispatch
  • Flexible connection — connect via Bus object, file path (SQLite), or :memory: string; URL schemes (http://, redis://) reserved for future transports
  • Zero runtime dependencies — pure Python, stdlib only

Quick Start

from piazza import PiazzaClient

# In-memory bus (for testing)
with PiazzaClient(":memory:", "agent-alpha") as alice:
    alice.channel_send("general", "hello everyone!")
    alice.note_write("remember to check logs", tags=["ops"])
    alice.thought_record("planning", "next steps", "need to coordinate with bob")

# SQLite-backed (persistent)
with PiazzaClient("/tmp/piazza.db", "agent-alpha") as alice:
    alice.dm_send("agent-beta", "ready to sync?")

# Multi-agent collaboration
from piazza import Bus, MemoryBackend

bus = Bus(backend=MemoryBackend())

alice = PiazzaClient(bus, "agent-alice")
bob = PiazzaClient(bus, "agent-bob")

alice.dm_send("agent-bob", "PR is ready for review")
messages = bob.dm_read("agent-alice")  # ["PR is ready for review"]

alice.close()
bob.close()
bus.close()

Architecture

Piazza follows a layered architecture inspired by messaging middleware, adapted for AI agent workflows:

Layer Component Role
Storage Backend protocol Persistent or ephemeral message storage (SQLiteBackend, MemoryBackend)
Routing Bus Channel management, pub/sub dispatch, UUID generation
Transport Transport protocol Abstraction for local vs. remote bus access (LocalTransport)
Agent API PiazzaClient Identity, cursors, auth, semantic messaging APIs
Frontend Frontend protocol 🔄 Network-facing servers (REST + SSE) binding to Bus (HttpFrontend, PiazzaServer)
Admin AdminServer HTTP dashboard + REST API for monitoring

For detailed design rationale, see DESIGN_EN.md.

Installation

Requires Python >= 3.10.

pip install piazza

Or from source:

git clone https://github.com/Oaklight/piazza.git
cd piazza
pip install -e ".[dev]"

Client SDK API

Core Operations

Method Description
channel_send(channel, content) Send message to a channel
channel_read(channel) Read messages (no cursor advance)
channel_poll(channel) Poll new messages (advances cursor)
channel_list() List all channels

Semantic APIs

Method Description
dm_send(target, content) Send direct message
dm_read(peer) Read DM conversation
note_write(content, tags=) Write a note with optional tags
note_read(tags=) Read notes, optionally filtered by tags
thought_record(mode, focus, content) Record chain-of-thought
thought_read() Read thought history
memory_store(content) Store a memory
memory_recall(query) Recall memories by keyword
broadcast_list() / broadcast_read(topic) Browse broadcast channels
notification_check() Poll notifications

Authentication

# Register new agent (returns client + secret)
client, secret = PiazzaClient.register(bus, "agent-id")

# Reconnect with secret
client = PiazzaClient(bus, "agent-id", secret=saved_secret)

Admin Panel

from piazza import SQLiteBus

bus = SQLiteBus("piazza.db")
info = bus.start_admin(port=8741)
print(f"Dashboard: {info.url}")
# Visit http://localhost:8741 for the web UI

Roadmap

  • RemoteTransport — 🔄 In Progress (dev/agent-bus): HttpFrontend, PiazzaServer, HttpTransport implemented; pending merge
  • IRC Frontend — planned additional Frontend implementation
  • Message TTL — automatic expiry and cleanup
  • Semantic memory recall — vector embedding search
  • Channel ACL — per-channel access control
  • Redis/AMQP backends — distributed storage
  • Async API — native async/await support
  • Federation — cross-instance communication (#4)

Academic Context

Piazza is the reference implementation for Chapter 9 of a dissertation on enabling agentic AI at scale through decoupled abstractions. The design emphasizes protocol-based interfaces, pluggable components, and a clear separation between transport, storage, and agent-level semantics.

License

MIT — see LICENSE for details.

Metadata

Release files for piazza 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piazza 0.2.3
File Size Uploaded
piazza-0.2.3.tar.gz 102.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for piazza 0.2.3
File Interpreter ABI Platform
piazza-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 197.1 kB

Release files / piazza-0.2.3.tar.gz

Download URL piazza-0.2.3.tar.gz
Size 102.1 kB
Tags Source
SHA-256 checksum
How to use checksums
998dbc83fe345e8cec4cb8bf78c9e463b155cca6b79af1342496b3d390da55b7
BLAKE2b-256 checksum
How to use checksums
155fd52f7cffe5fb0092df23764ffb45a2fb6863b70048b3039db8a47d8ce7bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.

Transparency log

Release files / piazza-0.2.3-py3-none-any.whl

Download URL piazza-0.2.3-py3-none-any.whl
Size 95.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42182636da092429a9f2e037a90d3c4ba039e2c9c6504b4a68d0d01fd39b322a
BLAKE2b-256 checksum
How to use checksums
fab446062ff9443eab33b6dca7bf2f3cc87b6eea17f634ca146ff8b3ba9f51e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page