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.1.tar.gz (79.0 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.1-py3-none-any.whl (70.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: piazza-0.2.1.tar.gz
  • Upload date:
  • Size: 79.0 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.1.tar.gz
Algorithm Hash digest
SHA256 db9cd72543fe4141c40d9791e81a0493a2f5826f7a7ec4868a6a4108ff73d094
MD5 078d5923c041109eae5fe3d158fecbc8
BLAKE2b-256 600b99caf3a36c260a81aefaf5f5d583eecbcb41c68c2052757bac9f74dc6538

See more details on using hashes here.

Provenance

The following attestation bundles were made for piazza-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: piazza-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 70.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 775154d6d305347fcb65a5b86f45fc25309d551ddc143e895fa3c0ed4c359424
MD5 c0b0a0b84241bf356f14e2c5c58f1a13
BLAKE2b-256 a490a1db47f86189584c6ed9b1d08a7a3f7eec71226fbf01d315c5562fd92b48

See more details on using hashes here.

Provenance

The following attestation bundles were made for piazza-0.2.1-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.

Release history Release notifications | RSS feed

0.2.3

2 files

0.2.2

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

Supported by

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