Skip to main content

anlyon-langchain

LangChain integration for Anlyon: AnlyonTracer records a chain or agent invocation as an Anlyon run with nested spans.

Trace a LangChain invocation

from anlyon import Client
from anlyon_langchain import AnlyonTracer

client = Client(api_key="anlyon_live_...")
tracer = AnlyonTracer(client, application="support-agent")

# Pass the callback to any LangChain runnable/agent invocation.
result = chain.invoke({"question": "Where is my order?"}, config={"callbacks": [tracer]})

The handler creates one Anlyon run for the root callback and parent-linked workflow_step, model_call, and tool_call spans for nested callbacks. It is best-effort: Anlyon transport failures never change the application result.

Installation

pip install anlyon-langchain

Legacy namespaces

The classes below sit on the memory and sessions namespaces. They remain supported and are not part of the governed execution path.

Retrieval

from anlyon import Client
from anlyon_langchain import AnlyonVectorStore

client = Client()  # uses ANLYON_API_KEY
store = AnlyonVectorStore(client, collection="docs")
retriever = store.as_retriever()

Chat history

AnlyonChatMessageHistory keeps a chain's conversation in an Anlyon session. It persists across processes and is summarized automatically once the thread gets long.

from anlyon import Client
from anlyon_langchain import AnlyonChatMessageHistory
from langchain_core.runnables.history import RunnableWithMessageHistory

client = Client()

chain_with_history = RunnableWithMessageHistory(
    chain,
    lambda session_id: AnlyonChatMessageHistory(client, session_id),
    input_messages_key="input",
    history_messages_key="history",
)

# `session_id` is an Anlyon session id. Create one with client.sessions.create()
chain_with_history.invoke(
    {"input": "Where is my order?"},
    config={"configurable": {"session_id": "ses_abc123"}},
)

.messages reads the thread back as LangChain messages, .add_messages() appends a turn in one round-trip, and .clear() truncates the thread while keeping the session id usable.

See the Anlyon docs for the full guide.

License

MIT

Metadata

Release files for anlyon-langchain 0.2.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 anlyon-langchain 0.2.1
File Size Uploaded Provenance Actions
anlyon_langchain-0.2.1.tar.gz 10.3 kB With provenance Details for anlyon_langchain-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anlyon-langchain 0.2.1
File Interpreter ABI Platform Actions
anlyon_langchain-0.2.1-py3-none-any.whl Python 3 none any Details for anlyon_langchain-0.2.1-py3-none-any.whl

Total release size: 20.2 kB

Release files / anlyon_langchain-0.2.1.tar.gz

Download URL anlyon_langchain-0.2.1.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f01189d6aac3f91eaf02ac1680e1fc5b73979e718a1f28f3e0838e447ee52d73
BLAKE2b-256 checksum
How to use checksums
b9737355d7212e6ec4f80358806c57812296cb8d280c1b2abacc65a10eed955d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / anlyon_langchain-0.2.1-py3-none-any.whl

Download URL anlyon_langchain-0.2.1-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a06117c20b322894a5e78414f3f327c72a94964dba1e6966326c11da8427301
BLAKE2b-256 checksum
How to use checksums
d34bba444bf27825aea84ce88936c521126585e6f122071ce8ec7a276cf026fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Security for anlyon-langchain 0.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anlyon_langchain-0.2.1.tar.gz

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 Oct 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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