Skip to main content

piqrypt-session

Standard: AISS v2.0 · Full stack: piqrypt.com

Multi-agent cryptographic session for PiQrypt.

PyPI Downloads License: MIT PiQrypt

Establishes co-signed A2A handshakes between all agents before any action takes place. Each agent keeps its own verifiable memory. Every interaction references a shared session — provable, tamper-proof, non-repudiable.

pip install piqrypt-session

Works with any framework — LangChain, AutoGen, CrewAI, OpenClaw, or plain Python.


The idea

When multiple AI agents collaborate, today's systems record what each agent did — but not that they agreed to work together, and not that one agent's action was seen and acknowledged by another.

piqrypt-session fills that gap:

Before any action:
  LLM ↔ TradingBot    → co-signed handshake ✅
  LLM ↔ OpenClaw      → co-signed handshake ✅
  TradingBot ↔ OpenClaw → co-signed handshake ✅

During the session:
  LLM recommends BUY AAPL
    → LLM memory:         "I sent this recommendation to TradingBot"
    → TradingBot memory:  "I received this recommendation from LLM"
    → Both events share the same interaction_hash
    → Neither can deny it happened

Quickstart

from piqrypt_session import AgentSession

# Define your agents — any framework, any setup
session = AgentSession([
    {"name": "llm",          "identity_file": "llm.json"},
    {"name": "trading_bot",  "identity_file": "trading-bot.json"},
    {"name": "openclaw",     "identity_file": "openclaw.json"},
])

# Start — performs all pairwise handshakes automatically
session.start()
# [PiQrypt Session] ✅ Session started: sess_a3f9b2c1d4e5f6a7
#   Agents    : llm, trading_bot, openclaw
#   Handshakes: 3 co-signed
#   Timestamp : 1740477600

# Stamp a co-signed interaction between two agents
session.stamp("llm", "recommendation_sent", {
    "symbol": "AAPL",
    "action": "buy",
    "confidence": 0.87,
    "reasoning": "Strong Q4 earnings, positive momentum",
}, peer="trading_bot")
# → event in LLM memory:         "I sent recommendation to TradingBot"
# → event in TradingBot memory:  "I received recommendation from LLM"
# → both share interaction_hash

# Stamp a unilateral action
session.stamp("trading_bot", "order_executed", {
    "symbol": "AAPL",
    "action": "buy",
    "price": 182.50,
    "quantity": 100,
    "order_id": "ORD-20260225-001",
})

# End session
session.end()

# Export full audit — all agents, all events, all handshakes
session.export("trading-session-audit.json")
# $ piqrypt verify trading-session-audit.json

What each agent's memory contains

LLM memory (~/.piqrypt/llm/events/):

{ "event_type": "session_start",         "session_id": "sess_a3f9..." }
{ "event_type": "a2a_handshake",         "peer_agent_id": "trading_bot_id", "peer_signature": "..." }
{ "event_type": "a2a_handshake",         "peer_agent_id": "openclaw_id",    "peer_signature": "..." }
{ "event_type": "recommendation_sent",   "interaction_hash": "c7d2...", "peer_agent_id": "trading_bot_id" }
{ "event_type": "session_end",           "session_id": "sess_a3f9..." }

TradingBot memory (~/.piqrypt/trading_bot/events/):

{ "event_type": "session_start",                    "session_id": "sess_a3f9..." }
{ "event_type": "a2a_handshake",                    "peer_agent_id": "llm_id", "peer_signature": "..." }
{ "event_type": "recommendation_sent_received",     "interaction_hash": "c7d2...", "peer_agent_id": "llm_id" }
{ "event_type": "order_executed",                   "session_id": "sess_a3f9..." }
{ "event_type": "session_end",                      "session_id": "sess_a3f9..." }

What links them:

  • Same session_id across all memories
  • Same interaction_hash in co-signed events
  • Each memory has the peer's signature embedded

Framework-agnostic

piqrypt-session works independently of any agent framework. Combine with framework bridges for full coverage:

# LangChain agent + AutoGen agent in the same session
from piqrypt_langchain import PiQryptCallbackHandler
from piqrypt_autogen import AuditedAssistant
from piqrypt_session import AgentSession

# Each framework stamps its own actions
lc_handler = PiQryptCallbackHandler(identity_file="langchain-agent.json")
ag_assistant = AuditedAssistant(name="analyst", llm_config=llm_config,
                                 identity_file="autogen-agent.json")

# Session links them together
session = AgentSession([
    {"name": "langchain_agent", "identity_file": "langchain-agent.json"},
    {"name": "autogen_agent",   "identity_file": "autogen-agent.json"},
])
session.start()

# All individual actions are stamped by the bridges
# All interactions between agents are co-signed by the session
session.stamp("langchain_agent", "analysis_sent", {
    "result": analysis_output
}, peer="autogen_agent")

N agents — automatic handshakes

Agents Handshakes
2 1
3 3
4 6
5 10
N N*(N-1)/2

All handshakes happen automatically on session.start().


Verify

piqrypt verify trading-session-audit.json
# ✅ Session sess_a3f9b2c1d4e5f6a7
#    Agents    : 3
#    Handshakes: 3 co-signed
#    Events    : 14 total
#    Integrity : verified
#    Forks     : 0

Scope

Use case Profile
Development / PoC AISS-1 (Free, included)
Non-critical production AISS-1 (Free)
Regulated production AISS-2 (Pro)


PiQrypt — Verifiable AI Agent Memory

Metadata

Release files for piqrypt-session-multi-ai-agents 1.1.0

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

Source distribution (sdist)

Source distribution for piqrypt-session-multi-ai-agents 1.1.0
File Size Uploaded
piqrypt_session_multi_ai_agents-1.1.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for piqrypt-session-multi-ai-agents 1.1.0
File Interpreter ABI Platform
piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / piqrypt_session_multi_ai_agents-1.1.0.tar.gz

Download URL piqrypt_session_multi_ai_agents-1.1.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
062a3e5fe74e6fe769744589e956fa67ded1cf08345bd62e12cbfd7c1a14a4a8
BLAKE2b-256 checksum
How to use checksums
0a1301ad102b118f4b004d35e5a3006b1598430a3935cd9881fa4544d016ba3c
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 Apr 19, 2026.

Transparency log

Release files / piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl

Download URL piqrypt_session_multi_ai_agents-1.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4094e00ca16eab60e4cafa2e701c9bf928d827032ac680cc27db2c819387c36a
BLAKE2b-256 checksum
How to use checksums
a0c9bed79fe69c79e1403b986ba2b23667c9e9761b7440732ed4c608ee229f51
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 Apr 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.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