LCEL chains & agents
with a hash-chained trail
Wrap LangChain runnables and tool agents with one tracer. Every chain run and agent step becomes a linked decision → outcome on an append-only ledger — with public labels you control for the explorer and proof pages.
Agent langchain-demo · id 8a6bf753…510f · live on the public ledger · no credit card required
This example is already on the public chain
Same script as below, pointed at production. Open these logged-out — no account required.
Explorer
Filter by agent id
8a6bf753-c2b1-441b-9f5e-2e82860f510f
langchain-demo · chain + agent pairs →
Decision proof
Agent run · research-agent
6e917140…a8ac
Outcome proof
Agent result · tools + preview
ad97bde5…f660
Also: chain decision · chain outcome (contract-summary-chain pair).
Agents ran — but can you prove what they chose?
Traces ≠ commitments
Observability tools show logs. Audifact seals decision-time context into a hash-linked, publicly verifiable trail.
Public vs private
Share short public_decision_label / public_outcome_label on proof pages; keep full payloads under your org.
One .wrap()
LCEL chains and tool agents — same tracer, linked decision/outcome pairs, works with mocks or real models.
LangChain tracer — chain + agent
Duck-typed mocks so you can demo without an LLM. Set an API key to write real signed events.
from audifact.langchain import AudifactLangChainTracer
tracer = AudifactLangChainTracer(
api_key="af_YOUR_API_KEY",
base_url="http://localhost", # or https://api.audifact.io
agent_name="langchain-demo",
include_context=True,
)
traced = tracer.wrap(chain)
traced.invoke({"input": "What is the liability cap?"})
Run the full example
pip install "git+https://github.com/audifact/audifact-sdk.git"
# monorepo: pip install -e "./sdk[langchain]"
export AUDIFACT_API_KEY=af_...
export AUDIFACT_BASE_URL=https://api.audifact.io # local: http://localhost
export AUDIFACT_PUBLIC_BASE_URL=https://audifact.io
python sdk/examples/frameworks/langchain_basic_and_agent.py
Browser preview only — use the script above to write the ledger.
Readable pairs in the explorer
public_decision_label: Chain run · {name} · {preview}
public_outcome_label: Chain result: {summary}
public_decision_label: Agent run · {name} · {task}
public_outcome_label: Agent result: {answer} · tools in public_output_json
Public proofs show short Context/Output previews only; full tool payloads stay private when include_context=True. See live proofs above or the explorer (agent id filter).
From LCEL to graphs
Need multi-node graphs and routes? LangGraph guide → Same ledger, different orchestration story.