Skip to main content

langchain-primordia

Economic settlement infrastructure for LangChain agents.

What is this?

Not just cost tracking. Clearing-grade settlement for AI agents.

MSR (local receipts)  →  IAN (kernel-signed netting)  →  MBS/ALR (audit-grade)
     FREE                      5 bps                        $25K+

Installation

pip install langchain-primordia

Quick Start (Shadow Mode - FREE)

from langchain_openai import ChatOpenAI
from langchain_primordia import PrimordiaCallbackHandler

handler = PrimordiaCallbackHandler(agent_id="agent-alpha")
llm = ChatOpenAI(callbacks=[handler])

response = llm.invoke("Hello")

# Local receipts accumulated
print(f"Receipts: {len(handler.get_receipts())}")
print(f"Total: ${handler.get_total_usd():.4f}")

Settlement (PAID - 5 bps)

When you need proof of settlement between agents:

handler = PrimordiaCallbackHandler(
    agent_id="agent-alpha",
    submit=True
)

# ... run your agent ...

# Net receipts into kernel-signed IAN
result = handler.net_receipts()

if "signed_ian" in result:
    # This is clearing-grade proof
    # Agent B can verify this signature
    print("IAN signed by Primordia kernel")
else:
    # 402 - need to purchase credit
    print(result["purchase_url"])

Audit-Grade Reports (Enterprise)

# Requires pack_team ($25K) minimum
mbs = handler.get_balance_sheet()

if "error" in mbs:
    # 402 - PACK_TEAM REQUIRED
    print("Purchase pack_team for audit-grade MBS")
else:
    # Kernel-signed Machine Balance Sheet
    print(mbs)

The Rail

Stage What Cost
MSR Local receipt per LLM call FREE
Index Submit receipts to kernel FREE
IAN Kernel-signed netting 5 bps
MBS Machine Balance Sheet $100 (pack_team min)
ALR Agent Liability Report $100 (pack_team min)
Default Resolution $25,000

Why Kernel Signature?

Agent A: "I paid Agent B $100"
Agent B: "Prove it"
Agent A: shows IAN with Primordia kernel signature
Agent B: verifies signature → TRUST

No kernel signature = no clearing-grade proof.

Links

License

MIT

Metadata

Release files for langchain-primordia 0.1.1

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

Source distribution (sdist)

Source distribution for langchain-primordia 0.1.1
File Size Uploaded
langchain_primordia-0.1.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-primordia 0.1.1
File Interpreter ABI Platform
langchain_primordia-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / langchain_primordia-0.1.1.tar.gz

Download URL langchain_primordia-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d4e87ac7c8f3fc26a3f453c56ec15b35d4569cf4837322f908548bcd06989ce3
BLAKE2b-256 checksum
How to use checksums
48bdece88dc49a4c12c7d2d970e30d3760b62f688582212ed9dc4d8d59b06bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / langchain_primordia-0.1.1-py3-none-any.whl

Download URL langchain_primordia-0.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e03414aa5e42b3c63668d1826851925dd07fe0ddd32ca97e543760a33b2e5478
BLAKE2b-256 checksum
How to use checksums
b9bff2684219a347fc1e352f93f53cacccccd301ca26faf82796761a60d19d59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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