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 storageSQLiteBackend (persistent, WAL mode) and MemoryBackend (ephemeral, testing); protocol-based, easy to extend
  • Client SDKPiazzaClient 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piazza-0.2.3.tar.gz (102.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piazza-0.2.3-py3-none-any.whl (95.0 kB view details)

Uploaded Python 3

File details

Details for the file piazza-0.2.3.tar.gz.

File metadata

  • Download URL: piazza-0.2.3.tar.gz
  • Upload date:
  • Size: 102.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piazza-0.2.3.tar.gz
Algorithm Hash digest
SHA256 998dbc83fe345e8cec4cb8bf78c9e463b155cca6b79af1342496b3d390da55b7
MD5 7359a409b7b5efbc819e0de177aae929
BLAKE2b-256 155fd52f7cffe5fb0092df23764ffb45a2fb6863b70048b3039db8a47d8ce7bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for piazza-0.2.3.tar.gz:

Publisher: release.yml on Oaklight/piazza

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file piazza-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: piazza-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 95.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for piazza-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42182636da092429a9f2e037a90d3c4ba039e2c9c6504b4a68d0d01fd39b322a
MD5 ed8caaf1b178c86b66988c12e42f16e3
BLAKE2b-256 fab446062ff9443eab33b6dca7bf2f3cc87b6eea17f634ca146ff8b3ba9f51e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for piazza-0.2.3-py3-none-any.whl:

Publisher: release.yml on Oaklight/piazza

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page